Jed Rembold
April 1, 2025
You can construct your own arbitrary ensembles
In Python:
combo = VotingClassifier(
[
('logreg',log_mod), # first model
('dec_tree',tree) # second model
],
voting='soft')
combo.fit(training_df[['x','y']])I haven’t yet found an equivalent in R, but I’d imagine it is out there

random_state won’t always
generate a very different model
BaggingClassifierbaguette library

In Python, random forest models come from the Scikit-learn
ensemble module
from sklearn.ensemble import RandomForestClassifier
forest = RandomForestClassifier()In R, they are one of Parsnips available models
forest <- rand_forest(mode="classification")Fitting, computing confusion matrices, visualizing classification boundaries, etc. proceed exactly as they have for other models
n_estimators (default=100)max_features
max_depth,
max_leaf_nodes, etc.trees (default=100)mtry
min_n is the minimum number of points
still in a node to be split furtherwarm_start option lets you
resume from last training point