quartic_sdk.model.BaseReckonExpression

Module Contents

Classes

BaseReckonExpression

A Base Class Model for Wrapping User Models into Quartic Deployments.

class quartic_sdk.model.BaseReckonExpression.BaseReckonExpression(log_level: str = 'INFO')

A Base Class Model for Wrapping User Models into Quartic Deployments. User needs to inherit this class and override the evaluate method with his operations

Note: Please do not overwrite method :func: save as it contains utilities to validate and deploy expression to the Quartic AI Platform

save : private save method to save expression to the Quartic AI Platform predict : abstract predict method which needs to overridden

save(self, client, output_tag_name: str, needs: List[int], asset: int, is_streaming: bool, tag_category: str, test_df: pandas.DataFrame, update: bool = False)
Parameters
  • client – Quartic GraphQLClient

  • output_tag_name – name for Expression output tag

  • needs – Feature Tag ids used in the model

  • asset – Asset Id

  • is_streaming – Streaming

  • tag_category – Tag Category

  • test_df – Test input dataframe to validate input and prediction output in agreement with Quartic AI Platform

  • update – Optional - Update the model if already exists

Returns

None on successfully storing the model to the Quartic AI Platform

abstract evaluate(self, input_df: pandas.DataFrame)pandas.Series

Abstract method for custom predict method :param input_df: Input Data frame for prediction :return: Returns pd

with_window(duration)

This is decorator method for window support User can decorate predict method with this decorator for window support :param duration: window duration in sec :return: None

moving_window_evaluate(self, input_df: pandas.DataFrame, previous_df: pandas.DataFrame)

This method calls predict for with window model along with respective window data for each row in input_df. :param input_df: input dataframe :param previous_df: previous dataframe for with window model :return: pandas series of predictions along with timestamps respective to input_df records