Classification Module
Classes:
Name | Description |
---|---|
BaseClassificationDecision |
Base class for classification-based decision-making. |
BaseClassificationDecision
BaseClassificationDecision(
estimator, *, threshold=0.0, predict_mode="score"
)
Bases: BaseDecision
, ABC
Base class for classification-based decision-making.
This class provides a common interface for classification-based decision-making algorithms.
It calls estimator.predict_proba(X)
or estimator.decision_function(X)
to
predict the output values.
When using this class?
- When the decision is based on the output of a classification model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
estimator
|
BaseEstimator
|
The estimator object used for making predictions. |
required |
threshold
|
float
|
The threshold value used for decision-making. |
0.0
|
predict_mode
|
str
|
The mode to use for prediction. Can be 'proba' or 'score'. |
'score'
|
Attributes:
Name | Type | Description |
---|---|---|
estimator |
BaseEstimator
|
The estimator object used for making predictions. |
threshold |
float
|
The threshold value used for decision-making. |
predict_mode |
str
|
The mode to use for prediction. Can be 'proba' or 'score'.
|
Methods:
Name | Description |
---|---|
get_params |
Get the parameters of the estimator. |
make_prediction |
Predict the output values based on the input data. |
Source code in risk_control/decision/classification.py
45 46 47 48 49 50 51 52 53 54 |
|
threshold
instance-attribute
threshold = threshold
predict_mode
instance-attribute
predict_mode = predict_mode
get_params
get_params()
Get the parameters of the estimator.
Returns:
Name | Type | Description |
---|---|---|
params |
dict
|
The parameters of the estimator. |
Source code in risk_control/decision/classification.py
56 57 58 59 60 61 62 63 64 65 66 67 68 |
|
make_prediction
make_prediction(X)
Predict the output values based on the input data.
- If predict_mode is 'proba', return the predicted probabilities.
- If predict_mode is 'score', return the decision function scores.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
X
|
ndarray
|
The input data for making predictions. |
required |
Returns:
Type | Description |
---|---|
ndarray
|
The predicted output values based on the input data. |
Source code in risk_control/decision/classification.py
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
|