Train Your First ML Model

Train a Decision Tree to classify iris flowers by species.

Introduction

30 Second Summary

Every time you sort laundry by color or identify a bird by its markings, you're classifying things based on their features. Machine learning does the same thing, but at scale and with mathematical precision.

In this project, you will train a Decision Tree model to classify iris flowers into three species based on their physical measurements. You'll experience the complete supervised learning workflow: loading data, training a model, measuring its accuracy, and making predictions.

What You'll Build

A Python-based machine learning classifier that learns to identify iris flower species from their petal and sepal measurements.

By the end of this project, you'll have:

  • A trained Decision Tree model that predicts iris species with over 90% accuracy.
  • A text and graphical visualization showing exactly how your model decides which species a flower is.
  • A prediction function that takes flower measurements and outputs a species name.
  • Secret Mission: Train a Random Forest and compare its accuracy against your Decision Tree to see how ensemble methods improve performance.

Are there any prerequisites?

None. This project includes setup for all required tools. You'll install everything you need in Step 1.

Before We Start

Before We Start...

Set Up Your Python Environment

Before training a machine learning model, you need a clean workspace with the right tools installed.

In this step, you'll create a project folder, set up an isolated Python environment, and install the two libraries your classifier needs: scikit-learn for machine learning and matplotlib for visualization.

In this step, get ready to:
  • Create a project folder and open it in VS Code.
  • Set up and activate a Python virtual environment.
  • Install scikit-learn and matplotlib.
Create your project folder and open it in VS Code
  • Press Cmd+Space (macOS) or the Windows key (Windows) to open your search bar.
  • Type Visual Studio Code and press Enter to open it.
  • Open a terminal inside VS Code by pressing Ctrl+` (that's the backtick key, above Tab on your keyboard).
  • Move to your Desktop by running this command:
cd ~/Desktop
  • Create your project folder and move into it by running these commands:
mkdir iris-classifier
cd iris-classifier
  • Confirm the folder was created by running:
pwd

You should see a path ending in iris-classifier (for example, /Users/yourname/Desktop/iris-classifier).

  • Now open this folder as your VS Code workspace. Click File in the top menu bar.
  • Click Open Folder.
  • Navigate to your Desktop, select the iris-classifier folder, and click Open.
  • Open a fresh terminal by pressing Ctrl+` again.

Your terminal should now show iris-classifier as the working directory. All commands from here on happen in this terminal.

Don't see iris-classifier in your terminal path?

Make sure you selected the correct folder when you clicked Open Folder. The folder name in the VS Code Explorer sidebar (left panel) should say iris-classifier.

