Add predict_proba output option to SklearnModelProcessor#15
Conversation
|
Thanks for the PR — this is well put together. The test coverage is appreciated, especially the default-behavior regression test, and the motivation makes sense. One requested change before merge: please convert In from enum import Enum
class PredictMethod(str, Enum):
PREDICT = "predict"
PREDICT_PROBA = "predict_proba"Settings: predict_method: PredictMethod = PredictMethod.PREDICTComparisons then read as: if self.settings.predict_method == PredictMethod.PREDICT_PROBA:which also works when the setting was supplied as a plain string like One thing I noticed that's out of scope for this PR: with River classifiers the |
|
Made those changes: |
Add a predict_method setting ("predict" | "predict_proba", default "predict") so the processor can emit a per-class posterior vector instead of only a hard label. When set to "predict_proba", the output ch axis is relabeled to the model's classes_. Supports sklearn predict_proba and River predict_proba_many. The default predict path is unchanged.
Motivated by consumers that pool per-bin posteriors over a window (see BlackrockNeurotech/intent-pipelines#13), which previously required a bespoke decode unit because SklearnModelProcessor only exposed predict.