rhino_health.lib.metrics.classification#

Module Contents#

Classes#

AccuracyScore

Calculates the Accuracy Score

AveragePrecisionScore

Calculates the Average Precision Score

BalancedAccuracyScore

Calculates the Balanced Accuracy Score

BrierScoreLoss

Calculates the Brier Score Loss

CohenKappaScore

Calculates the Cohen Kappa Score

ConfusionMatrix

Calculates the Confusion Matrix

DCGScore

Calculates the DCG Score

F1Score

Calculates the F1 Score

FBetaScore

Calculates the F Beta Score

HammingLossMetric

Calculates the Hamming Loss Metric

HingeLossMetric

Calculates the Hinge Loss Metric

JaccardScore

Calculates the Jaccard Score

LogLoss

Calculates the Log Loss

MatthewsCorrelationCoefficient

Calculates the Matthews Correlation Coefficient

NDCGScore

Calculates the NDCG Score

PrecisionScore

Calculates the Precision Score

RecallScore

Calculates the Recall Score

TopKAccuracyScore

Calculates the Top K Accuracy Score

ZeroOneLoss

Calculates the Zero One Loss

class rhino_health.lib.metrics.classification.AccuracyScore(**data: Any)#

Bases: rhino_health.lib.metrics.base_metric.AggregatableMetric

Calculates the Accuracy Score

Examples

>>> accuracy_score_configuration = AccuracyScore(
...   y_true = 'first_binary_column',
...   y_pred = 'second_binary_column',
...   normalize = False,
...   sample_weight = [ 0.1, 0.2, 1, 0, ..... ],
... )
>>> my_dataset.get_metric(accuracy_score_configuration)
y_true: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName#
y_pred: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName#
normalize: bool | None = True#
sample_weight: list | None#
class rhino_health.lib.metrics.classification.AveragePrecisionScore(**data: Any)#

Bases: rhino_health.lib.metrics.base_metric.AggregatableMetric

Calculates the Average Precision Score

y_true: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName#
y_score: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName#
average: str | None = 'macro'#
pos_label: int | str | None = 1#
sample_weight: list | None#
class rhino_health.lib.metrics.classification.BalancedAccuracyScore(**data: Any)#

Bases: rhino_health.lib.metrics.base_metric.AggregatableMetric

Calculates the Balanced Accuracy Score

y_true: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName#
y_pred: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName#
sample_weight: list | None#
adjusted: bool | None = False#
class rhino_health.lib.metrics.classification.BrierScoreLoss(**data: Any)#

Bases: rhino_health.lib.metrics.base_metric.AggregatableMetric

Calculates the Brier Score Loss

y_true: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName#
y_prob: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName#
sample_weight: list | None#
pos_label: int | str | None#
class rhino_health.lib.metrics.classification.CohenKappaScore(**data: Any)#

Bases: rhino_health.lib.metrics.base_metric.AggregatableMetric

Calculates the Cohen Kappa Score

y1: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName#
y2: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName#
labels: list | None#
weights: str | None#
sample_weight: list | None#
class rhino_health.lib.metrics.classification.ConfusionMatrix(**data: Any)#

Bases: rhino_health.lib.metrics.base_metric.AggregatableMetric

Calculates the Confusion Matrix

y_true: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName#
y_pred: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName#
labels: list | None#
sample_weight: list | None#
normalize: bool | None = True#
class rhino_health.lib.metrics.classification.DCGScore(**data: Any)#

Bases: rhino_health.lib.metrics.base_metric.AggregatableMetric

Calculates the DCG Score

y_true: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName#
y_score: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName#
k: int | None#
log_base: int | None = 2#
sample_weight: list | None#
ignore_ties: bool | None = False#
class rhino_health.lib.metrics.classification.F1Score(**data: Any)#

Bases: WeightedScore

Calculates the F1 Score

y_true: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName#
y_pred: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName#
average: str | None = 'binary'#
labels: list | None#
pos_label: int | str | None = 1#
sample_weight: list | None#
class rhino_health.lib.metrics.classification.FBetaScore(**data: Any)#

Bases: WeightedScore

Calculates the F Beta Score

y_true: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName#
y_pred: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName#
average: str | None = 'binary'#
labels: list | None#
pos_label: int | str | None = 1#
sample_weight: list | None#
class rhino_health.lib.metrics.classification.HammingLossMetric(**data: Any)#

Bases: rhino_health.lib.metrics.base_metric.AggregatableMetric

Calculates the Hamming Loss Metric

y_true: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName#
y_pred: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName#
sample_weight: list | None#
class rhino_health.lib.metrics.classification.HingeLossMetric(**data: Any)#

Bases: rhino_health.lib.metrics.base_metric.AggregatableMetric

Calculates the Hinge Loss Metric

y_true: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName#
pred_decision: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName#
labels: list | None#
sample_weight: list | None#
class rhino_health.lib.metrics.classification.JaccardScore(**data: Any)#

Bases: rhino_health.lib.metrics.base_metric.AggregatableMetric

Calculates the Jaccard Score

class rhino_health.lib.metrics.classification.LogLoss(**data: Any)#

Bases: rhino_health.lib.metrics.base_metric.AggregatableMetric

Calculates the Log Loss

y_true: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName#
y_pred: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName#
eps: float | None#
normalize: bool | None = True#
sample_weight: list | None#
labels: list | None#
class rhino_health.lib.metrics.classification.MatthewsCorrelationCoefficient(**data: Any)#

Bases: rhino_health.lib.metrics.base_metric.AggregatableMetric

Calculates the Matthews Correlation Coefficient

y_true: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName#
y_pred: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName#
sample_weight: list | None#
class rhino_health.lib.metrics.classification.NDCGScore(**data: Any)#

Bases: rhino_health.lib.metrics.base_metric.AggregatableMetric

Calculates the NDCG Score

y_true: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName#
y_score: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName#
k: int | None#
sample_weight: list | None#
ignore_ties: bool | None = False#
class rhino_health.lib.metrics.classification.PrecisionScore(**data: Any)#

Bases: WeightedScore

Calculates the Precision Score

y_true: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName#
y_pred: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName#
average: str | None = 'binary'#
labels: list | None#
pos_label: int | str | None = 1#
sample_weight: list | None#
class rhino_health.lib.metrics.classification.RecallScore(**data: Any)#

Bases: WeightedScore

Calculates the Recall Score

y_true: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName#
y_pred: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName#
average: str | None = 'binary'#
labels: list | None#
pos_label: int | str | None = 1#
sample_weight: list | None#
class rhino_health.lib.metrics.classification.TopKAccuracyScore(**data: Any)#

Bases: rhino_health.lib.metrics.base_metric.AggregatableMetric

Calculates the Top K Accuracy Score

y_true: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName#
y_score: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName#
k: int | None = 2#
normalize: bool | None = True#
sample_weight: list | None#
labels: list | None#
class rhino_health.lib.metrics.classification.ZeroOneLoss(**data: Any)#

Bases: rhino_health.lib.metrics.base_metric.AggregatableMetric

Calculates the Zero One Loss

y_true: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName#
y_score: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName#
normalize: bool | None = True#
sample_weight: list | None#