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.
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:
"""

View File

@ -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:
"""