learning with uncertainty test_errors [for in range(maxstep)self learn( train_errors appendsum(self distance(self class_of_eg(eg),egfor eg in self dataset train/len(self dataset train)if self dataset testtest_errors appendsum(self distance(self class_of_eg(eg),egfor eg in self dataset test/len(self dataset test)plt plot(range( ,maxstep+ ),train_errorslabel=str(self num_classes)+classes training set"if self dataset testplt plot(range( ,maxstep+ ),test_errorslabel=str(self num_classes)+classes test set"plt legend(plt draw( %data data_from_file('data/emdata csv'num_train= target_index= trivial example data data_from_file('data/emdata csv'num_train= target_index= %data data_from_file('data/emdata csv'num_train= target_index= example from textbook kml k_means_learner(data, num_iter= print("class assignment after",num_iter,"iterations:"kml learn(num_iter)kml show_classes( plot the error km =k_means_learner(data, )km plot_error( classes km =k_means_learner(data, )km plot_error( classes km =k_means_learner(data, )km plot_error( classes data data_from_file('data/carbool csv'target_index= ,boolean_features=truekml k_means_learner(data, kml learn( )kml show_classes(km =k_means_learner(data, )km plot_error( classes km =k_means_learner(data, )km plot_error( classes exercise change boolean features true flag to allow for numerical features -means assumes the features are numericalso we want to make non-numerical features into numerical features (using characteristic functionsbut we probably don' want to change numerical features into boolean exercise if there are many classessome of the classes can become empty ( try classes with carbool csvimplement way to put some examples into classif possible two ideas areversion june