* feat(HPO): added `run_hpo` script
* fix(Linter): ran
* feat(HPO): removed any reference to sweep (superseeded by optuna)
* fix(HPO): optimize for sharpe
* fix(Config): removed glassnode data, save trials from hpo
* feat(Labelling): added three-balanced method works again
* fix(BetSizing): set the correct class labels
* fix(HPO): powerset should return what's expected, added two new normalization methods
* fix(Linter): ran
* fix(DataLoader): sort the dataframe when fetching data
* fix(Config): only take z-score of other assets
* refactor(Evaluate): print out accuracy, f1, etc. for the final & meta predictions, separated out evaluation step
* fix(Linter): ran
* fix(Tests): syntax change
* fix(Inference): runs now again
* fix(Linter): ran
* feat(Labeling): purge overlapping events, sort dataframe at loading time
* fix(Linter): ran
* refactor(Labeling): moved purge_overlapping_events one abstraction level higher
* fix(Data): renamed class
* fix(Data): corrected parameter name
* fix(Config): parameters
* fix(Data): fixed path
* fix(Data): uncommented required code
* feat(EventFilters): use vol based CUSUM
* fix(Config): only retrain every 2000 samples
* fix(Config): filter out even more events
* fix(Inference): added remove_overlapping_events
* refactor(Types): simplified type hierarchy
* feat(Project): use 5 minute data, running training in parallel, sped up cusum filter by 10x with numba
* fix(WalkForward): inference mini-batch parallelization
* fix(WalkForward): don't use the parallel version of any of the functions
* feat(CI): download the data required
* fix(Project): 5min_crypto folder added
* fix(Evaluate): make sure we have numerical stability in returns
* feat(Models): use SKLearn models directly to enable composability
* feat(Inference): batched inference now working, added forecasting_horizon
* fix(Inference): works again
* fix(Inference)
* chore(Models): remove unused Ensemble model
* fix(Labeller): don't just forward shift returns, also take the sum of the data happened until then
* Update test.yml
* fix(MetaLabeling): previously misinterpreted meta-labeling, now also multiplying base model's prediction with the meta model's prediction
* fix(Evaluate): print results
* fix(Evaluate): make sure we have numerical stability in returns
* fix(Inference): only output and print stats in training mode
* fix(Evaluate): don't add miniscule amount to result
* refactor(Training): added InferenceResult & TrainedModel types
* refactor(Pipeline): introduced TrainingOutcome, BetSizingWithMetaOutcome, etc.
* fix(Pipeline): getting it to compile
* refactor(WalkForward): separate preprocessing step
* feat(Pipeline): separate out transformations processing step
* refactor(Pipeline): use the Directional model terminology, put bet_sizing into pipeline instead of hiding it in a step
* refactor(WalkForward): moved functions to separate folder
* fix(WalkForward): use sparse array to store models, process transformations in parallel (lot faster)
* fix(Tests): and evaluation
* fix(Tests): for realz
* fix(Inference): preloading everything now, renamed primary models to directional models
* fix(BetSizing): was running transformations on the wrong data, oops
* fix(BetSizing): concatenated on the wrong axis accidentally
* fix(Reporting): able to use the new Stats type
* fix(BetSizing): renamed int column names
* fix(Portfolio): name the column properly
* fix(Reporting): rename the correct Series, lol
* fix(Inference): walk_forwad_inference() can deal with models not being aligned with the starting index
* fix(WalkForward): accidentally using the wrong index
* fix(WalkForward): use the correct indicies to fetch last model/transformations
* fix(CI): changed the name of the results
* refactor(Config): use a Config object instead of dictionary of dictionaries!
* fix(Config): use default_ensemble_config
* fix(Portfolio): fixed portfolio construction
* refactor(Project): removed regression method (we can still use regression models, but we'll need map them to classes later)
* fix(Training): removed mistakenly left in `method` parameter
* fix, feat: Fixed inference processing data. Add transformation attribute.
* feat: Added transformations step, refractored the loop to make more sense (divided the train and inference loop).
* feat: Truncated models over time and transformations over time. Fixed some typing aswell.
* fix: Fixed a number of out of array problems.
* feat: Inference now works!
* fix(Steps): runtime error not checking for None
* fix(Steps): preloaded transformers are not optional anymore, sped up training by temporary increasing the retrain_every
* fix(CI): disable ray memory monitoring
* refactor(Inference): removed truncate_models and replaced it with filling X with NaN until inference should start
* feat(Inference): added index_from parameter
* fix(Tests): walk_forward test
* refactor(Pipeline): only predict one asset
* refactor(Inference): removed select_models step, inference code moved to run_inference.py so it matches convention (similar to run_pipeline.py)
* fix(Evaluation): adjust transaction costs
* fix(Config): adjusted retrain_every
Co-authored-by: Daniel Szemerey <szemereydaniel@gmail.com>
Co-authored-by: Mark Aron Szulyovszky <mark.szulyovszky@gmail.com>
* feat(Transformations): removed feature-selection pre-processing step completely
* fix(Core): removed unnecessary `original_X`
* fix(Transformations): use the X_expanding_window to transform subsequent data
* fix(RFE): should check for model correctly
* fix(Config): only re-train the model every 40 timestamp
* fix(MetaLabeling): pass in the correct X to meta-labeling step
* fix(Transformation): PCA should at least keep as many features as sliding_window_size
* feat(Transformations): cache transformations across the same asset
* fix(Tests): missing preloaded_transformations arg
* chore(Config): got rid of unnecessary 'classification_models' and 'regression_models' dictionary keys
* feat: Added optional import of models.
* fix: Models weren't wrapped into abstract class, fixed it.
* chore: Deleted leftover comments.
* fix: Same merge commit as on remote.
* fix: System wasn't putting in RF because there was no differentiation between RF as regressor and RF as classificator.
* fix(Models): use the XGBoostModel wrapper
Co-authored-by: Daniel Szemerey <szemereydaniel@gmail.com>
Co-authored-by: Mark Aron Szulyovszky <mark.szulyovszky@gmail.com>
* feat: Basic pipeline extended.
* feat: Added conversion of model list to existing structure (model_name, model_in_time). Fixed loading of previous models and dicts.
* fix: Had an unfinished function.
* fix: Inference wasn't getting model_over_time. Now transformations are not getting it either yet.
Co-authored-by: Daniel Szemerey <szemereydaniel@gmail.com>
* feat(Transformations): added Transformations abstraction & handling in walk_forward_train() & inference()
* fix(WalkForward): use Dataframes to call Transformation.fit_transform()
* feat(WalkForward): restored option for models to recieve unscaled data
* fix(Transformations): output DataFrame as expected
* fix(Tests): missing new property
* refr: Took out main primary and secondary loops and data processing.
* feat: Tidied the code up.
* feat: Saving models and results now works in a type safe way.
* fix: There was error in the saving function.
* chore: Took out some remaining comments.
* fix: Fixed the previous data checking process.
* feat: Fixed model selection method. I will continue the inference after we merged.
Co-authored-by: Daniel Szemerey <szemereydaniel@gmail.com>
* refactor(WalkForward): separate train / test functions (draft) to potentially help with inference later
* fix(Training): use the new separate train / test functions
* feat(Training): return and pass in scalers that are necessary for inference
* fix(Project): runtime errors
* fix(WalkForward): use the correct `train_from` value
* fix(Tests): for new walk_forward functions()
* refactor(WalkForward): rename `walk_forward_test()` to `walk_forward_inference()`
* 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>
* refactor(Naming): use `primary_models` & `meta_labeling_models`
* refactor(Naming): using primary * meta_labeling across config and in pipeline
* feat(Pipeline): added back Ensemble models
* fix(Pipeline): compiler error
* fix(Config): typo
* chore(Pipeline): removed unused averaging step
* revert the changes in discretizing
* chore(Pipeline): remove sharpe improvement logging
* fix(Pipeline): ensemble predictions should be a pd.Series instead of a DataFrame
* fix(Pipeline): discard unnecessary ensemble_probabilities
* fix(Pipeline): fixes regarding various meta-labeling ensemble bugs
* fix(Reporting): use the new naming convention
* fix(Reporting): use the right variable
* feat(Sweep): new sweep for ensemble models
* fix(Sweep): config reference
* fix(Config): simplified dev config
* fix(Models): use the faster LR model
* fix(Models): use LGBM in the meta-labeling model for speed
* fix(Selection): always use the first model for feature selection, commented out caching from select_features() as it's close to redundant in terms of speed
* fix(Selection): dynamic step size for feature selection
* refactor(Pipeline): type definition
* chore(Cache): renamed clear_cache script
* feat(Config): dynamic feature selection is now a toggleable feature
* fix(Training): not passing in necessary parameter
* feat: Added collection of models into a dictionary.
* feat: Models are now saved in a structured way into a dictionary.
* Rename run_model_test.py to run_model_dev.py
* fix(Pipeline): missing variable statement
Co-authored-by: Mark Aron Szulyovszky <mark.szulyovszky@gmail.com>
* feature(MetaLabeling): added hacky prototype
* fix(MetaLabeling): drop index until first valid X & y
* fix(MetaLabeling): transform both X & y before feature selection
* fix(MetaLabeling): got feature selection to work
* fix(MetaLabeling): correct values for meta_y
* feat(MetaLabeling): created predictions multiplied by bet sizes
* feat(Pipeline): print out averaged result
* fix(Evaluation): correctly deal with non-discretized data
* fix(Pipeline): use the right column names
* refactor(Pipeline): move out meta-labeling
* refactor(Pipeline): complete refactoring
* feat(CI): post results to PR
* fix(Pipeline): use the correct filename
* chore(Config): removed now redundant feature_selection flag
* feat(Models): added SVC
* fix(Pipeline): accidentally switched two return values
* feat(Sweep): prepared sweep_meta.yaml, moved report_results() into a separate file
* fix(Pipeline): wrong function name
* fix(Sweep): yaml + run_sweep
* fix(Sweep): typo in name
* fix(Reporting): only save averaged results
* feat(MetaLabeling): use optional meta-labeling step for every lvl1 models, before averaging
* feat(Reporting): print out sharpe improvement in meta-labeling step
* fix(Sweep): adjusted config, defaulted to good defaults
* fix(Sweep): adjusted sweep
* feat: Added base functions for Neural Net.
* feat: Added function to handle Neural Nets.
* fix: Fixed fit loop
* feat: Neural Net trains now, need to test it.
* feat: Prediction now works on the neural net.
* fix: Put back config and run_pipeline.py
* fix: Took out import from run_pipeline.
* fix(Models): added get_name(), adjusted pytorch model output size
* fix(Tests): fixed tests
Co-authored-by: Mark Aron Szulyovszky <mark.szulyovszky@gmail.com>
* fix(FeatureExtractor): apply log to transform some series to normality
* feat(DataLoader): add ability of not returning returns when they're not needed (exogenous data), applied log to certain features
* feat(FeatureExtractors): added standard scaling for exogenous data
* feat(FeatureSelection): scale data with the passed in scaler before doing feature-selection
* fix(Config): sweep config
* feat(Models): output probability, store it
* feat(Core): added caching to select_features() and load_data()
* fix(Dependencies): added diskcache
* fix(Training): error when creating results DF
* feat(Models): added xgboost, fixed tests
* refactor(Cache): moved hashing to a separate function, created wrapper functions to separate business logic and caching
* fix(Tests): new syntax
* fix(Model): XGboost can't handle -1 class, so we'll use the deprecated label_encoder fornow
* fix(Model): XGBoost config
* feat(Cache): add run_clear_cache script
* fix(Pipeline) accidentally re-instatiating all_predictions for each asset
* feat(Selection): added prototype feature selection python script
* feat(Utils): added some helpers for the future from Advances in Financial ML book
* feat(Selection): added RFECV
* feat(Selection): added configurable feature selection step into pipeline
* feat(Config): added level_1 & level_2 default config, PCA before feature selection process starts
* feat(Selection): added backup feature selector models if current one can't output feature importance, removed unnecessary array for level-2 models
* fix(Training): deal with zero first value coming out of static models
* feat(Sweep): added feature selection sweep
* fix(Sweep): config problem
* fix(Sweep): config
* chore(Utils): removed unnecessary purged k-fold crossval class
* feat(Config): added dimensionality_reduction as a separate flag
* fix(Sweep): config updated
* fix(Sweep): sweep name
* chore(Config): updated level_2 config to the best performing configuation
* fix(Reporting): use weighted average (with no_of_samples as weights) and only report level-1 OR level-2 model performance
* chore(Config): updated sweep config
* fix(Reporting): missing import
* fix(Evaluation): get_first_valid_return_index can deal with zero valid indexes
* fix(Training): increase threshold for skipping assets
* fix(DataLoader): target asset should be always the first column
* feat: Added ensemble models to sweep and configured naming convention.
* fix: Default value was misconfigured.
* feat(Sweep): separated level-1 and level-2 sweep configs, skip assets with too few samples to train on, simplified model mapping
* fix(Sweep): syntax error
* chore(Sweep): set sweep names accordingly
* fix(Sweep): set sliding window
* fix(Sweep): adjusted sweep config
* fix(Sweep): removed invalid feature extractor preset
Co-authored-by: Mark Aron Szulyovszky <mark.szulyovszky@gmail.com>
* feat(Data): add option to predict 3 classes
* feat(Evaluation): added ability to evaluate 3 class predictions
* chore(Config): set sensible config for regression models
* feat(Data): added option to use balanced or imbalanced three-class data
* feat(Evaluate): correctly track "no_of_samples" now that we have three classes
* chore(Sweep): remove probably not useful scaler values from sweep
* feat(Config): feature extractors are enabled one-by-one with a bool, added previous model to model.fit()
* fix(Sweep): removed unused `other_features` parameter that fails sweep
* feat(Config): using preset names for defining feature extractors again
* fix(Tests): fixed model stub classes
* feat(Models): added `debug_future_lookahead`, sped up LogisticRegression & DecisionTreeClassifier
* feat(Training): added ability to train on expanding_window
* feat(Models): tuned some hyperparameters, added expanding_window to sweep config, fixed tests
* feat(Models): tune parameters of ensemble models
* fix(Config): use window size that works with ensembling
* refactor(Reporting): only report the last model's results, moved wandb-related functions to `reporting`
* fix(Reporting): use .mean() on axis 1 to retain the metrics, fixed get_model_name()
* fix(Config): sweep file syntax
* fix(Config): changed hyperparameter search method to "bayes"
* chore(Sweep): adjusted sweep config based on the results we saw (removed Momentum as well)
* fix(Sweep): only use classification method for now, we're not yet prepared for regression
* feat: Parametricized model selection works now.
* feat: Fixed errors. Sweep generates and you can run it, but it gives an error for model.only_columns attribute.
* feat: Factored the wandb management, default config managment and the model_dictionary out of the run_pipeline to a seperate file.
* fix: Took out prints and fixed the mismatch of ensemble models when classifing.
* fix(Models): added StaticMomentum model to the dictionary, hopefully fixed sklearn-ex RandomForestRegressor problem
* fix(Dependencies): pin scikit-learn-ex's version, moved map_model_name_to_function to `models`
* feat(Sweep): added `run_sweep.py` shortcut
* feat(Pipeline): skip training a meta model if array is empty
Co-authored-by: Mark Aron Szulyovszky <mark.szulyovszky@gmail.com>
* feat(Models): added StaticAverageModel for average ensembling
* feat(Models): made sure we only pipe in predictions to StaticAverageModel, added StaticNaiveModel as potential baseline
* chore(Models): removed unnecessary commented out code
* feat: initial wandb configured. Sweep parameters aren't configured yet.
* feat: Wandb logs now results.
* feat: gitignore.
* fix: Took out print()
* feat: Changed default value of wandb to False.
* feat: Added wandb to turn of automatically if there is no environment variable to start it (when we push it). Added environment configuration aswell.
* feat: Each assets model is seperated into a run that tracks the results.
* fix: Nonetype error, truncated assets.
* fix: Fixed the logging to wandb.
* fix(Core): correct forward returns calculation, classifiers are now working again, only train from when asset returns are available
* feat(Utils): added get_first_valid_return_index()
* feat(Ensemble): return models from `run_whole_pipeline`
* feat(Ensemble): added ensemble step, fixed walk_forward_train_test predictions index confusion,
* chore(Pipeline): remove unnecessary extra ensemble results dataframe
* refactor(Core): removed unnecessary ensemble_train_predict, moved run_single_asset_trainig_pipeline to a separate file
* feat(Training): added scaling on expanding window (the past) to walk_forward_train_test(), now printing out mean sharpe ratio
* feat(CI): added environment.yml file
* chore(Environment): update env.yml
* feat(CI): added testing workflow
* fix(CI): renamed enviroment.yml
* fix(Tests): added missing new parameter to walk_forward_train_test()