Exemplo n.º 1
0
    def _setup_eval(self, eval_data: evdata.EvalData):

        self.prepare, self.id_ = analysis.get_confidence_entry_preparation(
            eval_data, 'probabilities')
        self.load_params = analysis.Loader.Params(eval_data.confidence_entry)

        metric = ev.ComposeEvaluation([
            ev.LambdaEvaluation(lambda x: x.min(), ('probabilities', ), 'min'),
            ev.LambdaEvaluation(lambda x: x.max(), ('probabilities', ), 'max')
        ])
        hook = hooks.WriteSummaryCsvHook(
            os.path.join(self.min_max_dir,
                         dirs.MINMAX_PLACEHOLDER.format(self.id_)),
            confidence_entry=eval_data.confidence_entry)
        self.eval_cases = [EvalCase(metric, hook)]
Exemplo n.º 2
0
    def _setup_eval(self, eval_data: evdata.EvalData):
        self.prepare, self.id_ = analysis.get_probability_preparation(
            eval_data,
            rescale_confidence=self.rescale_confidence,
            rescale_sigma=self.rescale_sigma,
            min_max_dir=self.min_max_dir)
        self.load_params = analysis.Loader.Params(
            eval_data.confidence_entry, need_t2_mask=self.need_t2_mask)

        metric = ev.ComposeEvaluation(
            [*self._m, ev.DiceNumpy(),
             ev.ConfusionMatrix()])
        hook = hooks.ReducedComposeEvalHook([
            hooks.WriteCsvHook(os.path.join(
                self.out_dir, dirs.ECE_PLACEHOLDER.format(self.id_)),
                               entries=(*self.ece_entries, 'dice', 'tp', 'tn',
                                        'fp', 'fn', 'n'))
        ])
        self.eval_cases = [EvalCase(metric, hook)]
Exemplo n.º 3
0
    def _setup_eval(self, eval_data: evdata.EvalData):
        self.prepare, self.id_ = analysis.get_probability_preparation(
            eval_data,
            rescale_confidence=self.rescale_confidence,
            rescale_sigma=self.rescale_sigma,
            min_max_dir=self.min_max_dir)
        self.load_params = analysis.Loader.Params(eval_data.confidence_entry,
                                                  need_t2_mask=self.need_mask)

        metric = ev.ComposeEvaluation([
            ev.EceBinaryNumpy(threshold_range=None,
                              return_bins=True,
                              with_mask=self.need_mask),
            ev.DiceNumpy()
        ])
        hook = hooks.ReducedComposeEvalHook([
            hooks.WriteBinsCsvHook(
                os.path.join(self.out_dir,
                             dirs.CALIBRATION_PLACEHOLDER.format(self.id_)))
        ])
        self.eval_cases = [EvalCase(metric, hook)]
 def __init__(self) -> None:
     super().__init__()
     self.evaluate = ev.ComposeEvaluation([ev.DiceNumpy()])
 def __init__(self) -> None:
     super().__init__()
     self.evaluate = eval.ComposeEvaluation([eval.SmoothDice('dice')])
 def __init__(self) -> None:
     super().__init__()
     self.evaluate = ev.ComposeEvaluation([ev.DiceNumpy(),
                                           # ev2.EntropyEval(entropy_threshold=0.7, with_ratios=False),
                                           ev.LogLossSklearn()])