From 1885deb632e52bcfb58c6e8bdb33178844477fd9 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 24 Jul 2022 16:54:39 +0200 Subject: [PATCH] More docstring changes --- freqtrade/freqai/freqai_interface.py | 8 ++++---- freqtrade/freqai/prediction_models/BaseRegressionModel.py | 7 +++---- freqtrade/freqai/prediction_models/BaseTensorFlowModel.py | 5 ++--- .../freqai/prediction_models/CatboostPredictionModel.py | 5 ++--- .../prediction_models/CatboostPredictionMultiModel.py | 5 ++--- .../freqai/prediction_models/LightGBMPredictionModel.py | 5 ++--- .../prediction_models/LightGBMPredictionMultiModel.py | 5 ++--- 7 files changed, 17 insertions(+), 23 deletions(-) diff --git a/freqtrade/freqai/freqai_interface.py b/freqtrade/freqai/freqai_interface.py index b88923285..f5a1d667c 100644 --- a/freqtrade/freqai/freqai_interface.py +++ b/freqtrade/freqai/freqai_interface.py @@ -92,11 +92,11 @@ class IFreqaiModel(ABC): Entry point to the FreqaiModel from a specific pair, it will train a new model if necessary before making the prediction. - :params: - :dataframe: Full dataframe coming from strategy - it contains entire - backtesting timerange + additional historical data necessary to train + :param dataframe: Full dataframe coming from strategy - it contains entire + backtesting timerange + additional historical data necessary to train the model. - :metadata: pair metadata coming from strategy. + :param metadata: pair metadata coming from strategy. + :param strategy: Strategy to train on """ self.live = strategy.dp.runmode in (RunMode.DRY_RUN, RunMode.LIVE) diff --git a/freqtrade/freqai/prediction_models/BaseRegressionModel.py b/freqtrade/freqai/prediction_models/BaseRegressionModel.py index 2654b3726..c2fd53d0f 100644 --- a/freqtrade/freqai/prediction_models/BaseRegressionModel.py +++ b/freqtrade/freqai/prediction_models/BaseRegressionModel.py @@ -32,10 +32,9 @@ class BaseRegressionModel(IFreqaiModel): """ Filter the training data and train a model to it. Train makes heavy use of the datakitchen for storing, saving, loading, and analyzing the data. - :params: - :unfiltered_dataframe: Full dataframe for the current training period - :metadata: pair metadata from strategy. - :returns: + :param unfiltered_dataframe: Full dataframe for the current training period + :param metadata: pair metadata from strategy. + :return: :model: Trained model which can be used to inference (self.predict) """ diff --git a/freqtrade/freqai/prediction_models/BaseTensorFlowModel.py b/freqtrade/freqai/prediction_models/BaseTensorFlowModel.py index 098ff24dd..268bb00c9 100644 --- a/freqtrade/freqai/prediction_models/BaseTensorFlowModel.py +++ b/freqtrade/freqai/prediction_models/BaseTensorFlowModel.py @@ -31,9 +31,8 @@ class BaseTensorFlowModel(IFreqaiModel): """ Filter the training data and train a model to it. Train makes heavy use of the datakitchen for storing, saving, loading, and analyzing the data. - :params: - :unfiltered_dataframe: Full dataframe for the current training period - :metadata: pair metadata from strategy. + :param unfiltered_dataframe: Full dataframe for the current training period + :param metadata: pair metadata from strategy. :returns: :model: Trained model which can be used to inference (self.predict) """ diff --git a/freqtrade/freqai/prediction_models/CatboostPredictionModel.py b/freqtrade/freqai/prediction_models/CatboostPredictionModel.py index c69602025..f41760472 100644 --- a/freqtrade/freqai/prediction_models/CatboostPredictionModel.py +++ b/freqtrade/freqai/prediction_models/CatboostPredictionModel.py @@ -19,9 +19,8 @@ class CatboostPredictionModel(BaseRegressionModel): def fit(self, data_dictionary: Dict) -> Any: """ User sets up the training and test data to fit their desired model here - :params: - :data_dictionary: the dictionary constructed by DataHandler to hold - all the training and test data/labels. + :param data_dictionary: the dictionary constructed by DataHandler to hold + all the training and test data/labels. """ train_data = Pool( diff --git a/freqtrade/freqai/prediction_models/CatboostPredictionMultiModel.py b/freqtrade/freqai/prediction_models/CatboostPredictionMultiModel.py index 1b91fe0c6..17b5e6c68 100644 --- a/freqtrade/freqai/prediction_models/CatboostPredictionMultiModel.py +++ b/freqtrade/freqai/prediction_models/CatboostPredictionMultiModel.py @@ -20,9 +20,8 @@ class CatboostPredictionMultiModel(BaseRegressionModel): def fit(self, data_dictionary: Dict) -> Any: """ User sets up the training and test data to fit their desired model here - :params: - :data_dictionary: the dictionary constructed by DataHandler to hold - all the training and test data/labels. + :param data_dictionary: the dictionary constructed by DataHandler to hold + all the training and test data/labels. """ cbr = CatBoostRegressor( diff --git a/freqtrade/freqai/prediction_models/LightGBMPredictionModel.py b/freqtrade/freqai/prediction_models/LightGBMPredictionModel.py index 6a91837da..525566cf4 100644 --- a/freqtrade/freqai/prediction_models/LightGBMPredictionModel.py +++ b/freqtrade/freqai/prediction_models/LightGBMPredictionModel.py @@ -21,9 +21,8 @@ class LightGBMPredictionModel(BaseRegressionModel): Most regressors use the same function names and arguments e.g. user can drop in LGBMRegressor in place of CatBoostRegressor and all data management will be properly handled by Freqai. - :params: - :data_dictionary: the dictionary constructed by DataHandler to hold - all the training and test data/labels. + :param data_dictionary: the dictionary constructed by DataHandler to hold + all the training and test data/labels. """ eval_set = (data_dictionary["test_features"], data_dictionary["test_labels"]) diff --git a/freqtrade/freqai/prediction_models/LightGBMPredictionMultiModel.py b/freqtrade/freqai/prediction_models/LightGBMPredictionMultiModel.py index 89aad4323..4c51c9008 100644 --- a/freqtrade/freqai/prediction_models/LightGBMPredictionMultiModel.py +++ b/freqtrade/freqai/prediction_models/LightGBMPredictionMultiModel.py @@ -20,9 +20,8 @@ class LightGBMPredictionMultiModel(BaseRegressionModel): def fit(self, data_dictionary: Dict) -> Any: """ User sets up the training and test data to fit their desired model here - :params: - :data_dictionary: the dictionary constructed by DataHandler to hold - all the training and test data/labels. + :param data_dictionary: the dictionary constructed by DataHandler to hold + all the training and test data/labels. """ lgb = LGBMRegressor(**self.model_training_parameters)