diff --git a/freqtrade/constants.py b/freqtrade/constants.py index 7012acb7c..acfca6fa5 100644 --- a/freqtrade/constants.py +++ b/freqtrade/constants.py @@ -8,6 +8,7 @@ from typing import Any, Dict, List, Literal, Tuple from freqtrade.enums import CandleType, PriceType, RPCMessageType +DOCS_LINK = "https://www.freqtrade.io/en/stable" DEFAULT_CONFIG = 'config.json' DEFAULT_EXCHANGE = 'bittrex' PROCESS_THROTTLE_SECS = 5 # sec diff --git a/freqtrade/freqai/RL/BaseReinforcementLearningModel.py b/freqtrade/freqai/RL/BaseReinforcementLearningModel.py index cffab602d..b59c47ad2 100644 --- a/freqtrade/freqai/RL/BaseReinforcementLearningModel.py +++ b/freqtrade/freqai/RL/BaseReinforcementLearningModel.py @@ -119,7 +119,6 @@ class BaseReinforcementLearningModel(IFreqaiModel): prices_train, prices_test = self.build_ohlc_price_dataframes(dk.data_dictionary, pair, dk) dk.feature_pipeline = self.define_data_pipeline(threads=dk.thread_count) - dk.label_pipeline = self.define_label_pipeline(threads=dk.thread_count) (dd["train_features"], dd["train_labels"], diff --git a/freqtrade/freqai/data_kitchen.py b/freqtrade/freqai/data_kitchen.py index 215457992..3f8d0fb4b 100644 --- a/freqtrade/freqai/data_kitchen.py +++ b/freqtrade/freqai/data_kitchen.py @@ -12,7 +12,6 @@ import numpy.typing as npt import pandas as pd import psutil from datasieve.pipeline import Pipeline -from datasieve.transforms import SKLearnWrapper from pandas import DataFrame from sklearn.model_selection import train_test_split @@ -966,35 +965,7 @@ class FreqaiDataKitchen: "in a future version.\n" "This version does not include any outlier configurations") - import datasieve.transforms as ds - from sklearn.preprocessing import MinMaxScaler - dd = data_dictionary - - self.feature_pipeline = Pipeline([ - ('variance_threshold', ds.VarianceThreshold()), - ('scaler', SKLearnWrapper(MinMaxScaler(feature_range=(-1, 1)))) - ]) - - (dd["train_features"], - dd["train_labels"], - dd["train_weights"]) = self.feature_pipeline.fit_transform(dd["train_features"], - dd["train_labels"], - dd["train_weights"]) - - (dd["test_features"], - dd["test_labels"], - dd["test_weights"]) = self.feature_pipeline.transform(dd["test_features"], - dd["test_labels"], - dd["test_weights"]) - - self.label_pipeline = Pipeline([ - ('scaler', SKLearnWrapper(MinMaxScaler(feature_range=(-1, 1)))) - ]) - - dd["train_labels"], _, _ = self.label_pipeline.fit_transform(dd["train_labels"]) - dd["test_labels"], _, _ = self.label_pipeline.transform(dd["test_labels"]) - - return dd + return data_dictionary def denormalize_labels_from_metadata(self, df: DataFrame) -> DataFrame: """ diff --git a/freqtrade/freqai/freqai_interface.py b/freqtrade/freqai/freqai_interface.py index eff8d4bd5..a6e5d40ed 100644 --- a/freqtrade/freqai/freqai_interface.py +++ b/freqtrade/freqai/freqai_interface.py @@ -18,7 +18,7 @@ from pandas import DataFrame from sklearn.preprocessing import MinMaxScaler from freqtrade.configuration import TimeRange -from freqtrade.constants import Config +from freqtrade.constants import DOCS_LINK, Config from freqtrade.data.dataprovider import DataProvider from freqtrade.enums import RunMode from freqtrade.exceptions import OperationalException @@ -974,20 +974,20 @@ class IFreqaiModel(ABC): """ throw deprecation warning if this function is called """ - ft = "https://www.freqtrade.io/en/latest" logger.warning(f"Your model {self.__class__.__name__} relies on the deprecated" " data pipeline. Please update your model to use the new data pipeline." " This can be achieved by following the migration guide at " - f"{ft}/strategy_migration/#freqai-new-data-pipeline") + f"{DOCS_LINK}/strategy_migration/#freqai-new-data-pipeline") + dk.feature_pipeline = self.define_data_pipeline(threads=dk.thread_count) return def data_cleaning_predict(self, dk: FreqaiDataKitchen, pair: str): """ throw deprecation warning if this function is called """ - ft = "https://www.freqtrade.io/en/latest" logger.warning(f"Your model {self.__class__.__name__} relies on the deprecated" " data pipeline. Please update your model to use the new data pipeline." " This can be achieved by following the migration guide at " - f"{ft}/strategy_migration/#freqai-new-data-pipeline") + f"{DOCS_LINK}/strategy_migration/#freqai-new-data-pipeline") + dk.label_pipeline = self.define_data_pipeline(threads=dk.thread_count) return diff --git a/setup.py b/setup.py index 106b5b6d3..9a04e07d0 100644 --- a/setup.py +++ b/setup.py @@ -16,7 +16,8 @@ freqai = [ 'catboost; platform_machine != "aarch64"', 'lightgbm', 'xgboost', - 'tensorboard' + 'tensorboard', + 'datasieve>=0.1.4' ] freqai_rl = [