fix docstrings
This commit is contained in:
parent
c8d3e57712
commit
6394ef4558
@ -130,13 +130,12 @@ class BaseReinforcementLearningModel(IFreqaiModel):
|
|||||||
dk: FreqaiDataKitchen):
|
dk: FreqaiDataKitchen):
|
||||||
"""
|
"""
|
||||||
User can override this if they are using a custom MyRLEnv
|
User can override this if they are using a custom MyRLEnv
|
||||||
:params:
|
:param data_dictionary: dict = common data dictionary containing train and test
|
||||||
data_dictionary: dict = common data dictionary containing train and test
|
|
||||||
features/labels/weights.
|
features/labels/weights.
|
||||||
prices_train/test: DataFrame = dataframe comprised of the prices to be used in the
|
:param prices_train/test: DataFrame = dataframe comprised of the prices to be used in the
|
||||||
environment during training
|
environment during training
|
||||||
or testing
|
or testing
|
||||||
dk: FreqaiDataKitchen = the datakitchen for the current pair
|
:param dk: FreqaiDataKitchen = the datakitchen for the current pair
|
||||||
"""
|
"""
|
||||||
train_df = data_dictionary["train_features"]
|
train_df = data_dictionary["train_features"]
|
||||||
test_df = data_dictionary["test_features"]
|
test_df = data_dictionary["test_features"]
|
||||||
@ -229,10 +228,9 @@ class BaseReinforcementLearningModel(IFreqaiModel):
|
|||||||
dk: FreqaiDataKitchen, model: Any) -> DataFrame:
|
dk: FreqaiDataKitchen, model: Any) -> DataFrame:
|
||||||
"""
|
"""
|
||||||
A helper function to make predictions in the Reinforcement learning module.
|
A helper function to make predictions in the Reinforcement learning module.
|
||||||
:params:
|
:param dataframe: DataFrame = the dataframe of features to make the predictions on
|
||||||
dataframe: DataFrame = the dataframe of features to make the predictions on
|
:param dk: FreqaiDatakitchen = data kitchen for the current pair
|
||||||
dk: FreqaiDatakitchen = data kitchen for the current pair
|
:param model: Any = the trained model used to inference the features.
|
||||||
model: Any = the trained model used to inference the features.
|
|
||||||
"""
|
"""
|
||||||
output = pd.DataFrame(np.zeros(len(dataframe)), columns=dk.label_list)
|
output = pd.DataFrame(np.zeros(len(dataframe)), columns=dk.label_list)
|
||||||
|
|
||||||
@ -322,9 +320,8 @@ class BaseReinforcementLearningModel(IFreqaiModel):
|
|||||||
"""
|
"""
|
||||||
An example reward function. This is the one function that users will likely
|
An example reward function. This is the one function that users will likely
|
||||||
wish to inject their own creativity into.
|
wish to inject their own creativity into.
|
||||||
:params:
|
:param action: int = The action made by the agent for the current candle.
|
||||||
action: int = The action made by the agent for the current candle.
|
:return:
|
||||||
:returns:
|
|
||||||
float = the reward to give to the agent for current step (used for optimization
|
float = the reward to give to the agent for current step (used for optimization
|
||||||
of weights in NN)
|
of weights in NN)
|
||||||
"""
|
"""
|
||||||
|
@ -20,12 +20,11 @@ class ReinforcementLearner(BaseReinforcementLearningModel):
|
|||||||
def fit(self, data_dictionary: Dict[str, Any], dk: FreqaiDataKitchen, **kwargs):
|
def fit(self, data_dictionary: Dict[str, Any], dk: FreqaiDataKitchen, **kwargs):
|
||||||
"""
|
"""
|
||||||
User customizable fit method
|
User customizable fit method
|
||||||
:params:
|
:param data_dictionary: dict = common data dictionary containing all train/test
|
||||||
data_dictionary: dict = common data dictionary containing all train/test
|
|
||||||
features/labels/weights.
|
features/labels/weights.
|
||||||
dk: FreqaiDatakitchen = data kitchen for current pair.
|
:param dk: FreqaiDatakitchen = data kitchen for current pair.
|
||||||
:returns:
|
:return:
|
||||||
model: Any = trained model to be used for inference in dry/live/backtesting
|
model Any = trained model to be used for inference in dry/live/backtesting
|
||||||
"""
|
"""
|
||||||
train_df = data_dictionary["train_features"]
|
train_df = data_dictionary["train_features"]
|
||||||
total_timesteps = self.freqai_info["rl_config"]["train_cycles"] * len(train_df)
|
total_timesteps = self.freqai_info["rl_config"]["train_cycles"] * len(train_df)
|
||||||
@ -69,9 +68,8 @@ class ReinforcementLearner(BaseReinforcementLearningModel):
|
|||||||
"""
|
"""
|
||||||
An example reward function. This is the one function that users will likely
|
An example reward function. This is the one function that users will likely
|
||||||
wish to inject their own creativity into.
|
wish to inject their own creativity into.
|
||||||
:params:
|
:param action: int = The action made by the agent for the current candle.
|
||||||
action: int = The action made by the agent for the current candle.
|
:return:
|
||||||
:returns:
|
|
||||||
float = the reward to give to the agent for current step (used for optimization
|
float = the reward to give to the agent for current step (used for optimization
|
||||||
of weights in NN)
|
of weights in NN)
|
||||||
"""
|
"""
|
||||||
|
@ -61,13 +61,12 @@ class ReinforcementLearner_multiproc(BaseReinforcementLearningModel):
|
|||||||
dk: FreqaiDataKitchen):
|
dk: FreqaiDataKitchen):
|
||||||
"""
|
"""
|
||||||
User can override this if they are using a custom MyRLEnv
|
User can override this if they are using a custom MyRLEnv
|
||||||
:params:
|
:param data_dictionary: dict = common data dictionary containing train and test
|
||||||
data_dictionary: dict = common data dictionary containing train and test
|
|
||||||
features/labels/weights.
|
features/labels/weights.
|
||||||
prices_train/test: DataFrame = dataframe comprised of the prices to be used in
|
:param prices_train/test: DataFrame = dataframe comprised of the prices to be used in
|
||||||
the environment during training
|
the environment during training
|
||||||
or testing
|
or testing
|
||||||
dk: FreqaiDataKitchen = the datakitchen for the current pair
|
:param dk: FreqaiDataKitchen = the datakitchen for the current pair
|
||||||
"""
|
"""
|
||||||
train_df = data_dictionary["train_features"]
|
train_df = data_dictionary["train_features"]
|
||||||
test_df = data_dictionary["test_features"]
|
test_df = data_dictionary["test_features"]
|
||||||
|
Loading…
Reference in New Issue
Block a user