supervised machine learning learnnoinputs py -learning ignoring all input features from learnproblem import evaluate import mathrandomcollectionsstatistics import utilities argmax for (element,valuepairs class predict(object)"""the class of prediction methods for list of values please make the doc strings the same lengthbecause they are used in tables note that we don' need self argumentas we are creating predict objectsto use call predict laplace(dataetc "" ##the following return distribution over values (for classificationdef empirical(datadomain=[ , ]icount= )"empirical dist returns distribution over values counts { :icount for in domainfor in datacounts[ + sum(counts values()return { : / for ( ,vin counts items() def bounded_empirical(datadomain=[ , ]bound= )"bounded empiricalreturn { :min(max( ,bound), -boundfor ( ,vin predict empirical(datadomainitems() def laplace(datadomain=[ , ])"laplace for categorical data return predict empirical(datadomainicount= def cmode(datadomain=[ , ])"mode for categorical data md statistics mode(datareturn { if ==md else for in domain def cmedian(datadomain=[ , ])"median for categorical data md statistics median_low(dataalways return one of the values return { if ==md else for in domain ##the following return single prediction (for regressiondomain is ignored def mean(datadomain=[ , ])"mean returns real number return statistics mean(data version june