Calibration curve (also known as reliability diagram) visualization.
It is recommended to use from\_estimator
or from\_predictions
to create a CalibrationDisplay
. All parameters are stored as attributes.
Read more about calibration in the User Guide and more about the scikit-learn visualization API in Visualizations.
new CalibrationDisplay(opts?: object): CalibrationDisplay;
Name | Type | Description |
---|---|---|
opts? |
object |
- |
opts.estimator_name? |
string |
Name of estimator. If undefined , the estimator name is not shown. |
opts.pos_label? |
string | number | boolean |
The positive class when computing the calibration curve. By default, estimators.classes\_\[1\] is considered as the positive class. |
opts.prob_pred? |
ArrayLike |
The mean predicted probability in each bin. |
opts.prob_true? |
ArrayLike |
The proportion of samples whose class is the positive class (fraction of positives), in each bin. |
opts.y_prob? |
ArrayLike |
Probability estimates for the positive class, for each sample. |
Defined in: generated/calibration/CalibrationDisplay.ts:25
Disposes of the underlying Python resources.
Once dispose()
is called, the instance is no longer usable.
dispose(): Promise<void>;
Promise
<void
>
Defined in: generated/calibration/CalibrationDisplay.ts:122
Plot calibration curve using a binary classifier and data.
A calibration curve, also known as a reliability diagram, uses inputs from a binary classifier and plots the average predicted probability for each bin against the fraction of positive classes, on the y-axis.
Extra keyword arguments will be passed to matplotlib.pyplot.plot
.
Read more about calibration in the User Guide and more about the scikit-learn visualization API in Visualizations.
from_estimator(opts: object): Promise<any>;
Name | Type | Description |
---|---|---|
opts |
object |
- |
opts.X? |
ArrayLike |
Input values. |
opts.ax? |
any |
Axes object to plot on. If undefined , a new figure and axes is created. |
opts.estimator? |
any |
Fitted classifier or a fitted Pipeline in which the last estimator is a classifier. The classifier must have a predict_proba method. |
opts.kwargs? |
any |
Keyword arguments to be passed to matplotlib.pyplot.plot . |
opts.n_bins? |
number |
Number of bins to discretize the [0, 1] interval into when calculating the calibration curve. A bigger number requires more data. Default Value 5 |
opts.name? |
string |
Name for labeling curve. If undefined , the name of the estimator is used. |
opts.pos_label? |
string | number | boolean |
The positive class when computing the calibration curve. By default, estimators.classes\_\[1\] is considered as the positive class. |
opts.ref_line? |
boolean |
If true , plots a reference line representing a perfectly calibrated classifier. Default Value true |
opts.strategy? |
"uniform" | "quantile" |
Strategy used to define the widths of the bins. Default Value 'uniform' |
opts.y? |
ArrayLike |
Binary target values. |
Promise
<any
>
Defined in: generated/calibration/CalibrationDisplay.ts:145
Plot calibration curve using true labels and predicted probabilities.
Calibration curve, also known as reliability diagram, uses inputs from a binary classifier and plots the average predicted probability for each bin against the fraction of positive classes, on the y-axis.
Extra keyword arguments will be passed to matplotlib.pyplot.plot
.
Read more about calibration in the User Guide and more about the scikit-learn visualization API in Visualizations.
from_predictions(opts: object): Promise<any>;
Name | Type | Description |
---|---|---|
opts |
object |
- |
opts.ax? |
any |
Axes object to plot on. If undefined , a new figure and axes is created. |
opts.kwargs? |
any |
Keyword arguments to be passed to matplotlib.pyplot.plot . |
opts.n_bins? |
number |
Number of bins to discretize the [0, 1] interval into when calculating the calibration curve. A bigger number requires more data. Default Value 5 |
opts.name? |
string |
Name for labeling curve. |
opts.pos_label? |
string | number | boolean |
The positive class when computing the calibration curve. By default, estimators.classes\_\[1\] is considered as the positive class. |
opts.ref_line? |
boolean |
If true , plots a reference line representing a perfectly calibrated classifier. Default Value true |
opts.strategy? |
"uniform" | "quantile" |
Strategy used to define the widths of the bins. Default Value 'uniform' |
opts.y_prob? |
ArrayLike |
The predicted probabilities of the positive class. |
opts.y_true? |
ArrayLike |
True labels. |
Promise
<any
>
Defined in: generated/calibration/CalibrationDisplay.ts:249
Initializes the underlying Python resources.
This instance is not usable until the Promise
returned by init()
resolves.
init(py: PythonBridge): Promise<void>;
Name | Type |
---|---|
py |
PythonBridge |
Promise
<void
>
Defined in: generated/calibration/CalibrationDisplay.ts:68
Plot visualization.
Extra keyword arguments will be passed to matplotlib.pyplot.plot
.
plot(opts: object): Promise<any>;
Name | Type | Description |
---|---|---|
opts |
object |
- |
opts.ax? |
any |
Axes object to plot on. If undefined , a new figure and axes is created. |
opts.kwargs? |
any |
Keyword arguments to be passed to matplotlib.pyplot.plot . |
opts.name? |
string |
Name for labeling curve. If undefined , use estimator\_name if not undefined , otherwise no labeling is shown. |
opts.ref_line? |
boolean |
If true , plots a reference line representing a perfectly calibrated classifier. Default Value true |
Promise
<any
>
Defined in: generated/calibration/CalibrationDisplay.ts:345
boolean
=false
Defined in: generated/calibration/CalibrationDisplay.ts:23
boolean
=false
Defined in: generated/calibration/CalibrationDisplay.ts:22
PythonBridge
Defined in: generated/calibration/CalibrationDisplay.ts:21
string
Defined in: generated/calibration/CalibrationDisplay.ts:18
any
Defined in: generated/calibration/CalibrationDisplay.ts:19
Axes with calibration curve.
ax_(): Promise<any>;
Promise
<any
>
Defined in: generated/calibration/CalibrationDisplay.ts:426
Figure containing the curve.
figure_(): Promise<any>;
Promise
<any
>
Defined in: generated/calibration/CalibrationDisplay.ts:453
Calibration curve.
line_(): Promise<any>;
Promise
<any
>
Defined in: generated/calibration/CalibrationDisplay.ts:399
py(): PythonBridge;
PythonBridge
Defined in: generated/calibration/CalibrationDisplay.ts:55
py(pythonBridge: PythonBridge): void;
Name | Type |
---|---|
pythonBridge |
PythonBridge |
void
Defined in: generated/calibration/CalibrationDisplay.ts:59