fix mypy error and add test for principal component analysis

This commit is contained in:
Robert Caulk
2022-07-25 11:46:59 +02:00
parent 4abc26b582
commit 7b105532d1
3 changed files with 33 additions and 6 deletions

View File

@@ -1,6 +1,7 @@
import logging
from typing import Tuple
from typing import Any, Tuple
import numpy.typing as npt
from pandas import DataFrame
from freqtrade.freqai.data_kitchen import FreqaiDataKitchen
@@ -28,7 +29,7 @@ class BaseRegressionModel(IFreqaiModel):
def train(
self, unfiltered_dataframe: DataFrame, pair: str, dk: FreqaiDataKitchen
) -> Tuple[DataFrame, DataFrame]:
) -> Any:
"""
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.
@@ -83,7 +84,7 @@ class BaseRegressionModel(IFreqaiModel):
def predict(
self, unfiltered_dataframe: DataFrame, dk: FreqaiDataKitchen, first: bool = False
) -> Tuple[DataFrame, DataFrame]:
) -> Tuple[DataFrame, npt.ArrayLike]:
"""
Filter the prediction features data and predict with it.
:param: unfiltered_dataframe: Full dataframe for the current backtest period.