supervised machine learning "test error:",test_errors[- ]learner learn(num_iter=stepplt plot(range( ,num_steps+ ,step),train_errors,ls='-',label=legend_label+"training"plt plot(range( ,num_steps+ ,step),test_errors,ls='--',label=legend_label+"test"plt legend(plt draw(learner display( "train error:",train_errors[- ]"test error:",test_errors[- ] if __name__ ="__main__"test( this generates the figure from learnproblem import data_set_augmented,prod_feat data data_from_file('data/spect csv'prob_test= target_index= dataplus data_set_augmented(data,[],[prod_feat]plot_steps(data=data,num_steps= plot_steps(data=dataplus,num_steps= warning very slow exercise the squashed learner only makes predictions in the range ( if the output values are { there is no use prediction less than or greater than change the squashed learner so that it can learn values in the range ( test it on the file 'data/car csvthe following plots the prediction as function of the function of the number of steps of gradient descent we first define version of range that allows for real numbers (integers and floatslearnlinear py -(continued def arange(start,stop,step)"""returns enumeration of values in the range [start,stopseparated by step like the built-in range(start,stop,stepbut allows for integers and floats note that rounding errors are expected with real numbers (or use numpy arange""while start<stopyield start start +step def plot_prediction(datalearner noneminx maxx step_size for plotting label "function")plt ion(plt xlabel(" "plt ylabel(" "if learner is noneversion june