From b40f8f88acb40591e338fc728aa5d17ea7374026 Mon Sep 17 00:00:00 2001 From: robcaulk Date: Tue, 3 May 2022 10:28:13 +0200 Subject: [PATCH] cleaning and bug fixing --- freqtrade/freqai/data_handler.py | 5 +++++ freqtrade/freqai/freqai_interface.py | 7 ++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/freqtrade/freqai/data_handler.py b/freqtrade/freqai/data_handler.py index d399cd12b..373063e42 100644 --- a/freqtrade/freqai/data_handler.py +++ b/freqtrade/freqai/data_handler.py @@ -19,6 +19,7 @@ class DataHandler: """ Class designed to handle all the data for the IFreqaiModel class model. Functionalities include holding, saving, loading, and analyzing the data. + author: Robert Caulk, rob.caulk@gmail.com """ def __init__(self, config: Dict[str, Any], dataframe: DataFrame, data: List): @@ -32,6 +33,10 @@ class DataHandler: self.data_dictionary = {} self.config = config self.freq_config = config['freqai'] + self.predictions = np.array([]) + self.do_predict = np.array([]) + self.target_mean = np.array([]) + self.target_std = np.array([]) def save_data(self, model: Any) -> None: """ diff --git a/freqtrade/freqai/freqai_interface.py b/freqtrade/freqai/freqai_interface.py index eb15e7e49..0f83793f1 100644 --- a/freqtrade/freqai/freqai_interface.py +++ b/freqtrade/freqai/freqai_interface.py @@ -17,6 +17,7 @@ class IFreqaiModel(ABC): User models should inherit from this class as shown in templates/ExamplePredictionModel.py where the user overrides train(), predict(), fit(), and make_labels(). + Author: Robert Caulk, rob.caulk@gmail.com """ def __init__(self, config: Dict[str, Any]) -> None: @@ -104,10 +105,10 @@ class IFreqaiModel(ABC): return dataframe - def train(self, unfiltered_dataframe: DataFrame, metadata: dict) -> Tuple[DataFrame, DataFrame]: + def train(self, unfiltered_dataframe: DataFrame, metadata: dict) -> Any: """ Filter the training data and train a model to it. Train makes heavy use of the datahandler - for storing, saving, loading, and managed. + for storing, saving, loading, and analyzing the data. :params: :unfiltered_dataframe: Full dataframe for the current training period :metadata: pair metadata from strategy. @@ -115,7 +116,7 @@ class IFreqaiModel(ABC): :model: Trained model which can be used to inference (self.predict) """ - return unfiltered_dataframe, unfiltered_dataframe + return Any def fit(self) -> Any: """