czbenchmarks.metrics.implementations

Implementation of metric functions and registration with the registry.

This file defines and registers various metrics with a global MetricRegistry. Metrics are categorized into the following types: - Clustering metrics (e.g., Adjusted Rand Index, Normalized Mutual Information) - Embedding quality metrics (e.g., Silhouette Score) - Integration metrics (e.g., Entropy Per Cell, Batch Silhouette) - Perturbation metrics (e.g., Mean Squared Error, Pearson Correlation) - Label prediction metrics (e.g., Mean Fold Accuracy, Mean Fold F1 Score)

Each metric is registered with: - A unique MetricType identifier. - The function implementing the metric. - Required arguments for the metric function. - A description of the metric’s purpose. - Tags categorizing the metric.

Attributes

metrics_registry

Functions

spearman_correlation(a, b)

Wrapper for spearmanr that returns only the correlation coefficient.

precision_score_zero_division(y_true, y_pred, **kwargs)

Wrapper for precision_score with zero_division=0 to suppress warnings.

recall_score_zero_division(y_true, y_pred, **kwargs)

Wrapper for recall_score with zero_division=0 to suppress warnings.

f1_score_zero_division(y_true, y_pred, **kwargs)

Wrapper for f1_score with zero_division=0 to suppress warnings.

Module Contents

czbenchmarks.metrics.implementations.spearman_correlation(a, b)[source]

Wrapper for spearmanr that returns only the correlation coefficient.

czbenchmarks.metrics.implementations.precision_score_zero_division(y_true, y_pred, **kwargs)[source]

Wrapper for precision_score with zero_division=0 to suppress warnings.

czbenchmarks.metrics.implementations.recall_score_zero_division(y_true, y_pred, **kwargs)[source]

Wrapper for recall_score with zero_division=0 to suppress warnings.

czbenchmarks.metrics.implementations.f1_score_zero_division(y_true, y_pred, **kwargs)[source]

Wrapper for f1_score with zero_division=0 to suppress warnings.

czbenchmarks.metrics.implementations.metrics_registry