from learnlinear import plot_steps from learnproblem import data_from_file data data_from_file('data/holiday csv'target_index=- learner linear_learner_bsgd(dataplot_steps(learner learnerdata=data to plot polynomials with batching (compare to sgdfrom learnlinear import plot_polynomials plot_polynomials(datalearner_class linear_learner_bsgd boosting the following code implements functional gradient boosting for regression boosted dataset is created from base dataset by subtracting the prediction of the offset function from each example this does not save the new datasetbut generates it as needed the amount of space used is constantindependent on the size of the data set learnboosting py -functional gradient boosting from learnproblem import data_setlearnerevaluate from learnnoinputs import predict from learnlinear import sigmoid import statistics import random class boosted_dataset(data_set)def __init__(selfbase_datasetoffset_funsubsample= )"""new dataset which is like base_datasetbut offset_fun(eis subtracted from the target of each example ""self base_dataset base_dataset self offset_fun offset_fun self train random sample(base_dataset train,int(subsample*len(base_dataset train))self test base_dataset test #data_set __init__(selfbase_dataset trainbase_dataset testbase_dataset prob_testbase_dataset target_index #def create_features(self)"""creates new features called at end of data_set init(defines new target ""self input_features self base_dataset input_features def newout( )return self base_dataset target(eself offset_fun(enewout frange self base_dataset target frange newout ftype self infer_type(newout frangeself target newout version june