quartic_sdk.model.helpers

Module Contents

Classes

Validation

ModelUtils

Contains utils to pickle model and add checksum

class quartic_sdk.model.helpers.Validation

Bases: object

classmethod get_model_prediction_and_time(cls, model, test_df)

evaluates prediction of model with test data frame :param model: Instance BaseQuarticModel :param test_df: Test Dataframe :return: tuple of prediction and processing time

classmethod validate_prediction_output(cls, result: pandas.Series)

Validates if prediction output is of type Series and values of series are float64 :param result: pandas series :return: None :raises: InvalidPredictionException

classmethod validate_window_prediction_output(cls, result: Union[int, float, None])

Validates if the prediction for window model is returning a single value or None (allowed - int/float/None)

classmethod validate_model(cls, model, test_df)

Validates the model for size and performance :param model: Instance of BaseQuarticModel :param test_df: Test dataframe

class quartic_sdk.model.helpers.ModelUtils

Bases: object

Contains utils to pickle model and add checksum

classmethod get_checksum(cls, model_bytes)

Calculates the checksum for given byte array :param model_bytes: pickeled model :return: Returns the checksum of model

classmethod get_pickled_object(cls, object)

Generates pickle for model and adds checksum to it :param object: Model to pickle :return: Pickled Model as string

classmethod get_performance_test_df(cls, test_df: pandas.DataFrame)

Creates a Test data frame of size 100 rows(for 30sec batch approximation) :param test_df: Test Data frame :return: Returns test dataframe with configured number of rows