we can try weighted averagemultiplying each prediction by given weight before summing it all up how do we find the best weights thoughwe learn them from the data of courseensemble learning we are using general technique in machine learning called ensemble learningthis is not only applicable in regression we learn an ensemble (that isa setof predictors thenwe combine them what is interesting is that we can see each prediction as being new featureand we are now just combining features based on training datawhich is what we have been doing all along note that we are doing so for regression herebut the same reasoning is applicable during classificationyou learn how to create several classifiers and master classifierwhich takes the output of all of them and gives final prediction different forms of ensemble learning differ on how you combine the base predictors in our casewe reuse the training data that learned the predictors predict predict predict weights data final prediction by having flexible way to combine multiple methodswe can simply try any idea we wish by adding it into the mix of learners and letting the system give it weight we can also use the weights to discover which ideas are goodif they get high weightthis means that it seems they are adding useful information ideas with very low weights can even be dropped for better performance the code for this is very simpleand is as followswe import the code we used in the previous examplesimport similar_movie import corrneighbors import usermodel from sklearn linear_model import linearregression es usermodel estimate_all(corrneighbors estimate_all()similar_movie estimate_all()