Beispiel #1
0
 def test_default_configuration_iterative_fit(self):
     for i in range(10):
         predictions, targets = \
             _test_classifier_iterative_fit(ExtraTreesClassifier)
         self.assertAlmostEqual(
             0.93999999999999995,
             sklearn.metrics.accuracy_score(targets, predictions))
 def test_default_configuration_iterative_fit(self):
     for i in range(2):
         predictions, targets = \
             _test_classifier_iterative_fit(RandomForest)
         self.assertAlmostEqual(0.95999999999999996,
                                sklearn.metrics.accuracy_score(
                                    predictions, targets))
 def test_default_configuration_digits_iterative_fit(self):
     for i in range(10):
         predictions, targets = _test_classifier_iterative_fit(classifier=PassiveAggressive,
                                                 dataset='digits')
         self.assertAlmostEqual(0.91317547055251969,
                                sklearn.metrics.accuracy_score(
                                    predictions, targets))
 def test_default_configuration_iterative_fit(self):
     for i in range(10):
         predictions, targets = \
             _test_classifier_iterative_fit(GradientBoostingClassifier)
         self.assertAlmostEqual(0.95999999999999996,
                                sklearn.metrics.accuracy_score(predictions,
                                                               targets))
Beispiel #5
0
 def test_default_configuration_iterative_fit(self):
     for i in range(10):
         predictions, targets = \
             _test_classifier_iterative_fit(BernoulliNB)
         self.assertAlmostEqual(
             0.26000000000000001,
             sklearn.metrics.accuracy_score(predictions, targets))
Beispiel #6
0
 def test_default_configuration_digits_iterative_fit(self):
     for i in range(10):
         predictions, targets = _test_classifier_iterative_fit(
             SGD, dataset='digits')
         self.assertAlmostEqual(
             0.91438979963570133,
             sklearn.metrics.accuracy_score(predictions, targets))
Beispiel #7
0
 def test_default_configuration_iterative_fit(self):
     for i in range(2):
         predictions, targets = \
             _test_classifier_iterative_fit(MultinomialNB)
         self.assertAlmostEqual(
             0.97999999999999998,
             sklearn.metrics.accuracy_score(predictions, targets))
Beispiel #8
0
 def test_default_configuration_iterative_fit(self):
     for i in range(10):
         predictions, targets = \
             _test_classifier_iterative_fit(GradientBoostingClassifier)
         self.assertAlmostEqual(0.95999999999999996,
                                sklearn.metrics.accuracy_score(predictions,
                                                               targets))
Beispiel #9
0
 def test_default_configuration_iterative_fit(self):
     for i in range(10):
         predictions, targets = _test_classifier_iterative_fit(
             PassiveAggressive)
         self.assertAlmostEqual(
             0.97999999999999998,
             sklearn.metrics.accuracy_score(predictions, targets))
 def test_default_configuration_iterative_fit(self):
     for i in range(10):
         predictions, targets = \
             _test_classifier_iterative_fit(MultinomialNB)
         self.assertAlmostEqual(0.97999999999999998,
                                sklearn.metrics.accuracy_score(predictions,
                                                               targets))
Beispiel #11
0
 def test_default_configuration_digits_iterative_fit(self):
     for i in range(10):
         predictions, targets = _test_classifier_iterative_fit(
             classifier=PassiveAggressive, dataset='digits')
         self.assertAlmostEqual(
             0.91924711596842745,
             sklearn.metrics.accuracy_score(predictions, targets))
 def test_default_configuration_iterative_fit(self):
     for i in range(10):
         predictions, targets = _test_classifier_iterative_fit(
             PassiveAggressive)
         self.assertAlmostEqual(0.68000000000000005,
                                sklearn.metrics.accuracy_score(
                                    predictions, targets))
Beispiel #13
0
 def test_default_configuration_iterative_fit(self):
     for i in range(10):
         predictions, targets = \
             _test_classifier_iterative_fit(ExtraTreesClassifier)
         self.assertAlmostEqual(0.93999999999999995,
                                sklearn.metrics.accuracy_score(targets,
                                                               predictions))
