From 66ca91a12bd8dae33f204b9c55670bc99a4cce5f Mon Sep 17 00:00:00 2001 From: bwerth Date: Sun, 27 Mar 2016 23:52:15 -0400 Subject: [PATCH] Finished this toolbox --- learning_curve.py | 27 ++++++++++++++++++++++++++- questions.txt | 5 +++++ 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 questions.txt diff --git a/learning_curve.py b/learning_curve.py index 2364f2c..9e7a836 100644 --- a/learning_curve.py +++ b/learning_curve.py @@ -11,16 +11,41 @@ num_trials = 10 train_percentages = range(5,95,5) test_accuracies = numpy.zeros(len(train_percentages)) +print train_percentages + +digits = load_digits() +print digits.DESCR +fig = plt.figure() +for i in range(10): + subplot = fig.add_subplot(5,2,i+1) + subplot.matshow(numpy.reshape(digits.data[i],(8,8)),cmap='gray') + +plt.show() # train a model with training percentages between 5 and 90 (see train_percentages) and evaluate # the resultant accuracy. # You should repeat each training percentage num_trials times to smooth out variability # for consistency with the previous example use model = LogisticRegression(C=10**-10) for your learner +test_accuracies = [] +n = 0 +while n