Model.roc_curve

In [ ]:
Model.roc_curve(pos_label: (int, float, str) = None,
                ax=None,
                nbins: int = 30,
                **style_kwds,)

Draws the model ROC curve.

Parameters

Name Type Optional Description
pos_label
int / float / str
To draw the ROC curve, one of the response column class has to be the positive one. The parameter 'pos_label' represents this class.
ax
Matplotlib axes object
The axes to plot on.
nbins
int
Curve number of bins.
**style_kwds
any
Any optional parameter to pass to the Matplotlib functions.

Returns

tablesample : An object containing the result. For more information, see utilities.tablesample.

Example

In [19]:
# Multiclass Classification
from verticapy.learn.ensemble import RandomForestClassifier
model = RandomForestClassifier(name = "public.RF_iris",
                               n_estimators = 20,
                               max_features = "auto",
                               max_leaf_nodes = 32, 
                               sample = 0.7,
                               max_depth = 3,
                               min_samples_leaf = 5,
                               min_info_gain = 0.0,
                               nbins = 32)
model.drop()
model.fit("public.iris", ["PetalLengthCm", "PetalWidthCm"], "Species")
# Roc Curve
model.roc_curve(pos_label = "Iris-virginica")
Out[19]:
threshold
false_positive
true_positive
10.01.01.0
20.03333333333333330.181.0
30.06666666666666670.071.0
40.10.061.0
50.1333333333333330.051.0
60.1666666666666670.051.0
70.20.051.0
80.2333333333333330.051.0
90.2666666666666670.051.0
100.30.051.0
110.3333333333333330.030.98
120.3666666666666670.030.92
130.40.020.92
140.4333333333333330.020.9
150.4666666666666670.020.9
160.50.020.9
170.5333333333333330.020.9
180.5666666666666670.020.9
190.60.020.9
200.6333333333333330.010.86
210.6666666666666670.00.86
220.70.00.86
230.7333333333333330.00.86
240.7666666666666670.00.86
250.80.00.86
260.8333333333333330.00.86
270.8666666666666670.00.86
280.90.00.86
290.9333333333333330.00.82
300.9666666666666670.00.6
311.00.00.0
Rows: 1-31 | Columns: 3