Random Forest


Work with your assigned partner to write a series of Python scripts to fit Random Forest classifier.


Raisins

Fit both a single decision tree and a random forest to this raisin data set.

  1. How many features does the data set have?
  2. Try different hyperparameter settings?
  3. What is the F1 score for both models?
  4. Which model worked better and by how much?


Spam

Again fit both a decision tree and a random forest to this spam email data set. Try different hyperparameter settings. How did the tree and forest perform on this data set relative to the Raisins data set? What are the 3 more important features according to the feature importance metric?



This page was last modified on 2026-08-19 at 20:15:10.

Copyright © 2018–2026 George Fox University. All rights reserved.