test data the following code does this for the data shown in figure using support vector machine classifier from sklearn import svm clf svm svckernel 'rbf 'clf fitx_train y_train y_prediction clf predict x_test from sklearn metrics import confusion_matrix print confusion_matrix y_test y_prediction )[[ ] system callsurl accessand speed-up operating system commands (whether in windowsmacosor linuxfor creating directoriescopying or removing filesor executing programs from the system shell can be issued from within python by using the package os another useful package is requests which enables direct downloads of files and webpages from urls the following python script uses both it also illustrates simple example of exception handling in python misc py import os import requests for in "tryos mkdir (mydir "cexcept pass if it does not yet exist make directory otherwise do nothing uname https :/github com/dsml -bookprograms /treemaster appendices python primer /fname ataleof cities txtr requests getuname fname print ( textopen('mydir ato txt ''wb 'write ( content write to file bytes mode is important here the package numba can significantly speed up calculations via smart compilation first run the following code jitex py import timeit import numpy as np from numba import jit ** #@jit def myfun ( , )for in range ( , )