RocCurveDisplay
ROC Curve visualization.
It is recommend to use from\_estimator
or from\_predictions
to create a RocCurveDisplay
. All parameters are stored as attributes.
Read more in the User Guide.
Python Reference (opens in a new tab)
Constructors
constructor()
Signature
new RocCurveDisplay(opts?: object): RocCurveDisplay;
Parameters
Name | Type | Description |
---|---|---|
opts? | object | - |
opts.estimator_name? | string | Name of estimator. If undefined , the estimator name is not shown. |
opts.fpr? | ArrayLike | False positive rate. |
opts.pos_label? | string | number | boolean | The class considered as the positive class when computing the roc auc metrics. By default, estimators.classes\_\[1\] is considered as the positive class. |
opts.roc_auc? | number | Area under ROC curve. If undefined , the roc_auc score is not shown. |
opts.tpr? | ArrayLike | True positive rate. |
Returns
Defined in: generated/metrics/RocCurveDisplay.ts:25 (opens in a new tab)
Methods
dispose()
Disposes of the underlying Python resources.
Once dispose()
is called, the instance is no longer usable.
Signature
dispose(): Promise<void>;
Returns
Promise
<void
>
Defined in: generated/metrics/RocCurveDisplay.ts:114 (opens in a new tab)
from_estimator()
Create a ROC Curve display from an estimator.
Signature
from_estimator(opts: object): Promise<any>;
Parameters
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.chance_level_kw? | any | Keyword arguments to be passed to matplotlib’s plot for rendering the chance level line. |
opts.drop_intermediate? | boolean | Whether to drop some suboptimal thresholds which would not appear on a plotted ROC curve. This is useful in order to create lighter ROC curves. Default Value true |
opts.estimator? | any | Fitted classifier or a fitted Pipeline in which the last estimator is a classifier. |
opts.kwargs? | any | Keyword arguments to be passed to matplotlib’s plot . |
opts.name? | string | Name of ROC Curve for labeling. If undefined , use the name of the estimator. |
opts.plot_chance_level? | boolean | Whether to plot the chance level. Default Value false |
opts.pos_label? | string | number | boolean | The class considered as the positive class when computing the roc auc metrics. By default, estimators.classes\_\[1\] is considered as the positive class. |
opts.response_method? | "decision_function" | "auto’} default=’auto" | Specifies whether to use predict_proba or decision_function as the target response. If set to ‘auto’, predict_proba is tried first and if it does not exist decision_function is tried next. |
opts.sample_weight? | ArrayLike | Sample weights. |
opts.y? | ArrayLike | Target values. |
Returns
Promise
<any
>
Defined in: generated/metrics/RocCurveDisplay.ts:131 (opens in a new tab)
from_predictions()
Plot ROC curve given the true and predicted values.
Read more in the User Guide.
Signature
from_predictions(opts: object): Promise<any>;
Parameters
Name | Type | Description |
---|---|---|
opts | object | - |
opts.ax? | any | Axes object to plot on. If undefined , a new figure and axes is created. |
opts.chance_level_kw? | any | Keyword arguments to be passed to matplotlib’s plot for rendering the chance level line. |
opts.drop_intermediate? | boolean | Whether to drop some suboptimal thresholds which would not appear on a plotted ROC curve. This is useful in order to create lighter ROC curves. Default Value true |
opts.kwargs? | any | Additional keywords arguments passed to matplotlib plot function. |
opts.name? | string | Name of ROC curve for labeling. If undefined , name will be set to "Classifier" . |
opts.plot_chance_level? | boolean | Whether to plot the chance level. Default Value false |
opts.pos_label? | string | number | boolean | The label of the positive class. When pos\_label=None , if y\_true is in {-1, 1} or {0, 1}, pos\_label is set to 1, otherwise an error will be raised. |
opts.sample_weight? | ArrayLike | Sample weights. |
opts.y_pred? | ArrayLike | Target scores, can either be probability estimates of the positive class, confidence values, or non-thresholded measure of decisions (as returned by “decision_function” on some classifiers). |
opts.y_true? | ArrayLike | True labels. |
Returns
Promise
<any
>
Defined in: generated/metrics/RocCurveDisplay.ts:245 (opens in a new tab)
init()
Initializes the underlying Python resources.
This instance is not usable until the Promise
returned by init()
resolves.
Signature
init(py: PythonBridge): Promise<void>;
Parameters
Name | Type |
---|---|
py | PythonBridge |
Returns
Promise
<void
>
Defined in: generated/metrics/RocCurveDisplay.ts:68 (opens in a new tab)
plot()
Plot visualization.
Extra keyword arguments will be passed to matplotlib’s plot
.
Signature
plot(opts: object): Promise<any>;
Parameters
Name | Type | Description |
---|---|---|
opts | object | - |
opts.ax? | any | Axes object to plot on. If undefined , a new figure and axes is created. |
opts.chance_level_kw? | any | Keyword arguments to be passed to matplotlib’s plot for rendering the chance level line. |
opts.kwargs? | any | Keyword arguments to be passed to matplotlib’s plot . |
opts.name? | string | Name of ROC Curve for labeling. If undefined , use estimator\_name if not undefined , otherwise no labeling is shown. |
opts.plot_chance_level? | boolean | Whether to plot the chance level. Default Value false |
Returns
Promise
<any
>
Defined in: generated/metrics/RocCurveDisplay.ts:348 (opens in a new tab)
Properties
_isDisposed
boolean
=false
Defined in: generated/metrics/RocCurveDisplay.ts:23 (opens in a new tab)
_isInitialized
boolean
=false
Defined in: generated/metrics/RocCurveDisplay.ts:22 (opens in a new tab)
_py
PythonBridge
Defined in: generated/metrics/RocCurveDisplay.ts:21 (opens in a new tab)
id
string
Defined in: generated/metrics/RocCurveDisplay.ts:18 (opens in a new tab)
opts
any
Defined in: generated/metrics/RocCurveDisplay.ts:19 (opens in a new tab)
Accessors
ax_
Axes with ROC Curve.
Signature
ax_(): Promise<any>;
Returns
Promise
<any
>
Defined in: generated/metrics/RocCurveDisplay.ts:455 (opens in a new tab)
chance_level_
The chance level line. It is undefined
if the chance level is not plotted.
Signature
chance_level_(): Promise<any>;
Returns
Promise
<any
>
Defined in: generated/metrics/RocCurveDisplay.ts:430 (opens in a new tab)
figure_
Figure containing the curve.
Signature
figure_(): Promise<any>;
Returns
Promise
<any
>
Defined in: generated/metrics/RocCurveDisplay.ts:478 (opens in a new tab)
line_
ROC Curve.
Signature
line_(): Promise<any>;
Returns
Promise
<any
>
Defined in: generated/metrics/RocCurveDisplay.ts:407 (opens in a new tab)
py
Signature
py(): PythonBridge;
Returns
PythonBridge
Defined in: generated/metrics/RocCurveDisplay.ts:55 (opens in a new tab)
Signature
py(pythonBridge: PythonBridge): void;
Parameters
Name | Type |
---|---|
pythonBridge | PythonBridge |
Returns
void
Defined in: generated/metrics/RocCurveDisplay.ts:59 (opens in a new tab)