Main Content

modelOperatingPoint

Operating point of rocmetrics object

Since R2024b

Description

op = modelOperatingPoint(rocObj) returns the model operating point of a rocmetrics object. The model operating point is the vector of values of the performance metrics of each class, which are contained in the rows of rocObj.Metrics. The metrics are calculated under the assumption that the model used to generate scores is operating at a threshold value of 0.5 for binary class problems or 0 for multiclass problems.

example

op = modelOperatingPoint(rocObj,threshold) specifies the threshold value for the model operating point.

example

Examples

collapse all

Create a rocmetrics object from the ionosphere data, which is a binary data set.

load ionosphere
mdl = fitctree(X,Y);
[~,scores] = predict(mdl,X);
roc = rocmetrics(Y,scores(:,1),'b');

Compute the model operating point.

op = modelOperatingPoint(roc)
op=1×4 table
    ClassName    Threshold    FalsePositiveRate    TruePositiveRate
    _________    _________    _________________    ________________

      {'b'}        0.75           0.013333             0.99206     

The expected default value of Threshold is 0.5 for binary classification, but this computation returns a value of 0.75. In this case, the model behavior is identical to a threshold of 0.5.

Create a rocmetrics object from the Fisher iris data, a multiclass data set.

load fisheriris
mdl = fitctree(meas,species);
roc = rocmetrics(mdl,meas,species);

Find the model operating point with a threshold value of 0.5, which is different from the default value of 0 for a multiclass model.

op = modelOperatingPoint(roc,0.5)
op=3×4 table
      ClassName       Threshold    FalsePositiveRate    TruePositiveRate
    ______________    _________    _________________    ________________

    {'setosa'    }           1              0                    1      
    {'versicolor'}           1              0                 0.94      
    {'virginica' }     0.95652           0.01                 0.92      

The returned threshold values are not equal to 0.5. But the model behavior is the same as for a threshold of 0.5.

Input Arguments

collapse all

Object evaluating classification performance, specified as a rocmetrics object.

Threshold value for the model behavior, specified as a double or single scalar.

  • For a binary object rocObj, the default value is 0.5.

  • For a multiclass object rocObj, the default value is 0.

Example: op = modelOperatingPoint(rocObj,0.75)

Data Types: single | double

Output Arguments

collapse all

Operating point of the model, returned as a table. op is a table of rows taken from rocObj.Metrics that correspond to where the model is operating for each class.

Version History

Introduced in R2024b

See Also

|

Topics