sklearn
Accuracy(features=None)
Bases: SelectMixin
, LazyMixin
, Metric
Accuracy classification score.
As defined by scikit-learn.
Initialize metric.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
features
|
list[str] | None
|
The features to calculate the metric for. If None, the metric uses all features in the data. |
None
|
Source code in src/flowcean/sklearn/metrics/classification.py
16 17 18 19 20 21 22 23 24 25 26 |
|
ClassificationReport(features=None)
Bases: SelectMixin
, LazyMixin
, Metric
Build a text report showing the main classification metrics.
As defined by scikit-learn.
Initialize metric.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
features
|
list[str] | None
|
The features to calculate the metric for. If None, the metric uses all features in the data. |
None
|
Source code in src/flowcean/sklearn/metrics/classification.py
39 40 41 42 43 44 45 46 47 48 49 |
|
FBetaScore(*, beta=1.0, features=None)
Bases: SelectMixin
, LazyMixin
, Metric
F-beta score.
As defined by scikit-learn.
Initialize metric.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
beta
|
float
|
The beta parameter. |
1.0
|
features
|
list[str] | None
|
The features to calculate the metric for. If None, the metric uses all features in the data. |
None
|
Source code in src/flowcean/sklearn/metrics/classification.py
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
|
PrecisionScore(features=None)
Bases: SelectMixin
, LazyMixin
, Metric
Precision classification score.
As defined by scikit-learn.
Initialize metric.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
features
|
list[str] | None
|
The features to calculate the metric for. If None, the metric uses all features in the data. |
None
|
Source code in src/flowcean/sklearn/metrics/classification.py
91 92 93 94 95 96 97 98 99 100 101 |
|
Recall(features=None)
Bases: SelectMixin
, LazyMixin
, Metric
Recall classification score.
As defined by scikit-learn.
Initialize metric.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
features
|
list[str] | None
|
The features to calculate the metric for. If None, the metric uses all features in the data. |
None
|
Source code in src/flowcean/sklearn/metrics/classification.py
114 115 116 117 118 119 120 121 122 123 124 |
|
MaxError(feature=None)
Bases: SelectMixin
, LazyMixin
, Metric
Max error regression loss.
As defined by scikit-learn.
Initialize MaxError metric.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
feature
|
str | None
|
The feature to calculate the metric for. If None, the metric expects a single feature in the data. |
None
|
Source code in src/flowcean/sklearn/metrics/regression.py
19 20 21 22 23 24 25 26 27 |
|
MeanAbsoluteError(features=None, multioutput='raw_values')
Bases: SelectMixin
, LazyMixin
, MultiOutputMixin
, Metric
Mean absolute error (MAE) regression loss.
As defined by scikit-learn.
Initialize metric.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
features
|
list[str] | None
|
The features to calculate the metric for. If None, the metric uses all features in the data. |
None
|
multioutput
|
Literal['raw_values', 'uniform_average']
|
Defines how to aggregate multiple output values. See scikit-learn documentation for details. |
'raw_values'
|
Source code in src/flowcean/sklearn/metrics/regression.py
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
|
MeanAbsolutePercentageError(features=None, multioutput='raw_values')
Bases: SelectMixin
, LazyMixin
, MultiOutputMixin
, Metric
Mean absolute percentage error (MAPE) regression loss.
As defined by scikit-learn.
Initialize metric.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
features
|
list[str] | None
|
The features to calculate the metric for. If None, the metric uses all features in the data. |
None
|
multioutput
|
Literal['raw_values', 'uniform_average']
|
Defines how to aggregate multiple output values. See scikit-learn documentation for details. |
'raw_values'
|
Source code in src/flowcean/sklearn/metrics/regression.py
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
|
MeanSquaredError(features=None, multioutput='raw_values')
Bases: SelectMixin
, LazyMixin
, MultiOutputMixin
, Metric
Mean squared error (MSE) regression loss.
As defined by scikit-learn.
Initialize metric.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
features
|
list[str] | None
|
The features to calculate the metric for. If None, the metric uses all features in the data. |
None
|
multioutput
|
Literal['raw_values', 'uniform_average']
|
Defines how to aggregate multiple output values. See scikit-learn documentation for details. |
'raw_values'
|
Source code in src/flowcean/sklearn/metrics/regression.py
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 |
|
R2Score(features=None, multioutput='raw_values')
Bases: SelectMixin
, LazyMixin
, MultiOutputMixin
, Metric
R^2 (coefficient of determination) regression score.
As defined by scikit-learn.
Initialize metric.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
features
|
list[str] | None
|
The features to calculate the metric for. If None, the metric uses all features in the data. |
None
|
multioutput
|
Literal['raw_values', 'uniform_average']
|
Defines how to aggregate multiple output values. See scikit-learn documentation for details. |
'raw_values'
|
Source code in src/flowcean/sklearn/metrics/regression.py
177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 |
|
SciKitModel(estimator, *, output_names, name=None)
Bases: Model
A model that wraps a scikit-learn model.
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
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
|
RandomForestRegressorLearner(n_estimators=100, *, criterion='squared_error', max_depth=None, min_samples_split=2, min_samples_leaf=1, min_weight_fraction_leaf=0.0, max_features=1.0, max_leaf_nodes=None, min_impurity_decrease=0.0, bootstrap=True, oob_score=False, n_jobs=None, random_state=None, verbose=0, warm_start=False, ccp_alpha=0.0, max_samples=None, monotonic_cst=None)
Bases: SupervisedLearner
Wrapper class for sklearn's RandomForestRegressor.
Reference: https://scikit-learn.org/stable/modules/generated/sklearn.ensemble.RandomForestRegressor.html
Initialize the random forest learner.
Reference: https://scikit-learn.org/stable/modules/generated/sklearn.ensemble.RandomForestRegressor.html
Source code in src/flowcean/sklearn/random_forest.py
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
|
learn(inputs, outputs)
Fit the random forest regressor on the given inputs and outputs.
Source code in src/flowcean/sklearn/random_forest.py
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
|
RegressionTree(*, dot_graph_export_path=None, criterion='squared_error', splitter='best', max_depth=None, min_samples_split=2, min_samples_leaf=1, min_weight_fraction_leaf=0.0, max_features=None, random_state=None, max_leaf_nodes=None, min_impurity_decrease=0.0, ccp_alpha=0.0, monotonic_cst=None)
Bases: SupervisedLearner
Wrapper class for sklearn's DecisionTreeRegressor.
Reference: https://scikit-learn.org/stable/modules/generated/sklearn.tree.DecisionTreeRegressor.html
Initialize the regression tree learner.
Reference: https://scikit-learn.org/stable/modules/generated/sklearn.tree.DecisionTreeRegressor.html
Source code in src/flowcean/sklearn/regression_tree.py
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
|