Model.prc_curve

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

Draws the model PRC curve.

Parameters

Name Type Optional Description
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 [9]:
# Binary Classification
model = RandomForestClassifier(name = "public.RF_titanic",
                               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.titanic", ["age", "fare", "sex"], "survived")
# PRC Curve
model.prc_curve()
Out[9]:
threshold
recall
precision
1010
20.01.00.392570281124498
30.03333333333333331.00.392570281124498
40.06666666666666671.00.392570281124498
50.11.00.392570281124498
60.1333333333333331.00.392570281124498
70.1666666666666670.8772378516624040.545310015898251
80.20.8158567774936060.640562248995984
90.2333333333333330.8158567774936060.640562248995984
100.2666666666666670.8081841432225060.675213675213675
110.30.7340153452685420.73027989821883
120.3333333333333330.7289002557544760.736434108527132
130.3666666666666670.7263427109974420.735751295336788
140.40.7237851662404090.735064935064935
150.4333333333333330.7058823529411770.741935483870968
160.4666666666666670.6879795396419440.747222222222222
170.50.6828644501278770.745810055865922
180.5333333333333330.6828644501278770.745810055865922
190.5666666666666670.6828644501278770.745810055865922
200.60.6675191815856780.75
210.6333333333333330.5012787723785170.85589519650655
220.6666666666666670.3554987212276210.926666666666667
230.70.3503836317135550.931972789115646
240.7333333333333330.3145780051150890.953488372093023
250.7666666666666670.306905370843990.96
260.80.2890025575447570.974137931034483
270.8333333333333330.2864450127877240.973913043478261
280.8666666666666670.2864450127877240.973913043478261
290.90.2864450127877240.982456140350877
300.9333333333333330.2864450127877240.982456140350877
310.9666666666666670.05626598465473151.0
32101
Rows: 1-32 | Columns: 3