sure that each of the resulting domains is of equal size exercise this splits on whether the feature is less than one of the values in the training set sam suggested it might be better to split between the values in the training setand suggested using cutat (sorted frange[cutsorted frange[cut ])/ why might sam have suggested thisdoes this work better(try it on few data setsevaluating predictions predictor is function that takes an example and makes prediction on the values of the target features loss takes prediction and the actual value and returns non-negative real numberlower is better the error for dataset is either the mean lossor sometimes the sum of the losses when reporting results the mean is usually used when it is the sumthis will be made explicit the function evaluate dataset returns the average error for each examplewhere the error for each example depends on the evaluation criteria here we consider three evaluation criteriathe squared error (average of the square of the difference between the actual and predicted values)absolute errors(average of the absolute difference between the actual and predicted valuesand the log loss (the average negative log-likelihoodwhich can be interpreted as the number of bits to describe an example using code based on the prediction treated as probabilitylearnproblem py -(continued def evaluate_dataset(selfdatapredictorerror_measure)"""evaluates predictor on data according to the error_measure predictor is function that takes an example and returns prediction for the target features error_measure(prediction,actual-non-negative real ""if datatryvalue statistics mean(error_measure(predictor( )self target( )for in dataexcept valueerrorif error_measure gives an error return float("inf"infinity return value elsereturn math nan not number the following evaluation criteria are defined this is defined using classevaluate but no instances will be created just use evaluate squared_loss etc (please keep the __doc__ strings consistent length as they are used in tables version june