mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-11-29 08:33:07 +00:00
fix: ensure that a user setting up their own pipeline wont have conflicts with DI_values
This commit is contained in:
@@ -250,17 +250,13 @@ class BaseReinforcementLearningModel(IFreqaiModel):
|
|||||||
|
|
||||||
dk.data_dictionary["prediction_features"] = self.drop_ohlc_from_df(filtered_dataframe, dk)
|
dk.data_dictionary["prediction_features"] = self.drop_ohlc_from_df(filtered_dataframe, dk)
|
||||||
|
|
||||||
dk.data_dictionary["prediction_features"], outliers, _ = dk.feature_pipeline.transform(
|
dk.data_dictionary["prediction_features"], _, _ = dk.feature_pipeline.transform(
|
||||||
dk.data_dictionary["prediction_features"], outlier_check=True)
|
dk.data_dictionary["prediction_features"], outlier_check=True)
|
||||||
|
|
||||||
pred_df = self.rl_model_predict(
|
pred_df = self.rl_model_predict(
|
||||||
dk.data_dictionary["prediction_features"], dk, self.model)
|
dk.data_dictionary["prediction_features"], dk, self.model)
|
||||||
pred_df.fillna(0, inplace=True)
|
pred_df.fillna(0, inplace=True)
|
||||||
|
|
||||||
if self.freqai_info.get("DI_threshold", 0) > 0:
|
|
||||||
dk.DI_values = dk.feature_pipeline["di"].di_values
|
|
||||||
dk.do_predict = outliers.to_numpy()
|
|
||||||
|
|
||||||
return (pred_df, dk.do_predict)
|
return (pred_df, dk.do_predict)
|
||||||
|
|
||||||
def rl_model_predict(self, dataframe: DataFrame,
|
def rl_model_predict(self, dataframe: DataFrame,
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ class BasePyTorchRegressor(BasePyTorchModel):
|
|||||||
pred_df = DataFrame(y.detach().tolist(), columns=[dk.label_list[0]])
|
pred_df = DataFrame(y.detach().tolist(), columns=[dk.label_list[0]])
|
||||||
pred_df, _, _ = dk.label_pipeline.inverse_transform(pred_df)
|
pred_df, _, _ = dk.label_pipeline.inverse_transform(pred_df)
|
||||||
|
|
||||||
if self.freqai_info.get("DI_threshold", 0) > 0:
|
if dk.feature_pipeline["di"]:
|
||||||
dk.DI_values = dk.feature_pipeline["di"].di_values
|
dk.DI_values = dk.feature_pipeline["di"].di_values
|
||||||
else:
|
else:
|
||||||
dk.DI_values = np.zeros(len(outliers.index))
|
dk.DI_values = np.zeros(len(outliers.index))
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ class BaseRegressionModel(IFreqaiModel):
|
|||||||
pred_df = DataFrame(predictions, columns=dk.label_list)
|
pred_df = DataFrame(predictions, columns=dk.label_list)
|
||||||
|
|
||||||
pred_df, _, _ = dk.label_pipeline.inverse_transform(pred_df)
|
pred_df, _, _ = dk.label_pipeline.inverse_transform(pred_df)
|
||||||
if self.freqai_info.get("DI_threshold", 0) > 0:
|
if dk.feature_pipeline["di"]:
|
||||||
dk.DI_values = dk.feature_pipeline["di"].di_values
|
dk.DI_values = dk.feature_pipeline["di"].di_values
|
||||||
else:
|
else:
|
||||||
dk.DI_values = np.zeros(len(outliers.index))
|
dk.DI_values = np.zeros(len(outliers.index))
|
||||||
|
|||||||
Reference in New Issue
Block a user