Beispiel #14
0
 def test_default_configuration_digits_iterative_fit(self):
     for i in range(2):
         predictions, targets = _test_classifier_iterative_fit(
             SGD, dataset='digits')
         self.assertAlmostEqual(
             0.89981785063752273,
             sklearn.metrics.accuracy_score(predictions, targets))
 def test_default_configuration_iterative_fit(self):
     for i in range(10):
         predictions, targets = \
             _test_classifier_iterative_fit(BernoulliNB)
         self.assertAlmostEqual(0.26000000000000001,
                                sklearn.metrics.accuracy_score(predictions,
                                                               targets))
Beispiel #16
0
 def test_default_configuration_sparse(self):
     for i in range(10):
         predictions, targets = \
             _test_classifier_iterative_fit(DeepNetIterative, sparse=True)
         acc_score = sklearn.metrics.accuracy_score(y_pred=predictions, y_true=targets)
         print(acc_score)
         self.assertAlmostEqual(0.54, acc_score)
Beispiel #17
0
 def test_default_configuration_digits_iterative_fit(self):
     for i in range(10):
         predictions, targets = _test_classifier_iterative_fit(
             SGD,
             dataset='digits')
         self.assertAlmostEqual(0.91438979963570133,
                                sklearn.metrics.accuracy_score(
                                    predictions, targets))
Beispiel #18
0
    def test_default_digits_iterative_fit(self):
        if not hasattr(self.module, 'iterative_fit'):
            return

        for i in range(2):
            predictions, targets = \
                _test_classifier_iterative_fit(dataset="digits",
                                               classifier=self.module)
            self.assertAlmostEqual(
                self.res["default_digits_iterative"],
                sklearn.metrics.accuracy_score(targets, predictions),
                places=self.res.get("default_digits_iterative_places", 7))
    def test_default_iris_iterative_fit(self):
        if not hasattr(self.module, 'iterative_fit'):
            return

        for i in range(2):
            predictions, targets, classifier = \
                _test_classifier_iterative_fit(dataset="iris",
                                               classifier=self.module)
            self.assertAlmostEqual(
                self.res["default_iris_iterative"],
                sklearn.metrics.accuracy_score(targets, predictions),
                places=self.res.get("default_iris_iterative_places", 7))

            if self.step_hyperparameter is not None:
                self.assertEqual(
                    getattr(classifier.estimator,
                            self.step_hyperparameter['name']),
                    self.step_hyperparameter['value'])
Beispiel #20
0
    def test_default_iris_iterative_fit(self):
        if not hasattr(self.module, 'iterative_fit'):
            return

        for i in range(2):
            predictions, targets, classifier = \
                _test_classifier_iterative_fit(dataset="iris",
                                               classifier=self.module)
            self.assertAlmostEqual(self.res["default_iris_iterative"],
                                   sklearn.metrics.accuracy_score(targets,
                                                                  predictions),
                                   places=self.res.get(
                                           "default_iris_iterative_places", 7))

            if self.step_hyperparameter is not None:
                self.assertEqual(
                    getattr(classifier.estimator, self.step_hyperparameter['name']),
                    self.step_hyperparameter['value']
                )
 def test_default_configuration_digits_iterative_fit(self):
     for i in range(10):
         predictions, targets = _test_classifier_iterative_fit(classifier=PassiveAggressive, dataset="digits")
         self.assertAlmostEqual(0.92349726775956287, sklearn.metrics.accuracy_score(predictions, targets))
Beispiel #22
0
 def test_default_configuration_iterative_fit(self):
     for i in range(2):
         predictions, targets = \
             _test_classifier_iterative_fit(DeepNetIterative)
         self.assertAlmostEqual(
             0.62, sklearn.metrics.accuracy_score(targets, predictions))
Beispiel #23
0
 def test_default_configuration(self):
     for i in range(10):
         predictions, targets = _test_classifier_iterative_fit(DeepNetIterative, dataset='iris')
         acc_score = sklearn.metrics.accuracy_score(y_pred=predictions, y_true=targets)
         print(acc_score)
         self.assertAlmostEqual(0.62, acc_score)