fix(MetaLabeling): previously misinterpreted meta-labeling, now also multiplying base model's prediction with the meta model's prediction (#193)

* fix(MetaLabeling): previously misinterpreted meta-labeling, now also multiplying base model's prediction with the meta model's prediction

* fix(Evaluate): print results

* fix(Evaluate): make sure we have numerical stability in returns

* fix(Inference): only output and print stats in training mode

* fix(Evaluate): don't add miniscule amount to result
This commit is contained in:
Mark Aron Szulyovszky
2022-02-01 13:09:00 +01:00
committed by GitHub
parent 3eb3ea94e3
commit f85ee6bb9c
11 changed files with 61 additions and 46 deletions
+12 -8
View File
@@ -9,14 +9,18 @@ def ensemble_weights(
forward_returns: ForwardReturnSeries,
y: ySeries,
no_of_classes: Literal['two', 'three-balanced', 'three-imbalanced'],
output_stats: bool
) -> EnsembleOutcome:
weights = pd.concat(input_weights, axis=1).mean(axis=1)
stats = evaluate_predictions(
forward_returns = forward_returns,
y_pred = weights,
y_true = y,
no_of_classes = no_of_classes,
print_results = False,
discretize = True,
)
if output_stats:
stats = evaluate_predictions(
forward_returns = forward_returns,
y_pred = weights,
y_true = y,
no_of_classes = no_of_classes,
discretize = True,
)
print(stats)
else:
stats = None
return EnsembleOutcome(weights, stats)