Model.prc_curve

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

Draws the model PRC curve.

Parameters

Name Type Optional Description
pos_label
int / float / str
To draw the PRC 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 [10]:
# 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"], "Species")
# PRC Curve
model.prc_curve(pos_label = "Iris-virginica")
Out[10]:
threshold
recall
precision
1010
20.01.00.333333333333333
30.03333333333333330.980.816666666666667
40.06666666666666670.980.816666666666667
50.10.980.816666666666667
60.1333333333333330.940.92156862745098
70.1666666666666670.940.92156862745098
80.20.940.92156862745098
90.2333333333333330.940.92156862745098
100.2666666666666670.940.92156862745098
110.30.940.92156862745098
120.3333333333333330.940.92156862745098
130.3666666666666670.940.92156862745098
140.40.940.92156862745098
150.4333333333333330.940.92156862745098
160.4666666666666670.940.92156862745098
170.50.940.92156862745098
180.5333333333333330.940.92156862745098
190.5666666666666670.940.92156862745098
200.60.940.92156862745098
210.6333333333333330.940.92156862745098
220.6666666666666670.820.976190476190476
230.70.820.976190476190476
240.7333333333333330.820.976190476190476
250.7666666666666670.820.976190476190476
260.80.820.976190476190476
270.8333333333333330.820.976190476190476
280.8666666666666670.820.976190476190476
290.90.820.976190476190476
300.9333333333333330.641.0
310.9666666666666670.641.0
32101
Rows: 1-32 | Columns: 3