rhino_health.lib.metrics.classification
#
Module Contents#
Classes#
Calculates the Accuracy Score |
|
Calculates the Average Precision Score |
|
Calculates the Balanced Accuracy Score |
|
Calculates the Brier Score Loss |
|
Calculates the Cohen Kappa Score |
|
Calculates the Confusion Matrix |
|
Calculates the DCG Score |
|
Calculates the F1 Score |
|
Calculates the F Beta Score |
|
Calculates the Hamming Loss Metric |
|
Calculates the Hinge Loss Metric |
|
Calculates the Jaccard Score |
|
Calculates the Log Loss |
|
Calculates the Matthews Correlation Coefficient |
|
Calculates the NDCG Score |
|
Calculates the Precision Score |
|
Calculates the Recall Score |
|
Calculates the Top K Accuracy Score |
|
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#