@@ -0,0 +1,1799 @@
+#!/usr/bin/python%0A%0A#from udacityplots import *%0Aimport warnings%0Awarnings.filterwarnings(%22ignore%22)%0A%0Aimport matplotlib %0Amatplotlib.use('agg')%0A%0Aimport matplotlib.pyplot as plt%0Aimport pylab as pl%0Aimport numpy as np%0A%0A#import numpy as np%0A#import matplotlib.pyplot as plt%0A#plt.ioff()%0A%0Adef prettyPicture(clf, X_test, y_test):%0A    x_min = 0.0; x_max = 1.0%0A    y_min = 0.0; y_max = 1.0%0A%0A    # Plot the decision boundary. For that, we will assign a color to each%0A    # point in the mesh %5Bx_min, m_max%5Dx%5By_min, y_max%5D.%0A    h = .01  # step size in the mesh%0A    xx, yy = np.meshgrid(np.arange(x_min, x_max, h), np.arange(y_min, y_max, h))%0A    Z = clf.predict(np.c_%5Bxx.ravel(), yy.ravel()%5D)%0A%0A    # Put the result into a color plot%0A    Z = Z.reshape(xx.shape)%0A    plt.xlim(xx.min(), xx.max())%0A    plt.ylim(yy.min(), yy.max())%0A%0A    plt.pcolormesh(xx, yy, Z, cmap=pl.cm.seismic)%0A%0A    # Plot also the test points%0A    grade_sig = %5BX_test%5Bii%5D%5B0%5D for ii in range(0, len(X_test)) if y_test%5Bii%5D==0%5D%0A    bumpy_sig = %5BX_test%5Bii%5D%5B1%5D for ii in range(0, len(X_test)) if y_test%5Bii%5D==0%5D%0A    grade_bkg = %5BX_test%5Bii%5D%5B0%5D for ii in range(0, len(X_test)) if y_test%5Bii%5D==1%5D%0A    bumpy_bkg = %5BX_test%5Bii%5D%5B1%5D for ii in range(0, len(X_test)) if y_test%5Bii%5D==1%5D%0A%0A    plt.scatter(grade_sig, bumpy_sig, color = %22b%22, label=%22fast%22)%0A    plt.scatter(grade_bkg, bumpy_bkg, color = %22r%22, label=%22slow%22)%0A    plt.legend()%0A    plt.xlabel(%22bumpiness%22)%0A    plt.ylabel(%22grade%22)%0A%0A    plt.savefig(%22test.png%22)%0A    %0Aimport base64%0Aimport json%0Aimport subprocess%0A%0Adef output_image(name, format, bytes):%0A    image_start = %22BEGIN_IMAGE_f9825uweof8jw9fj4r8%22%0A    image_end = %22END_IMAGE_0238jfw08fjsiufhw8frs%22%0A    data = %7B%7D%0A    data%5B'name'%5D = name%0A    data%5B'format'%5D = format%0A    data%5B'bytes'%5D = base64.encodestring(bytes)%0A    print image_start+json.dumps(data)+image_end%0A

Create class_vis.py