In [12]:
import sys
sys.path.append("../..")
import numpy as np
from sklearn.naive_bayes import GaussianNB
from sklearn.svm import SVC
from sklearn.datasets import load_digits
from sklearn.model_selection import ShuffleSplit
In [2]:
digits = load_digits()
X, y = digits.data, digits.target
In [3]:
# Set the train sizes
train_sizes = np.linspace(.1, 1.0, 10)
In [4]:
from yellowbrick.classifier.learning_curve import LearningCurveVisualizer
In [5]:
viz = LearningCurveVisualizer(GaussianNB())
viz.fit(X,y)
viz.show()
In [10]:
viz = LearningCurveVisualizer(GaussianNB(), train_sizes=np.linspace(.1, 1.0, 15))
viz.fit(X,y)
viz.show()
In [14]:
viz = LearningCurveVisualizer(GaussianNB(),
train_sizes=np.linspace(.1, 1.0, 15),
cv = ShuffleSplit(n_splits=100, test_size=0.2, random_state=0))
viz.fit(X,y)
viz.show()
In [20]:
viz = LearningCurveVisualizer(SVC(kernel='linear'),
train_sizes=np.linspace(0.1, 1.0, 5),
cv = ShuffleSplit(n_splits=100, test_size=0.2, random_state=0))
viz.fit(X,y)
viz.show()
In [ ]: