<gh_stars>1-10
import unittest

from ParamSklearn.components.classification.lda import LDA
from ParamSklearn.util import _test_classifier

import sklearn.metrics


class LDAComponentTest(unittest.TestCase):
    def test_default_configuration_iris(self):
        for i in range(10):
            predictions, targets = \
                _test_classifier(LDA)
            self.assertAlmostEqual(1.0,
                                   sklearn.metrics.accuracy_score(predictions,
                                                                  targets))

    def test_default_configuration_digits(self):
        for i in range(10):
            predictions, targets = \
                _test_classifier(classifier=LDA, dataset='digits')
            self.assertAlmostEqual(0.88585306618093507,
                                   sklearn.metrics.accuracy_score(predictions,
                                                                  targets))
