Metrics

class getml.pipeline.Metrics(name)

Bases: object

Custom class for handling the metrics generated by the pipeline.

Example

recall, precision = my_pipeline.metrics.precision_recall_curve()

fpr, tpr = my_pipeline.metrics.roc_curve()

Methods Summary

lift_curve([target_num])

Returns the data for the lift curve, as displayed in the getML monitor.

precision_recall_curve([target_num])

Returns the data for the precision-recall curve, as displayed in the getML monitor.

roc_curve([target_num])

Returns the data for the ROC curve, as displayed in the getML monitor.

Methods Documentation

lift_curve(target_num=0)

Returns the data for the lift curve, as displayed in the getML monitor.

This requires that you call score() first. The data used for the curve will always be the data from the last time you called score().

Parameters

target_num (int) – Indicates for which target you want to plot the lift curve. (Pipelines can have more than one target.)

Returns

  • The first array is the proportion of samples, usually displayed on the x-axis.

  • The second array is the lift, usually displayed on the y-axis.

Return type

(numpy.ndarray, numpy.ndarray)

precision_recall_curve(target_num=0)

Returns the data for the precision-recall curve, as displayed in the getML monitor.

This requires that you call score() first. The data used for the curve will always be the data from the last time you called score().

Parameters

target_num (int) – Indicates for which target you want to plot the lift curve. (Pipelines can have more than one target.)

Returns

  • The first array is the recall (a.k.a. true postive rate), usually displayed on the x-axis.

  • The second array is the precision, usually displayed on the y-axis.

Return type

(numpy.ndarray, numpy.ndarray)

roc_curve(target_num=0)

Returns the data for the ROC curve, as displayed in the getML monitor.

This requires that you call score() first. The data used for the curve will always be the data from the last time you called score().

Parameters

target_num (int) – Indicates for which target you want to plot the lift curve. (Pipelines can have more than one target.)

Returns

  • The first array is the false positive rate, usually displayed on the x-axis.

  • The second array is the true positive rate, usually displayed on the y-axis.

Return type

(numpy.ndarray, numpy.ndarray)