예제 #1
0
    def __init__(self, cm: "metrics.ConfusionMatrix" = None):

        self.cm = metrics.ConfusionMatrix() if cm is None else cm
        self.pair_cm = metrics.PairConfusionMatrix(self.cm)

        self.matthews_corr = metrics.MatthewsCorrCoef(cm=self.cm)
        self.completeness = metrics.Completeness(cm=self.cm)
        self.homogeneity = metrics.Homogeneity(cm=self.cm)
        self.vbeta = metrics.VBeta(cm=self.cm)
        self.q0 = metrics.Q0(cm=self.cm)
        self.q2 = metrics.Q2(cm=self.cm)
        self.pt = metrics.PrevalenceThreshold(cm=self.cm)
        self.mutual_info = metrics.MutualInfo(cm=self.cm)
        self.normalized_mutual_info = metrics.NormalizedMutualInfo(cm=self.cm)
        self.adjusted_mutual_info = metrics.AdjustedMutualInfo(cm=self.cm)
        self.rand = metrics.Rand(cm=self.cm)
        self.adjusted_rand = metrics.AdjustedRand(cm=self.cm)
        self.variation_info = metrics.VariationInfo(cm=self.cm)
예제 #2
0
             average="weighted",
             zero_division=0),
 ),
 (metrics.F1(), partial(sk_metrics.f1_score, zero_division=0)),
 (metrics.MacroF1(),
  partial(sk_metrics.f1_score, average="macro", zero_division=0)),
 (metrics.MicroF1(),
  partial(sk_metrics.f1_score, average="micro", zero_division=0)),
 (
     metrics.WeightedF1(),
     partial(sk_metrics.f1_score, average="weighted", zero_division=0),
 ),
 (metrics.MCC(), sk_metrics.matthews_corrcoef),
 (metrics.MAE(), sk_metrics.mean_absolute_error),
 (metrics.MSE(), sk_metrics.mean_squared_error),
 (metrics.Homogeneity(), sk_metrics.homogeneity_score),
 (metrics.Completeness(), sk_metrics.completeness_score),
 (metrics.VBeta(beta=0.5), partial(sk_metrics.v_measure_score, beta=0.5)),
 (metrics.FowlkesMallows(), sk_metrics.fowlkes_mallows_score),
 (metrics.Rand(), sk_metrics.rand_score),
 (metrics.AdjustedRand(), sk_metrics.adjusted_rand_score),
 (metrics.MutualInfo(), sk_metrics.mutual_info_score),
 (
     metrics.NormalizedMutualInfo(average_method="min"),
     partial(sk_metrics.normalized_mutual_info_score, average_method="min"),
 ),
 (
     metrics.NormalizedMutualInfo(average_method="max"),
     partial(sk_metrics.normalized_mutual_info_score, average_method="max"),
 ),
 (
예제 #3
0
파일: vbeta.py 프로젝트: Leo-VK/creme
 def __init__(self, beta: float = 1.0, cm=None):
     super().__init__(cm)
     self.beta = beta
     self.homogeneity = metrics.Homogeneity(self.cm)
     self.completeness = metrics.Completeness(self.cm)