cleaning and bug fixing

This commit is contained in:
robcaulk 2022-05-03 10:28:13 +02:00
parent fc837c4daa
commit b40f8f88ac
2 changed files with 9 additions and 3 deletions

View File

@ -19,6 +19,7 @@ class DataHandler:
""" """
Class designed to handle all the data for the IFreqaiModel class model. Class designed to handle all the data for the IFreqaiModel class model.
Functionalities include holding, saving, loading, and analyzing the data. 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): def __init__(self, config: Dict[str, Any], dataframe: DataFrame, data: List):
@ -32,6 +33,10 @@ class DataHandler:
self.data_dictionary = {} self.data_dictionary = {}
self.config = config self.config = config
self.freq_config = config['freqai'] 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: def save_data(self, model: Any) -> None:
""" """

View File

@ -17,6 +17,7 @@ class IFreqaiModel(ABC):
User models should inherit from this class as shown in User models should inherit from this class as shown in
templates/ExamplePredictionModel.py where the user overrides templates/ExamplePredictionModel.py where the user overrides
train(), predict(), fit(), and make_labels(). train(), predict(), fit(), and make_labels().
Author: Robert Caulk, rob.caulk@gmail.com
""" """
def __init__(self, config: Dict[str, Any]) -> None: def __init__(self, config: Dict[str, Any]) -> None:
@ -104,10 +105,10 @@ class IFreqaiModel(ABC):
return dataframe 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 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: :params:
:unfiltered_dataframe: Full dataframe for the current training period :unfiltered_dataframe: Full dataframe for the current training period
:metadata: pair metadata from strategy. :metadata: pair metadata from strategy.
@ -115,7 +116,7 @@ class IFreqaiModel(ABC):
:model: Trained model which can be used to inference (self.predict) :model: Trained model which can be used to inference (self.predict)
""" """
return unfiltered_dataframe, unfiltered_dataframe return Any
def fit(self) -> Any: def fit(self) -> Any:
""" """