ltbio.ml.metrics#

Overview#

Classes#

Accuracy

Accuracy based on true and false positives and negatives.

F1

F1-score based on true and false positives and negatives.

MAE

Mean Absolute Error.

MSE

Mean Squared Error.

Metric

Helper class that provides a standard way to create an ABC using

PlotMetric

Helper class that provides a standard way to create an ABC using

Precision

Precision based on true and false positives and negatives.

Recall

Recall based on true and false positives and negatives.

SNR

Signal-to-noise ratio.

SNRI

Signal-to-noise ratio improvement.

Sensitivity

Sensitivity based on true and false positives and negatives.

Specificity

Specificity based on true and false positives and negatives.

ValueMetric

Helper class that provides a standard way to create an ABC using

Contents#

class ltbio.ml.metrics.Accuracy(value)#

Bases: ValueMetric

digraph inheritance7ab42514a9 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "ABC" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="Helper class that provides a standard way to create an ABC using"]; "Accuracy" [URL="#ltbio.ml.metrics.Accuracy",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Accuracy based on true and false positives and negatives."]; "ValueMetric" -> "Accuracy" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Metric" [URL="#ltbio.ml.metrics.Metric",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "ABC" -> "Metric" [arrowsize=0.5,style="setlinewidth(0.5)"]; "ValueMetric" [URL="#ltbio.ml.metrics.ValueMetric",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "Metric" -> "ValueMetric" [arrowsize=0.5,style="setlinewidth(0.5)"]; "ABC" -> "ValueMetric" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

Accuracy based on true and false positives and negatives.

property name#
class ltbio.ml.metrics.F1(value)#

Bases: ValueMetric

digraph inheritancef29ae2166e { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "ABC" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="Helper class that provides a standard way to create an ABC using"]; "F1" [URL="#ltbio.ml.metrics.F1",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="F1-score based on true and false positives and negatives."]; "ValueMetric" -> "F1" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Metric" [URL="#ltbio.ml.metrics.Metric",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "ABC" -> "Metric" [arrowsize=0.5,style="setlinewidth(0.5)"]; "ValueMetric" [URL="#ltbio.ml.metrics.ValueMetric",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "Metric" -> "ValueMetric" [arrowsize=0.5,style="setlinewidth(0.5)"]; "ABC" -> "ValueMetric" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

F1-score based on true and false positives and negatives.

property name#
class ltbio.ml.metrics.MAE(value)#

Bases: ValueMetric

digraph inheritance7da3d151e0 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "ABC" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="Helper class that provides a standard way to create an ABC using"]; "MAE" [URL="#ltbio.ml.metrics.MAE",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Mean Absolute Error."]; "ValueMetric" -> "MAE" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Metric" [URL="#ltbio.ml.metrics.Metric",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "ABC" -> "Metric" [arrowsize=0.5,style="setlinewidth(0.5)"]; "ValueMetric" [URL="#ltbio.ml.metrics.ValueMetric",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "Metric" -> "ValueMetric" [arrowsize=0.5,style="setlinewidth(0.5)"]; "ABC" -> "ValueMetric" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

Mean Absolute Error.

property name#
class ltbio.ml.metrics.MSE(value: float | int)#

Bases: ValueMetric

digraph inheritance8940ff7bc6 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "ABC" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="Helper class that provides a standard way to create an ABC using"]; "MSE" [URL="#ltbio.ml.metrics.MSE",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Mean Squared Error."]; "ValueMetric" -> "MSE" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Metric" [URL="#ltbio.ml.metrics.Metric",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "ABC" -> "Metric" [arrowsize=0.5,style="setlinewidth(0.5)"]; "ValueMetric" [URL="#ltbio.ml.metrics.ValueMetric",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "Metric" -> "ValueMetric" [arrowsize=0.5,style="setlinewidth(0.5)"]; "ABC" -> "ValueMetric" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

Mean Squared Error.

property name#
static compute_value(dataset, predictions)#
class ltbio.ml.metrics.Metric#

Bases: abc.ABC

digraph inheritance6ea0e69041 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "ABC" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="Helper class that provides a standard way to create an ABC using"]; "Metric" [URL="#ltbio.ml.metrics.Metric",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "ABC" -> "Metric" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

Helper class that provides a standard way to create an ABC using inheritance.

abstract property name: str#
class ltbio.ml.metrics.PlotMetric(x, y)#

Bases: Metric, abc.ABC

digraph inheritance9663611f17 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "ABC" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="Helper class that provides a standard way to create an ABC using"]; "Metric" [URL="#ltbio.ml.metrics.Metric",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "ABC" -> "Metric" [arrowsize=0.5,style="setlinewidth(0.5)"]; "PlotMetric" [URL="#ltbio.ml.metrics.PlotMetric",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "Metric" -> "PlotMetric" [arrowsize=0.5,style="setlinewidth(0.5)"]; "ABC" -> "PlotMetric" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

Helper class that provides a standard way to create an ABC using inheritance.

class ltbio.ml.metrics.Precision(value)#

Bases: ValueMetric

digraph inheritance8fa5e634d9 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "ABC" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="Helper class that provides a standard way to create an ABC using"]; "Metric" [URL="#ltbio.ml.metrics.Metric",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "ABC" -> "Metric" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Precision" [URL="#ltbio.ml.metrics.Precision",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Precision based on true and false positives and negatives."]; "ValueMetric" -> "Precision" [arrowsize=0.5,style="setlinewidth(0.5)"]; "ValueMetric" [URL="#ltbio.ml.metrics.ValueMetric",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "Metric" -> "ValueMetric" [arrowsize=0.5,style="setlinewidth(0.5)"]; "ABC" -> "ValueMetric" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

Precision based on true and false positives and negatives.

property name#
class ltbio.ml.metrics.Recall(value)#

Bases: ValueMetric

digraph inheritance59130fcedf { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "ABC" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="Helper class that provides a standard way to create an ABC using"]; "Metric" [URL="#ltbio.ml.metrics.Metric",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "ABC" -> "Metric" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Recall" [URL="#ltbio.ml.metrics.Recall",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Recall based on true and false positives and negatives."]; "ValueMetric" -> "Recall" [arrowsize=0.5,style="setlinewidth(0.5)"]; "ValueMetric" [URL="#ltbio.ml.metrics.ValueMetric",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "Metric" -> "ValueMetric" [arrowsize=0.5,style="setlinewidth(0.5)"]; "ABC" -> "ValueMetric" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

Recall based on true and false positives and negatives.

property name#
class ltbio.ml.metrics.SNR(value)#

Bases: ValueMetric

digraph inheritance3a5a601c63 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "ABC" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="Helper class that provides a standard way to create an ABC using"]; "Metric" [URL="#ltbio.ml.metrics.Metric",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "ABC" -> "Metric" [arrowsize=0.5,style="setlinewidth(0.5)"]; "SNR" [URL="#ltbio.ml.metrics.SNR",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Signal-to-noise ratio."]; "ValueMetric" -> "SNR" [arrowsize=0.5,style="setlinewidth(0.5)"]; "ValueMetric" [URL="#ltbio.ml.metrics.ValueMetric",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "Metric" -> "ValueMetric" [arrowsize=0.5,style="setlinewidth(0.5)"]; "ABC" -> "ValueMetric" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

Signal-to-noise ratio.

property name#
property unit: ltbio.biosignals.timeseries.Unit.Unit#
class ltbio.ml.metrics.SNRI(value)#

Bases: ValueMetric

digraph inheritance42dd49f0fe { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "ABC" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="Helper class that provides a standard way to create an ABC using"]; "Metric" [URL="#ltbio.ml.metrics.Metric",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "ABC" -> "Metric" [arrowsize=0.5,style="setlinewidth(0.5)"]; "SNRI" [URL="#ltbio.ml.metrics.SNRI",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Signal-to-noise ratio improvement."]; "ValueMetric" -> "SNRI" [arrowsize=0.5,style="setlinewidth(0.5)"]; "ValueMetric" [URL="#ltbio.ml.metrics.ValueMetric",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "Metric" -> "ValueMetric" [arrowsize=0.5,style="setlinewidth(0.5)"]; "ABC" -> "ValueMetric" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

Signal-to-noise ratio improvement.

property name#
property unit: ltbio.biosignals.timeseries.Unit.Unit#
class ltbio.ml.metrics.Sensitivity(value)#

Bases: ValueMetric

digraph inheritancee88ab9a77f { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "ABC" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="Helper class that provides a standard way to create an ABC using"]; "Metric" [URL="#ltbio.ml.metrics.Metric",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "ABC" -> "Metric" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Sensitivity" [URL="#ltbio.ml.metrics.Sensitivity",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Sensitivity based on true and false positives and negatives."]; "ValueMetric" -> "Sensitivity" [arrowsize=0.5,style="setlinewidth(0.5)"]; "ValueMetric" [URL="#ltbio.ml.metrics.ValueMetric",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "Metric" -> "ValueMetric" [arrowsize=0.5,style="setlinewidth(0.5)"]; "ABC" -> "ValueMetric" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

Sensitivity based on true and false positives and negatives.

property name#
class ltbio.ml.metrics.Specificity(value)#

Bases: ValueMetric

digraph inheritance5663ecf534 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "ABC" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="Helper class that provides a standard way to create an ABC using"]; "Metric" [URL="#ltbio.ml.metrics.Metric",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "ABC" -> "Metric" [arrowsize=0.5,style="setlinewidth(0.5)"]; "Specificity" [URL="#ltbio.ml.metrics.Specificity",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Specificity based on true and false positives and negatives."]; "ValueMetric" -> "Specificity" [arrowsize=0.5,style="setlinewidth(0.5)"]; "ValueMetric" [URL="#ltbio.ml.metrics.ValueMetric",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "Metric" -> "ValueMetric" [arrowsize=0.5,style="setlinewidth(0.5)"]; "ABC" -> "ValueMetric" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

Specificity based on true and false positives and negatives.

property name#
class ltbio.ml.metrics.ValueMetric(value: float | int)#

Bases: Metric, abc.ABC

digraph inheritance415b930dbd { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "ABC" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",tooltip="Helper class that provides a standard way to create an ABC using"]; "Metric" [URL="#ltbio.ml.metrics.Metric",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "ABC" -> "Metric" [arrowsize=0.5,style="setlinewidth(0.5)"]; "ValueMetric" [URL="#ltbio.ml.metrics.ValueMetric",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top"]; "Metric" -> "ValueMetric" [arrowsize=0.5,style="setlinewidth(0.5)"]; "ABC" -> "ValueMetric" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

Helper class that provides a standard way to create an ABC using inheritance.

property unit: ltbio.biosignals.timeseries.Unit.Unit#
abstract static compute_value(dataset: ltbio.ml.datasets.BiosignalDataset.BiosignalDataset, predictions) float#
classmethod fromDatasetPredictions(dataset: ltbio.ml.datasets.BiosignalDataset.BiosignalDataset, predictions)#