:py:mod:`rhino_health.lib.metrics.classification` ================================================= .. py:module:: rhino_health.lib.metrics.classification Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: rhino_health.lib.metrics.classification.AccuracyScore rhino_health.lib.metrics.classification.AveragePrecisionScore rhino_health.lib.metrics.classification.BalancedAccuracyScore rhino_health.lib.metrics.classification.BrierScoreLoss rhino_health.lib.metrics.classification.CohenKappaScore rhino_health.lib.metrics.classification.ConfusionMatrix rhino_health.lib.metrics.classification.DCGScore rhino_health.lib.metrics.classification.F1Score rhino_health.lib.metrics.classification.FBetaScore rhino_health.lib.metrics.classification.HammingLossMetric rhino_health.lib.metrics.classification.HingeLossMetric rhino_health.lib.metrics.classification.JaccardScore rhino_health.lib.metrics.classification.LogLoss rhino_health.lib.metrics.classification.MatthewsCorrelationCoefficient rhino_health.lib.metrics.classification.NDCGScore rhino_health.lib.metrics.classification.PrecisionScore rhino_health.lib.metrics.classification.RecallScore rhino_health.lib.metrics.classification.TopKAccuracyScore rhino_health.lib.metrics.classification.ZeroOneLoss .. py:class:: AccuracyScore(**data: Any) Bases: :py:obj:`rhino_health.lib.metrics.base_metric.AggregatableMetric` Calculates the `Accuracy Score `_ .. rubric:: 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) .. !! processed by numpydoc !! .. py:attribute:: y_true :type: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName .. py:attribute:: y_pred :type: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName .. py:attribute:: normalize :type: Optional[bool] :value: True .. py:attribute:: sample_weight :type: Optional[list] .. py:class:: AveragePrecisionScore(**data: Any) Bases: :py:obj:`rhino_health.lib.metrics.base_metric.AggregatableMetric` Calculates the `Average Precision Score `_ .. !! processed by numpydoc !! .. py:attribute:: y_true :type: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName .. py:attribute:: y_score :type: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName .. py:attribute:: average :type: Optional[str] :value: 'macro' .. py:attribute:: pos_label :type: Optional[Union[int, str]] :value: 1 .. py:attribute:: sample_weight :type: Optional[list] .. py:class:: BalancedAccuracyScore(**data: Any) Bases: :py:obj:`rhino_health.lib.metrics.base_metric.AggregatableMetric` Calculates the `Balanced Accuracy Score `_ .. !! processed by numpydoc !! .. py:attribute:: y_true :type: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName .. py:attribute:: y_pred :type: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName .. py:attribute:: sample_weight :type: Optional[list] .. py:attribute:: adjusted :type: Optional[bool] :value: False .. py:class:: BrierScoreLoss(**data: Any) Bases: :py:obj:`rhino_health.lib.metrics.base_metric.AggregatableMetric` Calculates the `Brier Score Loss `_ .. !! processed by numpydoc !! .. py:attribute:: y_true :type: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName .. py:attribute:: y_prob :type: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName .. py:attribute:: sample_weight :type: Optional[list] .. py:attribute:: pos_label :type: Optional[Union[int, str]] .. py:class:: CohenKappaScore(**data: Any) Bases: :py:obj:`rhino_health.lib.metrics.base_metric.AggregatableMetric` Calculates the `Cohen Kappa Score `_ .. !! processed by numpydoc !! .. py:attribute:: y1 :type: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName .. py:attribute:: y2 :type: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName .. py:attribute:: labels :type: Optional[list] .. py:attribute:: weights :type: Optional[str] .. py:attribute:: sample_weight :type: Optional[list] .. py:class:: ConfusionMatrix(**data: Any) Bases: :py:obj:`rhino_health.lib.metrics.base_metric.AggregatableMetric` Calculates the `Confusion Matrix `_ .. !! processed by numpydoc !! .. py:attribute:: y_true :type: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName .. py:attribute:: y_pred :type: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName .. py:attribute:: labels :type: Optional[list] .. py:attribute:: sample_weight :type: Optional[list] .. py:attribute:: normalize :type: Optional[bool] :value: True .. py:class:: DCGScore(**data: Any) Bases: :py:obj:`rhino_health.lib.metrics.base_metric.AggregatableMetric` Calculates the `DCG Score `_ .. !! processed by numpydoc !! .. py:attribute:: y_true :type: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName .. py:attribute:: y_score :type: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName .. py:attribute:: k :type: Optional[int] .. py:attribute:: log_base :type: Optional[int] :value: 2 .. py:attribute:: sample_weight :type: Optional[list] .. py:attribute:: ignore_ties :type: Optional[bool] :value: False .. py:class:: F1Score(**data: Any) Bases: :py:obj:`WeightedScore` Calculates the `F1 Score `_ .. !! processed by numpydoc !! .. py:attribute:: y_true :type: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName .. !! processed by numpydoc !! .. py:attribute:: y_pred :type: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName .. !! processed by numpydoc !! .. py:attribute:: average :type: Optional[str] :value: 'binary' .. !! processed by numpydoc !! .. py:attribute:: labels :type: Optional[list] .. !! processed by numpydoc !! .. py:attribute:: pos_label :type: Optional[Union[int, str]] :value: 1 .. !! processed by numpydoc !! .. py:attribute:: sample_weight :type: Optional[list] .. !! processed by numpydoc !! .. py:class:: FBetaScore(**data: Any) Bases: :py:obj:`WeightedScore` Calculates the `F Beta Score `_ .. !! processed by numpydoc !! .. py:attribute:: y_true :type: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName .. !! processed by numpydoc !! .. py:attribute:: y_pred :type: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName .. !! processed by numpydoc !! .. py:attribute:: average :type: Optional[str] :value: 'binary' .. !! processed by numpydoc !! .. py:attribute:: labels :type: Optional[list] .. !! processed by numpydoc !! .. py:attribute:: pos_label :type: Optional[Union[int, str]] :value: 1 .. !! processed by numpydoc !! .. py:attribute:: sample_weight :type: Optional[list] .. !! processed by numpydoc !! .. py:class:: HammingLossMetric(**data: Any) Bases: :py:obj:`rhino_health.lib.metrics.base_metric.AggregatableMetric` Calculates the `Hamming Loss Metric `_ .. !! processed by numpydoc !! .. py:attribute:: y_true :type: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName .. py:attribute:: y_pred :type: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName .. py:attribute:: sample_weight :type: Optional[list] .. py:class:: HingeLossMetric(**data: Any) Bases: :py:obj:`rhino_health.lib.metrics.base_metric.AggregatableMetric` Calculates the `Hinge Loss Metric `_ .. !! processed by numpydoc !! .. py:attribute:: y_true :type: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName .. py:attribute:: pred_decision :type: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName .. py:attribute:: labels :type: Optional[list] .. py:attribute:: sample_weight :type: Optional[list] .. py:class:: JaccardScore(**data: Any) Bases: :py:obj:`rhino_health.lib.metrics.base_metric.AggregatableMetric` Calculates the `Jaccard Score `_ .. !! processed by numpydoc !! .. py:class:: LogLoss(**data: Any) Bases: :py:obj:`rhino_health.lib.metrics.base_metric.AggregatableMetric` Calculates the `Log Loss `_ .. !! processed by numpydoc !! .. py:attribute:: y_true :type: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName .. py:attribute:: y_pred :type: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName .. py:attribute:: eps :type: Optional[float] .. py:attribute:: normalize :type: Optional[bool] :value: True .. py:attribute:: sample_weight :type: Optional[list] .. py:attribute:: labels :type: Optional[list] .. py:class:: MatthewsCorrelationCoefficient(**data: Any) Bases: :py:obj:`rhino_health.lib.metrics.base_metric.AggregatableMetric` Calculates the `Matthews Correlation Coefficient `_ .. !! processed by numpydoc !! .. py:attribute:: y_true :type: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName .. py:attribute:: y_pred :type: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName .. py:attribute:: sample_weight :type: Optional[list] .. py:class:: NDCGScore(**data: Any) Bases: :py:obj:`rhino_health.lib.metrics.base_metric.AggregatableMetric` Calculates the `NDCG Score `_ .. !! processed by numpydoc !! .. py:attribute:: y_true :type: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName .. py:attribute:: y_score :type: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName .. py:attribute:: k :type: Optional[int] .. py:attribute:: sample_weight :type: Optional[list] .. py:attribute:: ignore_ties :type: Optional[bool] :value: False .. py:class:: PrecisionScore(**data: Any) Bases: :py:obj:`WeightedScore` Calculates the `Precision Score `_ .. !! processed by numpydoc !! .. py:attribute:: y_true :type: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName .. !! processed by numpydoc !! .. py:attribute:: y_pred :type: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName .. !! processed by numpydoc !! .. py:attribute:: average :type: Optional[str] :value: 'binary' .. !! processed by numpydoc !! .. py:attribute:: labels :type: Optional[list] .. !! processed by numpydoc !! .. py:attribute:: pos_label :type: Optional[Union[int, str]] :value: 1 .. !! processed by numpydoc !! .. py:attribute:: sample_weight :type: Optional[list] .. !! processed by numpydoc !! .. py:class:: RecallScore(**data: Any) Bases: :py:obj:`WeightedScore` Calculates the `Recall Score `_ .. !! processed by numpydoc !! .. py:attribute:: y_true :type: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName .. !! processed by numpydoc !! .. py:attribute:: y_pred :type: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName .. !! processed by numpydoc !! .. py:attribute:: average :type: Optional[str] :value: 'binary' .. !! processed by numpydoc !! .. py:attribute:: labels :type: Optional[list] .. !! processed by numpydoc !! .. py:attribute:: pos_label :type: Optional[Union[int, str]] :value: 1 .. !! processed by numpydoc !! .. py:attribute:: sample_weight :type: Optional[list] .. !! processed by numpydoc !! .. py:class:: TopKAccuracyScore(**data: Any) Bases: :py:obj:`rhino_health.lib.metrics.base_metric.AggregatableMetric` Calculates the `Top K Accuracy Score `_ .. !! processed by numpydoc !! .. py:attribute:: y_true :type: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName .. py:attribute:: y_score :type: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName .. py:attribute:: k :type: Optional[int] :value: 2 .. py:attribute:: normalize :type: Optional[bool] :value: True .. py:attribute:: sample_weight :type: Optional[list] .. py:attribute:: labels :type: Optional[list] .. py:class:: ZeroOneLoss(**data: Any) Bases: :py:obj:`rhino_health.lib.metrics.base_metric.AggregatableMetric` Calculates the `Zero One Loss `_ .. !! processed by numpydoc !! .. py:attribute:: y_true :type: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName .. py:attribute:: y_score :type: rhino_health.lib.metrics.filter_variable.FilterVariableTypeOrColumnName .. py:attribute:: normalize :type: Optional[bool] :value: True .. py:attribute:: sample_weight :type: Optional[list]