move prediction denormalization into datakitchen. remove duplicate associated code. avoid normalization/denormalization for string dtypes.

This commit is contained in:
robcaulk
2022-07-23 17:14:11 +02:00
parent 81c1aa3c13
commit f3d46613ee
3 changed files with 32 additions and 20 deletions

View File

@@ -501,12 +501,8 @@ class IFreqaiModel(ABC):
) -> None:
trained_predictions = model.predict(df)
pred_df = DataFrame(trained_predictions, columns=dk.label_list)
for label in dk.label_list:
pred_df[label] = (
(pred_df[label] + 1)
* (dk.data["labels_max"][label] - dk.data["labels_min"][label])
/ 2
) + dk.data["labels_min"][label]
pred_df = dk.denormalize_labels_from_metadata(pred_df)
self.dd.historic_predictions[pair] = pd.DataFrame()
self.dd.historic_predictions[pair] = copy.deepcopy(pred_df)