def test_learning_curve_model_only(self):
        """
        Test learning curve with inputting model only.
        """

        try:
            visualizer = LearningCurveVisualizer(LinearSVC())
            visualizer.fit(X, y)
            visualizer.poof()
        except Exception as e:
            self.fail("error during learning curve: {}".format(e))
    def test_learning_curve_bad_trainsize(self):
        """
        Test learning curve with bad input for training size.
        """

        with self.assertRaises(YellowbrickError):
            visualizer = LearningCurveVisualizer(LinearSVC(),
                train_sizes=10000,
                cv=ShuffleSplit(n_splits=100, test_size=0.2, random_state=0))
            visualizer.fit(X, y)
            visualizer.poof()
    def test_learning_curve_model_cv_only(self):
        """
        Test learning curve with inputting model and cv only.
        """

        try:
            visualizer = LearningCurveVisualizer(LinearSVC(),
                cv=ShuffleSplit(n_splits=100, test_size=0.2, random_state=0))
            visualizer.fit(X, y)
            visualizer.poof()
        except Exception as e:
            self.fail("error during learning curve: {}".format(e))
    def test_learning_curve_comprehensive(self):
        """
        Test learning curve with all parameters with visual unit test.
        """

        try:
            visualizer = LearningCurveVisualizer(LinearSVC(random_state=0), train_sizes=np.linspace(.1, 1.0, 5),
                cv=ShuffleSplit(n_splits=100, test_size=0.2, random_state=0),
                n_jobs=4)
            visualizer.fit(X, y)
            visualizer.poof()
        except Exception as e:
            self.fail("error during learning curve: {}".format(e))

        self.assert_images_similar(visualizer)