array[:, nextgive the input for -fold cross validation as followsseed kfold kfold(n_splits= random_state=seedwe need to provide the number of trees we are going to build here we are building trees with split points chosen from featuresnum_trees max_features nextbuild the model with the help of following scriptmodel extratreesclassifier(n_estimators=num_treesmax_features=max_featurescalculate and print the result as followsresults cross_val_score(modelxycv=kfoldprint(results mean()output the output above shows that we got around accuracy of our bagged extra trees classifier model boosting ensemble algorithms the followings are the two most common boosting ensemble algorithmsadaboost it is one the most successful boosting ensemble algorithm the main key of this algorithm is in the way they give weights to the instances in dataset due to this the algorithm needs to pay less attention to the instances while constructing subsequent models in the following python recipewe are going to build ada boost ensemble model for classification by using adaboostclassifier class of sklearn on pima indians diabetes dataset firstimport the required packages as followsfrom pandas import read_csv from sklearn model_selection import kfold from sklearn model_selection import cross_val_score from sklearn ensemble import adaboostclassifier