bluecast.tests.test_cast_cv_regression

Module Contents

Classes

CustomLRModel

Base class for all ML models.

MyCustomLastMilePreprocessing

This class is an entry point for last mile computations before model training or tuning. It is an abstract class

CustomModel

Base class for all ML models.

Functions

synthetic_train_test_data(→ Tuple[pandas.DataFrame, ...)

synthetic_calibration_data(→ pandas.DataFrame)

test_blueprint_cv_xgboost(synthetic_train_test_data, ...)

Test that tests the BlueCast cv class

test_bluecast_cv_fit_eval_with_custom_model()

test_bluecast_cv_with_custom_objects()

bluecast.tests.test_cast_cv_regression.synthetic_train_test_data() Tuple[pandas.DataFrame, pandas.DataFrame]
bluecast.tests.test_cast_cv_regression.synthetic_calibration_data() pandas.DataFrame
bluecast.tests.test_cast_cv_regression.test_blueprint_cv_xgboost(synthetic_train_test_data, synthetic_calibration_data)

Test that tests the BlueCast cv class

class bluecast.tests.test_cast_cv_regression.CustomLRModel

Bases: bluecast.ml_modelling.base_classes.BaseClassMlRegressionModel

Base class for all ML models.

Enforces the implementation of the fit and predict methods. If hyperparameter tuning is required, then the fit method should implement the tuning.

fit(x_train: pandas.DataFrame, x_test: pandas.DataFrame, y_train: pandas.Series, y_test: pandas.Series) None
predict(df: pandas.DataFrame) numpy.ndarray

Predict on unseen data.

:return numpy array of predictions

class bluecast.tests.test_cast_cv_regression.MyCustomLastMilePreprocessing(trained_patterns: Any | None = None)

Bases: bluecast.preprocessing.custom.CustomPreprocessing

This class is an entry point for last mile computations before model training or tuning. It is an abstract class and must be extended by the user. For fit_transform x_train and y_train are passed. For transform x_test and y_test are passed in the BlueCast pipeline. Use prediction_mode = False to skip processing the missing targets. :param trained_patterns: Optional. Can we used to save anything from training to be loaded and used in transform. If more placeholders are needed, use a dictionary.

custom_function(df: pandas.DataFrame) pandas.DataFrame
fit_transform(df: pandas.DataFrame, target: pandas.Series) Tuple[pandas.DataFrame, pandas.Series]
transform(df: pandas.DataFrame, target: pandas.Series | None = None, predicton_mode: bool = False) Tuple[pandas.DataFrame, pandas.Series | None]

Use prediction mode to not process the missing target during inference.

class bluecast.tests.test_cast_cv_regression.CustomModel

Bases: bluecast.ml_modelling.base_classes.BaseClassMlRegressionModel

Base class for all ML models.

Enforces the implementation of the fit and predict methods. If hyperparameter tuning is required, then the fit method should implement the tuning.

fit(x_train: pandas.DataFrame, x_test: pandas.DataFrame, y_train: pandas.Series, y_test: pandas.Series) None
predict(df: pandas.DataFrame) numpy.ndarray

Predict on unseen data.

:return numpy array of predictions

bluecast.tests.test_cast_cv_regression.test_bluecast_cv_fit_eval_with_custom_model()
bluecast.tests.test_cast_cv_regression.test_bluecast_cv_with_custom_objects()