From 9f26ed2b09e7b3108e1f7e16e8749e7fddc0423f Mon Sep 17 00:00:00 2001 From: Chris Endemann Date: Thu, 5 Dec 2024 13:33:01 -0600 Subject: [PATCH] add random_state for fitting random forest --- _episodes/04-ensemble-methods.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_episodes/04-ensemble-methods.md b/_episodes/04-ensemble-methods.md index 10631aa..d1ef2c0 100644 --- a/_episodes/04-ensemble-methods.md +++ b/_episodes/04-ensemble-methods.md @@ -114,7 +114,7 @@ from sklearn.tree import plot_tree # Define our model # extra parameter called n_estimators which is number of trees in the forest # a leaf is a class label at the end of the decision tree -forest = RandomForestClassifier(n_estimators=100, max_depth=7, min_samples_leaf=1) +forest = RandomForestClassifier(n_estimators=100, max_depth=7, min_samples_leaf=1, random_state=5) # train our model forest.fit(X_train, y_train)