model
SupportsPredict
Bases: Protocol
Protocol describing an object that has a predict method.
SupportsPredictProba
Bases: Protocol
Protocol describing an object that has a predict_proba method.
SciKitModel(estimator, *, output_names, name=None)
Bases: Model
A model that wraps a scikit-learn estimator.
Initialize the model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
estimator
|
SupportsPredict
|
The scikit-learn estimator. |
required |
output_names
|
Iterable[str]
|
The names of the output columns. |
required |
name
|
str | None
|
The name of the model. |
None
|
Source code in src/flowcean/sklearn/model.py
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | |
SciKitClassifierModel(estimator, *, output_names, threshold=0.5, name=None)
Bases: SciKitModel
A SciKit model for classifiers with probability predictions.
Supports threshold-based predictions via the threshold attribute and
exposes class probabilities via predict_proba. The estimator must
implement predict_proba.
Initialize the classifier model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
estimator
|
SupportsPredict
|
The scikit-learn classifier (must support
|
required |
output_names
|
Iterable[str]
|
The names of the output columns. |
required |
threshold
|
float
|
Decision threshold for the positive class (default: 0.5). |
0.5
|
name
|
str | None
|
The name of the model. |
None
|
Source code in src/flowcean/sklearn/model.py
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 | |
predict_proba(input_features)
Predict class probabilities, applying preprocessing transforms.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_features
|
DataFrame | LazyFrame
|
The inputs for which to predict probabilities. |
required |
Returns:
| Type | Description |
|---|---|
LazyFrame
|
The predicted probabilities for the positive class. |
Source code in src/flowcean/sklearn/model.py
125 126 127 128 129 130 131 132 133 134 135 136 137 138 | |