Skip to content

MetricFrame

fairlearn_fhe.metrics.MetricFrame(*, metrics, y_true, y_pred, sensitive_features, sample_params=None, allow_decrypt=False)

Encrypted-aware MetricFrame factory.

Mirrors :class:fairlearn.metrics.MetricFrame for plaintext inputs (returns the genuine fairlearn object so isinstance against :class:fairlearn.metrics.MetricFrame works). For encrypted y_pred returns an :class:EncryptedMetricFrame with the same accessors used by the fairness wrappers.

This is a function rather than a class so that callers don't have to think about which concrete type they got back; introspect via isinstance(result, EncryptedMetricFrame) if you need to distinguish.

fairlearn_fhe.metrics.EncryptedMetricFrame dataclass