mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 10:21:59 +00:00
Fix feature list match for pca
This commit is contained in:
parent
d462f40299
commit
cdc01a0781
|
@ -1,5 +1,6 @@
|
|||
import copy
|
||||
import logging
|
||||
import re
|
||||
import shutil
|
||||
from datetime import datetime, timezone
|
||||
from math import cos, sin
|
||||
|
@ -881,6 +882,10 @@ class FreqaiDataKitchen:
|
|||
"""
|
||||
column_names = dataframe.columns
|
||||
features = [c for c in column_names if "%" in c]
|
||||
pca_features = [c for c in column_names if re.search(r"^PC\d+$", c)]
|
||||
if not features and pca_features:
|
||||
features = pca_features
|
||||
|
||||
if not features:
|
||||
raise OperationalException("Could not find any features!")
|
||||
|
||||
|
|
|
@ -434,6 +434,10 @@ class IFreqaiModel(ABC):
|
|||
feature_list = dk.data["training_features_list_raw"]
|
||||
else:
|
||||
feature_list = dk.data['training_features_list']
|
||||
|
||||
if self.ft_params.get('principal_component_analysis', False):
|
||||
feature_list = dk.data['training_features_list']
|
||||
|
||||
if dk.training_features_list != feature_list:
|
||||
raise OperationalException(
|
||||
"Trying to access pretrained model with `identifier` "
|
||||
|
|
Loading…
Reference in New Issue
Block a user