@@ -0,0 +1,974 @@
+# View more python learning tutorial on my Youtube and Youku channel!!!%0A%0A# Youtube video tutorial: https://www.youtube.com/channel/UCdyjiB5H8Pu7aDTNVXTTpcg%0A# Youku video tutorial: http://i.youku.com/pythontutorial%0A%0Afrom sklearn.learning_curve import  learning_curve%0Afrom sklearn.datasets import load_digits%0Afrom sklearn.svm import SVC%0Aimport matplotlib.pyplot as plt%0Aimport numpy as np%0A%0Adigits = load_digits()%0AX = digits.data%0Ay = digits.target%0Atrain_sizes, train_loss, test_loss= learning_curve(%0A        SVC(gamma=0.01), X, y, cv=10, scoring='mean_squared_error',%0A        train_sizes=%5B0.1, 0.25, 0.5, 0.75, 1%5D)%0Atrain_loss_mean = -np.mean(train_loss, axis=1)%0Atest_loss_mean = -np.mean(test_loss, axis=1)%0A%0Aplt.plot(train_sizes, train_loss_mean, 'o-', color=%22r%22,%0A             label=%22Training%22)%0Aplt.plot(train_sizes, test_loss_mean, 'o-', color=%22g%22,%0A             label=%22Cross-validation%22)%0A%0Aplt.xlabel(%22Training examples%22)%0Aplt.ylabel(%22Loss%22)%0Aplt.legend(loc=%22best%22)%0Aplt.show()%0A%0A%0A%0A

create sk9