How does a Random Forest actually arrive at a prediction?
This project explores the logic behind a Random Forest classifier using the UCI Mushroom dataset. Instead of treating the model as a black box, I extracted individual decision trees, decision paths and voting behavior and translated them into an interactive Tableau visualization.
The visualization allows users to follow mushrooms through individual trees and see how multiple tree predictions combine into a final classification.
Explore the interactive visualization on Tableau Public →
The project combines Python and Tableau:
- Python / scikit-learn for data preparation and Random Forest modelling
- Extraction of individual tree structures and decision paths
- Analysis of how individual trees vote on a prediction
- Export of model logic into a structure that can be visualized in Tableau
- Tableau for the interactive visual explanation
Machine learning models can produce highly accurate predictions while remaining difficult to understand.
I wanted to explore how visualization can make the mechanics behind an ensemble model more tangible, turning abstract model logic into something users can interact with and explore.
Python · pandas · scikit-learn · Matplotlib · Tableau
random_forest_explainer.ipynb— machine learning and data preparationrandom_forest_explainer.twbx— Tableau workbookrandom_forest_9_trees_with_logic.csv— tree structures and node logic for Tableaumushroom_decision_paths.csv— decision paths for selected mushroomsmushrooms.csv— source dataset
🏆 Tableau Public Viz of the Day
