diff --git a/docs/freqai.md b/docs/freqai.md index 3d10280dd..e4a451324 100644 --- a/docs/freqai.md +++ b/docs/freqai.md @@ -114,6 +114,7 @@ Mandatory parameters are marked as **Required**, which means that they are requi | `svm_params` | All parameters available in Sklearn's `SGDOneClassSVM()`. See details about some select parameters [here](#removing-outliers-using-a-support-vector-machine-svm).
**Datatype:** Dictionary. | `use_DBSCAN_to_remove_outliers` | Cluster data using DBSCAN to identify and remove outliers from training and prediction data. See details about how it works [here](#removing-outliers-with-dbscan).
**Datatype:** Boolean. | `outlier_protection_percentage` | If more than `outlier_protection_percentage` fraction of points are removed as outliers, FreqAI will log a warning message and ignore outlier detection while keeping the original dataset intact.
**Datatype:** float. Default: `30` +| `reverse_train_test_order` | If true, FreqAI will train on the latest data split and test on historical split of the data. This allows the model to be trained up to the most recent data point, while avoiding overfitting. However, users should be careful to understand unorthodox nature of this parameter before employing it.
**Datatype:** bool. Default: False | | **Data split parameters** | `data_split_parameters` | Include any additional parameters available from Scikit-learn `test_train_split()`, which are shown [here](https://scikit-learn.org/stable/modules/generated/sklearn.model_selection.train_test_split.html) (external website).
**Datatype:** Dictionary. | `test_size` | Fraction of data that should be used for testing instead of training.
**Datatype:** Positive float < 1. diff --git a/freqtrade/freqai/data_kitchen.py b/freqtrade/freqai/data_kitchen.py index 8e68c9a38..5091073aa 100644 --- a/freqtrade/freqai/data_kitchen.py +++ b/freqtrade/freqai/data_kitchen.py @@ -168,9 +168,17 @@ class FreqaiDataKitchen: train_labels = labels train_weights = weights - return self.build_data_dictionary( - train_features, test_features, train_labels, test_labels, train_weights, test_weights - ) + # Simplest way to reverse the order of training and test data: + if self.freqai_config['feature_parameters'].get('reverse_train_test_order', False): + return self.build_data_dictionary( + test_features, train_features, test_labels, + train_labels, test_weights, train_weights + ) + else: + return self.build_data_dictionary( + train_features, test_features, train_labels, + test_labels, train_weights, test_weights + ) def filter_features( self,