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

@@ -107,11 +107,6 @@ class BaseRegressionModel(IFreqaiModel):
predictions = self.model.predict(dk.data_dictionary["prediction_features"])
pred_df = DataFrame(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)
return (pred_df, dk.do_predict)