number of trees to build (the n_estimators parameter of randomforestregressor or randomforestclassifierlet' say we want to build trees these trees will be built completely independently from each otherand the algorithm will make different random choices for each tree to make sure the trees are distinct to build treewe first take what is called bootstrap sample of our data that isfrom our n_samples data pointswe repeatedly draw an example randomly with replacement (meaning the same sample can be picked multiple times)n_samples times this will create dataset that is as big as the original datasetbut some data points will be missing from it (approximately one third)and some will be repeated to illustratelet' say we want to create bootstrap sample of the list [' '' '' '' ' possible bootstrap sample would be [' '' '' '' 'another possible sample would be [' '' '' '' 'nexta decision tree is built based on this newly created dataset howeverthe algorithm we described for the decision tree is slightly modified instead of looking for the best test for each nodein each node the algorithm randomly selects subset of the featuresand it looks for the best possible test involving one of these features the number of features that are selected is controlled by the max_features parameter this selection of subset of features is repeated separately in each nodeso that each node in tree can make decision using different subset of the features the bootstrap sampling leads to each decision tree in the random forest being built on slightly different dataset because of the selection of features in each nodeeach split in each tree operates on different subset of features togetherthese two mechanisms ensure that all the trees in the random forest are different critical parameter in this process is max_features if we set max_features to n_fea turesthat means that each split can look at all features in the datasetand no randomness will be injected in the feature selection (the randomness due to the bootstrapping remainsthoughif we set max_features to that means that the splits have no choice at all on which feature to testand can only search over different thresholds for the feature that was selected randomly thereforea high max_fea tures means that the trees in the random forest will be quite similarand they will be able to fit the data easilyusing the most distinctive features low max_features means that the trees in the random forest will be quite differentand that each tree might need to be very deep in order to fit the data well to make prediction using the random forestthe algorithm first makes prediction for every tree in the forest for regressionwe can average these results to get our final prediction for classificationa "soft votingstrategy is used this means each algorithm makes "softpredictionproviding probability for each possible output supervised learning