feature(Inference): Created the inference process, added model saving. (#153)

* feat: Basic scaffolding up for inference process after training.

* feat: Saving and loading models works. Inference works nearly.

* feat: Added inference pipeline.

* feat: Saving model now accoring to date and time; loading models now selects from latest file. Fixed the creation of dictionary of models.

* feat: Added lightweight asset config, but full pipeline.

* feat: Added new naming for dictionary.

* fix: Fixed dictionary naming convention.

* fix: Fixed naming again, now the model structure is good

* fix: Changed the output path and the return values from run_pipeline.

* feat: Added function to make sure folder exists for output models.

Co-authored-by: Daniel Szemerey <szemereydaniel@gmail.com>
This commit is contained in:
Daniel Szemerey
2022-01-11 19:15:58 +01:00
committed by GitHub
co-authored by Daniel Szemerey
parent 255910cb40
commit 55f083638f
9 changed files with 210 additions and 14 deletions
+46 -1
View File
@@ -14,7 +14,7 @@ def get_dev_config() -> tuple[dict, dict, dict]:
)
data_config = dict(
assets = ['daily_crypto'],
assets = ['daily_only_btc'],
other_assets = [],
exogenous_data = [],
load_non_target_asset= True,
@@ -86,3 +86,48 @@ def get_default_ensemble_config() -> tuple[dict, dict, dict]:
return model_config, training_config, data_config
def get_lightweight_ensemble_config() -> tuple[dict, dict, dict]:
training_config = dict(
primary_models_meta_labeling = True,
dimensionality_reduction = True,
n_features_to_select = 30,
expanding_window_primary = False,
expanding_window_meta_labeling = True,
sliding_window_size_primary = 380,
sliding_window_size_meta_labeling = 240,
retrain_every = 20,
scaler = 'minmax', # 'normalize' 'minmax' 'standardize' 'none'
)
data_config = dict(
assets = ['daily_crypto_lightweight'],
other_assets = ['daily_etf'],
exogenous_data = ['daily_glassnode'],
load_non_target_asset= True,
log_returns= True,
forecasting_horizon = 1,
own_features = ['level_2' ],
other_features = ['level_2'],
exogenous_features = ['standard_scaling'],
index_column= 'int',
method= 'classification',
no_of_classes= 'two',
narrow_format = False,
)
regression_models = ["Lasso", "KNN"]
classification_models = ['LR_two_class', 'SVC']
meta_labeling_models = ['LR_two_class', 'LGBM']
ensemble_model = 'Average'
model_config = dict(
primary_models = regression_models if data_config['method'] == 'regression' else classification_models,
meta_labeling_models = meta_labeling_models,
ensemble_model = ensemble_model
)
return model_config, training_config, data_config