Example #1
0
 def cross_validate(self, X, y):
     binary = self.num_classes == 2
     df, cv_scores = cross_validate_pipeline(pipeline=self.pipeline,
                                             X=X,
                                             y=y,
                                             binary=binary,
                                             n_folds=self.N_FOLDS)
     self.cv_judgment_metric = np.mean(df[self.judgment_metric])
     self.cv_judgment_metric_stdev = np.std(df[self.judgment_metric])
     return cv_scores
Example #2
0
    def cross_validate(self, X, y):
        # TODO: this is hacky. See https://github.com/HDI-Project/ATM/issues/48
        binary = self.num_classes == 2
        kwargs = {}
        if self.verbose_metrics:
            kwargs['include_curves'] = True
            if not binary:
                kwargs['include_per_class'] = True

        df, cv_scores = cross_validate_pipeline(pipeline=self.pipeline,
                                                X=X,
                                                y=y,
                                                binary=binary,
                                                n_folds=self.N_FOLDS,
                                                **kwargs)

        self.cv_judgment_metric = np.mean(df[self.judgment_metric])
        self.cv_judgment_metric_stdev = np.std(df[self.judgment_metric])
        self.mu_sigma_judgment_metric = (self.cv_judgment_metric -
                                         2 * self.cv_judgment_metric_stdev)
        return cv_scores