From 2afa185dc61142d686d834cf592ab72e174297b9 Mon Sep 17 00:00:00 2001 From: robcaulk Date: Wed, 2 Nov 2022 18:34:56 +0100 Subject: [PATCH] add integrated tests for PCA and DBSCAN --- tests/freqai/test_freqai_interface.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tests/freqai/test_freqai_interface.py b/tests/freqai/test_freqai_interface.py index c46f9e815..2bc65d52e 100644 --- a/tests/freqai/test_freqai_interface.py +++ b/tests/freqai/test_freqai_interface.py @@ -27,13 +27,13 @@ def is_mac() -> bool: return "Darwin" in machine -@pytest.mark.parametrize('model', [ - 'LightGBMRegressor', - 'XGBoostRegressor', - 'XGBoostRFRegressor', - 'CatboostRegressor', +@pytest.mark.parametrize('model, pca, dbscan', [ + ('LightGBMRegressor', True, False), + ('XGBoostRegressor', False, True), + ('XGBoostRFRegressor', False, False), + ('CatboostRegressor', False, False), ]) -def test_extract_data_and_train_model_Standard(mocker, freqai_conf, model): +def test_extract_data_and_train_model_Standard(mocker, freqai_conf, model, pca, dbscan): if is_arm() and model == 'CatboostRegressor': pytest.skip("CatBoost is not supported on ARM") @@ -41,6 +41,8 @@ def test_extract_data_and_train_model_Standard(mocker, freqai_conf, model): freqai_conf.update({"freqaimodel": model}) freqai_conf.update({"timerange": "20180110-20180130"}) freqai_conf.update({"strategy": "freqai_test_strat"}) + freqai_conf['freqai']['feature_parameters'].update({"principal_component_analysis": pca}) + freqai_conf['freqai']['feature_parameters'].update({"use_DBSCAN_to_remove_outliers": dbscan}) strategy = get_patched_freqai_strategy(mocker, freqai_conf) exchange = get_patched_exchange(mocker, freqai_conf)