API

hcrystalball.model_selection Package

Functions

add_model_to_gridsearch(model, grid_search)

Extends gridsearch with provided model.

filter_data(df[, include_rules, exclude_rules])

Filter provided dataframe by {column:value} rules.

get_gridsearch(frequency[, horizon, …])

Get grid search object based on selection criteria.

load_model_selector(folder_path)

Load information about stored model selection

partition_data(df, partition_by)

Partition data by values found in one or more columns.

partition_data_by_values(df, column, …[, …])

Partition data by one column and a fixed set ov values within that column.

prepare_data_for_training(df, frequency, …)

Prepare data for model selection.

run_model_selection(df, grid_search, …[, …])

Run parallel cross validation on data and select best model

select_model(df, target_col_name, …[, …])

Find the best model from grid_search for each partition

select_model_general(df, grid_search, …[, …])

Run cross validation on data and select best model

Classes

FinerTimeSplit([n_splits, horizon, …])

Time series cross-validator.

ModelSelector(horizon, frequency[, …])

Enable large scale cross validation easily accessible.

ModelSelectorResult(best_model, cv_results, …)

Consolidate infromation/methods from cross validation for 1 time series

Variables

load_best_model(*[, expert_type, …])

Returns unpickled file or json metadata from directory.

load_model_selector_result(*[, expert_type, …])

Returns unpickled file or json metadata from directory.

hcrystalball.wrappers Package

Functions

get_sklearn_wrapper(model_cls, **model_params)

Factory function returning the model specific SklearnWrapper with provided model_cls parameters.

Classes

ProphetWrapper([growth, changepoints, …])

Wrapper for fbprophet.Prophet model

ExponentialSmoothingWrapper([endog, trend, …])

Wrapper for ExponentialSmoothing (see other parameters there)

SimpleSmoothingWrapper([endog, name, …])

Wrapper for SimpleExpSmoothing (see other parameters there)

HoltSmoothingWrapper([endog, exponential, …])

Wrapper for Holt (see other parameters there)

SarimaxWrapper([order, seasonal_order, …])

Wrapper for ARIMA and AutoARIMA

TBATSWrapper([use_box_cox, box_cox_bounds, …])

Wrapper for TBATS model

BATSWrapper([use_box_cox, box_cox_bounds, …])

Wrapper for BATS model

hcrystalball.ensemble Package

Classes

SimpleEnsemble(base_learners[, …])

SimpleEnsemble model, which takes a list of any hcrystalball model wrapper instance(s) as base learners and aggregates their prediction using ensemble_func.

StackingEnsemble(base_learners, meta_model)

StackingEnsemble model, which takes a list of any hcrystalball model wrapper instance(s) as base learners.

hcrystalball.feature_extraction Package

Classes

HolidayTransformer([country_code, …])

Generate holiday feature based on provided ISO code

SeasonalityTransformer([auto, freq, …])

Generate seasonal feature columns using one-hot encoding.

hcrystalball.compose Package

Classes

TSColumnTransformer(**kwargs)

Time Series compatible ColumnTransformer.

hcrystalball.preprocessing Package

Classes

TargetTransformer(estimator, y_transformer)

Enable transformation of the target.

hcrystalball.metrics Package

Functions

get_scorer([function])

Get a scorer supporting storing data for gridsearch from string.

make_ts_scorer(score_func[, …])

Make a scorer from a performance metric or loss function.

hcrystalball.utils Module

Functions

get_estimator_repr(model[, n_char_max])

Get the string representation of a model

get_sales_data([n_dates, n_assortments, …])

Load subset of Rossmann store sales dataset.

generate_estimator_hash(model)

Generate a unique hash for a model using its string representation

generate_multiple_tsdata([n_dates, …])

Provide easy way how to generate dummy data for tests or tutorial purposes

generate_partition_hash(partition_label)

Generate a unique hash for data partition

generate_tsdata([n_dates, random_state])

Generate dummy daily time series data compatible with hcrystalball API.

optional_import(module_path, class_name, …)

Imports optional dependencies.