nowwe need to load the pima diabetes dataset as did in previous examplespath " :\pima-indians-diabetes csvheadernames ['preg''plas''pres''skin''test''mass''pedi''age''class'data read_csv(pathnames=headernamesarray data values array[:, : 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 nextbuild the model with the help of following scriptmodel adaboostclassifier(n_estimators=num_treesrandom_state=seedcalculate 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 adaboost classifier ensemble model stochastic gradient boosting it is also called gradient boosting machines in the following python recipewe are going to build stochastic gradient boostingensemble model for classification by using gradientboostingclassifier 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