Coverage for langbrainscore/metrics/__init__.py: 100%
3 statements
« prev ^ index » next coverage.py v6.4, created at 2022-06-07 21:22 +0000
« prev ^ index » next coverage.py v6.4, created at 2022-06-07 21:22 +0000
1"""submodule housing metrics used to evaluate similarity of representations"""
3import typing
4from langbrainscore.metrics.metric import (
5 CKA,
6 FisherCorr,
7 PearsonR,
8 RSA,
9 ClassificationAccuracy,
10 RMSE,
11 KendallTau,
12 SpearmanRho,
13 # Metric,
14)
16metric_classes = {
17 "cka": CKA,
18 "rsa": RSA,
19 "pearsonr": PearsonR,
20 "spearmanrho": SpearmanRho,
21 "fishercorr": FisherCorr,
22 "kendalltau": KendallTau,
23 "rmse": RMSE,
24 "acc": ClassificationAccuracy,
25}
28# def load_metric(metric_class: typing.Union[str, Metric]):
29# if metric_class in metric_class_mapping:
30# return Metric(metric_class_mapping[metric_class])
31# elif callable(metric_class):
32# return Metric(metric_class)