If the terminal still shows a different path, close it and open a new one with Ctrl+`.

Having trouble?

Create a virtual environment and activate it

A virtual environment is an isolated space where Python installs packages just for this project. It keeps your system Python clean and prevents conflicts between projects.

  • Create a virtual environment by running this command:

macOS

python3 -m venv venv

Windows

python -m venv venv

What does this command do?

python -m venv venv tells Python to create a virtual environment in a folder called venv. This folder contains its own copy of Python and a place to install packages without affecting your system.

This may take a few seconds. Once it finishes, you need to activate the environment so your terminal uses it.

  • Activate the virtual environment by running:

macOS

source venv/bin/activate

Windows

venv\Scripts\activate

You should see (venv) appear at the beginning of your terminal prompt. This confirms the virtual environment is active.

Don't see (venv) in your prompt?

On Windows, if you see an error about execution policies, run Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned and then try the activation command again.

On macOS, make sure you typed source before the path. Without it, the command won't activate the environment.

Help me activate my virtual environment.

Install scikit-learn and matplotlib

With your virtual environment active, you can now install the packages your project needs.

  • Install both libraries by running this command:
pip install scikit-learn==1.8.0 matplotlib==3.10.9

What does this command do?

  • pip install downloads and installs Python packages from the internet.
  • scikit-learn==1.8.0 installs the machine learning library at a specific version so your results match this guide.
  • matplotlib==3.10.9 installs the plotting library you'll use to visualize your decision tree.

This may take a minute or two as pip downloads scikit-learn and its dependencies (like NumPy and SciPy).

  • Verify the installation worked by running:
python -c "import sklearn; print(sklearn.__version__)"

You should see 1.8.0 printed in your terminal. This confirms scikit-learn is installed and ready to use.

Seeing an error during install?

Make sure you see (venv) in your terminal prompt. If it's missing, the virtual environment is not active and pip will try to install to your system Python.

If you see a network error, check your internet connection and try the pip install command again.

Help me fix my pip install error.

Your environment is ready. Next up, you'll load real flower data and start exploring what your model will learn from.

Load and Explore the Iris Dataset

Your Python environment is ready with all the packages you need. Every machine learning project starts by loading and understanding the data you'll train your model on.

In this step, you'll load the famous Iris dataset, which contains measurements from 150 iris flowers across three species. You'll explore its structure to see exactly what your model will learn from.

In this step, get ready to:
  • Load the Iris dataset into Python.
  • Print feature names, target names, and dataset shape.
  • Map numeric labels to actual species names.
Create your script and load the dataset

Before you can train a model, you need data. The Iris dataset is bundled directly inside scikit-learn, so there's nothing to download.

  • In the VS Code Explorer sidebar, hover over your project folder name to reveal the action icons.
  • Click the New File icon (the file with a plus sign).
  • Type iris_classifier.py and press Enter.
  • Add this code to iris_classifier.py to import the libraries and load the dataset:
from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split
from sklearn.tree import DecisionTreeClassifier, export_text, plot_tree
from sklearn.metrics import accuracy_score
import matplotlib.pyplot as plt

# Step 2: Load and explore the dataset
iris = load_iris()
X = iris.data
y = iris.target

print("=== Iris Dataset ===")
print(f"Feature names: {iris.feature_names}")
print(f"Target names: {iris.target_names}")
print(f"Dataset shape: {X.shape} (samples, features)")

What does this code do?

The imports at the top bring in everything you'll need for the full project. You won't use all of them yet, but having them ready avoids interrupting your flow later.

  • load_iris() fetches the dataset from scikit-learn's built-in collection. No internet connection or file download required.
  • X = iris.data stores the 150 rows of flower measurements (the "features" the model learns from).
  • y = iris.target stores the species label for each flower as a number (0, 1, or 2).
  • The print statements reveal the dataset's structure: what features exist, what species are included, and how many samples you have.
  • Save iris_classifier.py by pressing Ctrl+S (Windows) or Cmd+S (macOS).

You won't see any output yet. The next chunk adds sample exploration, then you'll run everything together.

Explore individual samples

Numeric labels like 0, 1, and 2 don't tell you much on their own. Mapping them to actual species names (setosa, versicolor, virginica) makes the data human-readable.

  • At the bottom of iris_classifier.py, add this code to print the first 5 flower samples with their species names:
print(f"\nFirst 5 samples:")
for i in range(5):
    print(f"  {X[i]} -> {iris.target_names[y[i]]}")

What does this code do?

This loop prints the first 5 rows of raw measurements alongside their species name. Each row is an array of four numbers (sepal length, sepal width, petal length, petal width).

The expression iris.target_names[y[i]] converts the numeric label (like 0) into the readable species name (like "setosa"). This is how your model's predictions will be interpreted later.

  • Save iris_classifier.py.

✔️ Awesome, I've got everything!

Great. Double check you've saved your file, then move on to run it.

ⓧ I'd like to double check the full code

from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split
from sklearn.tree import DecisionTreeClassifier, export_text, plot_tree
from sklearn.metrics import accuracy_score
import matplotlib.pyplot as plt

# Step 2: Load and explore the dataset
iris = load_iris()
X = iris.data
y = iris.target

print("=== Iris Dataset ===")
print(f"Feature names: {iris.feature_names}")
print(f"Target names: {iris.target_names}")
print(f"Dataset shape: {X.shape} (samples, features)")
print(f"\nFirst 5 samples:")
for i in range(5):
    print(f"  {X[i]} -> {iris.target_names[y[i]]}")
Run your script and observe the output

With both code chunks saved, you can now run the script and see the dataset come to life in your terminal.

  • Run your script by executing this command in the terminal:
python iris_classifier.py

You should see output showing the feature names (sepal length, sepal width, petal length, petal width), the three target species names, the dataset shape of (150, 4), and the first 5 samples with their species labels.

What do these numbers mean?

The shape (150, 4) tells you that you have 150 flowers, each described by 4 measurements. These measurements are what the model uses to distinguish between species.

Notice in the first 5 samples that setosa flowers tend to have smaller petal measurements. Your Decision Tree model will discover these patterns automatically in the next step.

Seeing a ModuleNotFoundError?

This means scikit-learn or matplotlib isn't installed in your current environment. Make sure your virtual environment is activated. You should see (venv) at the start of your terminal prompt.

  • If you don't see (venv), activate it again by running venv\Scripts\activate (Windows) or source venv/bin/activate (macOS/Linux).
  • Then re-run python iris_classifier.py.

Why is my script throwing a ModuleNotFoundError for sklearn?

You now have a clear picture of your data: 150 flowers, 4 measurements each, 3 species to classify. Next up, you'll split this data and train your first model.

Split Data and Train Your Model

In Step 2, you loaded the Iris dataset and explored its structure. You now know you have 150 flower samples described by 4 measurements.

Now it's time to teach your model to recognize patterns in that data. You'll split the dataset so your model trains on one portion and gets tested on a completely separate portion it's never seen before.

In this step, get ready to:
  • Split your data into training and test sets.
  • Train a Decision Tree classifier on the training data.
  • Measure your model's accuracy on unseen test data.
Split the dataset into training and test sets

If you test a model on the same data it was trained on, you'll never know if it truly learned patterns or just memorized the answers. Holding back a portion of data for testing reveals how well the model generalizes to new flowers.

  • In iris_classifier.py, find the last line of your exploration code:
    print(f"  {X[i]} -> {iris.target_names[y[i]]}")
  • Add the following code below it to split your dataset into training and test portions:
# Step 3: Split data and train the model
X_train, X_test, y_train, y_test = train_test_split(
    X, y, test_size=0.3, random_state=42
)
print(f"\nTraining samples: {len(X_train)}")
print(f"Test samples: {len(X_test)}")

What does this code do?

  • train_test_split randomly shuffles the data and splits it into two groups: 70% for training and 30% for testing.
  • test_size=0.3 means 30% of the 150 samples (45 flowers) are set aside for testing.
  • random_state=42 locks the shuffle order so you get the same split every time you run the script. This makes results reproducible.
  • The result is four variables: X_train (training features), X_test (test features), y_train (training labels), and y_test (test labels).

What is a training/test split?

Think of it like studying for an exam. The training set is your study material. The test set is the actual exam. If you peeked at the exam questions while studying, you'd score perfectly but learn nothing.

By hiding 30% of the data from your model during training, you get an honest measure of whether it can classify flowers it hasn't seen before.

  • Save iris_classifier.py.
Train your Decision Tree and make predictions

With your data split, you can now train a model on the training portion and ask it to predict species for the test portion.

  • Add the following code below the print(f"Test samples: {len(X_test)}") line to create, train, and evaluate your model:
clf = DecisionTreeClassifier(random_state=42)
clf.fit(X_train, y_train)

predictions = clf.predict(X_test)
accuracy = accuracy_score(y_test, predictions)
print(f"\nModel Accuracy: {accuracy:.2%}")

What does this code do?

  • DecisionTreeClassifier(random_state=42) creates a blank Decision Tree model. It doesn't know anything yet.
  • clf.fit(X_train, y_train) is where the actual learning happens. The model finds rules that map flower measurements to species labels.
  • clf.predict(X_test) asks the trained model to classify each of the 45 test flowers based on what it learned.
  • accuracy_score(y_test, predictions) compares the model's predictions to the real answers and calculates what percentage it got right.

What is a Decision Tree?

A Decision Tree is a model that learns a series of yes/no questions about the data. For example: "Is petal width less than 0.8 cm? If yes, it's setosa." It builds a tree of these questions during training.

You'll visualize this exact tree structure in the next step to see how your model makes its decisions.

  • Save iris_classifier.py.
Run the script and check your accuracy
  • Run your script to see how well your model performs:
python iris_classifier.py

At the bottom of your output, you should see the training/test split counts and your model's accuracy percentage. Expect accuracy above 90%.

What should I see?

Your output will show 105 training samples and 45 test samples. The Model Accuracy line shows what percentage of the 45 test flowers your model classified correctly.

An accuracy above 90% means the model learned real patterns from the training data and can generalize to flowers it never studied.

Seeing an error when running the script?

  • If you see NameError: name 'X_train' is not defined, make sure the train_test_split code comes before the classifier code in your file.
  • If you see IndentationError, check that the new code is not indented inside the for loop above it. It should start at the leftmost column.
  • Make sure your virtual environment is still active. You should see (venv) at the start of your terminal prompt.

Still stuck? Help me debug my iris_classifier.py script

✔️ Awesome, I've got everything!

Great. Double check you've saved your file before moving on.

ⓧ I'd like to double check the full code

Here's the complete iris_classifier.py up to this point:

from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split
from sklearn.tree import DecisionTreeClassifier, export_text, plot_tree
from sklearn.metrics import accuracy_score
import matplotlib.pyplot as plt

# Step 2: Load and explore the dataset
iris = load_iris()
X = iris.data
y = iris.target

print("=== Iris Dataset ===")
print(f"Feature names: {iris.feature_names}")
print(f"Target names: {iris.target_names}")
print(f"Dataset shape: {X.shape} (samples, features)")
print(f"\nFirst 5 samples:")
for i in range(5):
    print(f"  {X[i]} -> {iris.target_names[y[i]]}")

# Step 3: Split data and train the model
X_train, X_test, y_train, y_test = train_test_split(
    X, y, test_size=0.3, random_state=42
)
print(f"\nTraining samples: {len(X_train)}")
print(f"Test samples: {len(X_test)}")

clf = DecisionTreeClassifier(random_state=42)
clf.fit(X_train, y_train)

predictions = clf.predict(X_test)
accuracy = accuracy_score(y_test, predictions)
print(f"\nModel Accuracy: {accuracy:.2%}")

Your model is trained and you know its accuracy. Next up, you'll visualize the actual decision rules your tree learned and build a function that predicts species for any new flower.

Visualize and Interpret Your Model

Your model is trained and you know its accuracy score. But a number alone doesn't tell you how the model makes its decisions.

In this step, you'll peek inside the Decision Tree to see the exact rules it learned. Then you'll build a prediction function so you can classify any new flower on demand.

In this step, get ready to:
  • Print the decision rules your model learned from the training data.
  • Generate a graphical decision tree visualization and save it as an image.
  • Build a prediction function that classifies new flower measurements.
Print the decision tree rules

A trained Decision Tree stores a series of if/else rules based on feature thresholds. You can print these rules as text to see exactly which measurements the model checks at each split.

  • In iris_classifier.py, find the last line of your file:
print(f"\nModel Accuracy: {accuracy:.2%}")
  • Add the following code below that line to print the tree's decision rules:
# Step 4: Visualize the decision tree
print("\n=== Decision Tree Rules ===")
tree_rules = export_text(clf, feature_names=iris.feature_names)
print(tree_rules)

What does this code do?

  • export_text(clf, feature_names=iris.feature_names) converts the trained tree into human-readable if/else rules.
  • Passing feature_names means the output shows real names like "petal width" instead of generic "feature_3".
  • tree_rules holds the full text so you can print or save it.
  • Save iris_classifier.py and run it:
python iris_classifier.py

You should see a set of indented rules starting with conditions like |--- petal width (cm) <= 0.80 followed by class labels at the leaf nodes.

How to read the tree rules

Each line starting with |--- is a decision point. The model checks whether a measurement is above or below a threshold. When the indentation stops at a class: line, that's the model's final prediction for flowers that match all the conditions above it.

Not seeing any tree rules?

  • Make sure the new code appears below the accuracy print line, not above it.
  • Check that export_text is in your import line at the top: from sklearn.tree import DecisionTreeClassifier, export_text, plot_tree.

Why aren't my decision tree rules printing?

Plot a graphical decision tree

Text rules work, but a visual tree is easier to follow. You'll use matplotlib to render the tree as a coloured diagram and save it as an image file.

  • In iris_classifier.py, add the following code below the print(tree_rules) line:
# Plot the tree
plt.figure(figsize=(16, 10))
plot_tree(
    clf,
    max_depth=3,
    filled=True,
    feature_names=iris.feature_names,
    class_names=list(iris.target_names),
    rounded=True,
    fontsize=10,
)
plt.title("Iris Decision Tree Classifier")
plt.tight_layout()
plt.savefig("decision_tree.png", dpi=150)
plt.show()
print("\nDecision tree visualization saved as 'decision_tree.png'")

What does this code do?

  • plt.figure(figsize=(16, 10)) creates a large canvas so the tree nodes don't overlap.
  • plot_tree draws the trained tree. filled=True colours each node by its majority class, making patterns easy to spot.
  • max_depth=3 limits how many levels are drawn so the diagram stays readable.
  • plt.savefig("decision_tree.png", dpi=150) saves the image to your project folder before plt.show() opens the interactive window.
  • Save iris_classifier.py and run it:
python iris_classifier.py

A window pops open showing a colour-coded tree diagram. Close the window to let the script continue.

Why do I need to close the window?

When you run a Python script, plt.show() blocks execution until all figure windows are closed. The rest of your script (the prediction function) runs after you close the plot window.

  • Confirm the saved image by running:
ls

You should see decision_tree.png listed alongside iris_classifier.py in the output.

No plot window appearing?

  • Make sure import matplotlib.pyplot as plt is at the top of your file.
  • If you're on a remote server or headless environment, the plot window won't appear. The image is still saved as decision_tree.png and you can open it from your file explorer.

Why isn't my matplotlib plot window showing up?

Build a prediction function

Your model can classify any flower, not just the test set. A reusable function makes it easy to feed in new measurements and get a species name back.

  • In iris_classifier.py, add the following code at the very bottom of the file (below the "saved as" print line):
# Prediction function
def predict_flower(sepal_length, sepal_width, petal_length, petal_width):
    measurements = [[sepal_length, sepal_width, petal_length, petal_width]]
    prediction = clf.predict(measurements)
    species = iris.target_names[prediction[0]]
    print(f"\nMeasurements: sepal_length={sepal_length}, sepal_width={sepal_width}, "
          f"petal_length={petal_length}, petal_width={petal_width}")
    print(f"Predicted species: {species}")
    return species


# Test predictions
print("\n=== Making Predictions ===")
predict_flower(5.1, 3.5, 1.4, 0.2)
predict_flower(6.7, 3.0, 5.2, 2.3)
predict_flower(5.9, 2.8, 4.0, 1.3)

What does this code do?

  • predict_flower accepts four flower measurements (sepal length, sepal width, petal length, petal width).
  • It wraps them in a nested list because scikit-learn expects a 2D array (one row per sample).
  • clf.predict(measurements) returns a numeric label (0, 1, or 2). The function maps that back to a species name using iris.target_names.
  • The three test calls cover one flower from each species so you can verify all three classification paths work.
  • Save iris_classifier.py and run it:
python iris_classifier.py

After the tree visualization window appears and you close it, you should see three predictions printed: setosa, virginica, and versicolor.

Seeing an error about predict?

  • If you see a ValueError, make sure the measurements are wrapped in double brackets: [[sepal_length, sepal_width, petal_length, petal_width]]. The outer list represents "a batch of samples" even when you only have one.
  • Check that predict_flower is defined after the model training code. The function uses clf and iris, which must already exist.

Why is my predict_flower function raising an error?

✔️ Awesome, I've got everything!

Great. Double check you've saved iris_classifier.py and that decision_tree.png exists in your project folder.

ⓧ I'd like to double check the full code

from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split
from sklearn.tree import DecisionTreeClassifier, export_text, plot_tree
from sklearn.metrics import accuracy_score
import matplotlib.pyplot as plt

# Step 2: Load and explore the dataset
iris = load_iris()
X = iris.data
y = iris.target

print("=== Iris Dataset ===")
print(f"Feature names: {iris.feature_names}")
print(f"Target names: {iris.target_names}")
print(f"Dataset shape: {X.shape} (samples, features)")
print(f"\nFirst 5 samples:")
for i in range(5):
    print(f"  {X[i]} -> {iris.target_names[y[i]]}")

# Step 3: Split data and train the model
X_train, X_test, y_train, y_test = train_test_split(
    X, y, test_size=0.3, random_state=42
)
print(f"\nTraining samples: {len(X_train)}")
print(f"Test samples: {len(X_test)}")

clf = DecisionTreeClassifier(random_state=42)
clf.fit(X_train, y_train)

predictions = clf.predict(X_test)
accuracy = accuracy_score(y_test, predictions)
print(f"\nModel Accuracy: {accuracy:.2%}")

# Step 4: Visualize the decision tree
print("\n=== Decision Tree Rules ===")
tree_rules = export_text(clf, feature_names=iris.feature_names)
print(tree_rules)

# Plot the tree
plt.figure(figsize=(16, 10))
plot_tree(
    clf,
    max_depth=3,
    filled=True,
    feature_names=iris.feature_names,
    class_names=list(iris.target_names),
    rounded=True,
    fontsize=10,
)
plt.title("Iris Decision Tree Classifier")
plt.tight_layout()
plt.savefig("decision_tree.png", dpi=150)
plt.show()
print("\nDecision tree visualization saved as 'decision_tree.png'")


# Prediction function
def predict_flower(sepal_length, sepal_width, petal_length, petal_width):
    measurements = [[sepal_length, sepal_width, petal_length, petal_width]]
    prediction = clf.predict(measurements)
    species = iris.target_names[prediction[0]]
    print(f"\nMeasurements: sepal_length={sepal_length}, sepal_width={sepal_width}, "
          f"petal_length={petal_length}, petal_width={petal_width}")
    print(f"Predicted species: {species}")
    return species


# Test predictions
print("\n=== Making Predictions ===")
predict_flower(5.1, 3.5, 1.4, 0.2)
predict_flower(6.7, 3.0, 5.2, 2.3)
predict_flower(5.9, 2.8, 4.0, 1.3)

You now have a complete ML pipeline: data loading, training, evaluation, visualization, and prediction. Your model can classify any iris flower from its measurements, and you can see exactly why it makes each decision.

Secret mission

Compare with a Random Forest

Your Decision Tree works well, but what if you could combine 100 trees together? Train a Random Forest and pit it against your single tree to see how ensemble methods boost performance.

Clean Up Your Resources

Clean Up Your Resources

This project runs entirely locally on your machine, so there are no ongoing costs or cloud resources to worry about.

Decide whether to keep your project files for future experimentation, pause by deactivating the virtual environment, or delete everything entirely.

Resources you used:

  • Project folder containing iris_classifier.py, decision_tree.png, and the venv directory.
  • Python packages (scikit-learn, matplotlib) installed inside the virtual environment.

Keep everything running

No action needed. Choose this if you want to keep experimenting with your classifier, trying different parameters, or adding new features.

  • Your project folder stays on your Desktop with all files intact.
  • Next time you want to work on it, open the folder in VS Code, open the terminal, and activate the virtual environment again with:
venv\Scripts\activate

Your packages will still be installed and ready to use.

Pause - I'll come back to this later

Deactivate the virtual environment to free up your terminal session. Your files and installed packages stay on disk for later.

  • Deactivate the virtual environment by running:
deactivate

Your project folder and all installed packages remain intact. Reactivate the environment when you return.

Delete - I don't want to use this again

Remove all project files, the virtual environment, and installed packages. This frees up disk space completely.

  • Deactivate the virtual environment first by running:
deactivate
  • Navigate to your Desktop by running:
cd ~/Desktop
  • Delete the project folder by running this command (macOS/Linux):
rm -rf [[PROJECT_FOLDER="your project folder name"]]
  • On Windows, use this command instead:
rmdir /s /q [[PROJECT_FOLDER="your project folder name"]]

This removes iris_classifier.py, decision_tree.png, the venv directory, and all installed packages within it.

Nice Work!

Nice Work!

You just trained your first machine learning model. You built a complete ML pipeline that loads real data, trains a classifier, evaluates its performance, and makes predictions on new flowers.

Here's what you accomplished:

  • Loaded and explored the Iris dataset (150 samples with 4 features across 3 species), then split it into training and test sets to measure real-world performance.
  • Trained a Decision Tree classifier and evaluated its accuracy on unseen data, learning the core supervised learning workflow of fit, predict, and score.
  • Visualized your model's decision-making process using text rules and a graphical tree plot, then built a prediction function to classify new flower measurements.
  • Compared your Decision Tree against a Random Forest ensemble to see how combining multiple trees reduces overfitting and improves accuracy.

Ready to quiz yourself?