Build a Trustworthy Iris Classifier
Train and test a Python classifier that predicts Iris flower species.
Introduction
30 Second Summary
A confident answer can feel trustworthy even when it has only memorised familiar examples. The real test comes when it faces something new.
In this project, you will build a local Iris flower classification model with Python and scikit-learn. You will measure its accuracy on unseen flowers before using four measurements to predict a species.
What You'll Build
Your terminal will turn four flower measurements into a species prediction backed by a held-out test score.
By the end of this project, you'll have:
- Inspect the built-in Iris dataset to see 150 labelled flowers across three species.
- Compare training accuracy with held-out test accuracy to reveal why unseen data matters.
- Enter four measurements to receive an interactive species prediction in your terminal.
- Secret Mission: add a confidence percentage that flags predictions below the project-defined 70% threshold.
Are there any prerequisites?
A little Python familiarity is helpful because the project includes all dependency setup. No machine-learning experience is required.
Before We Start
Before any hands-on work begins, this is your chance to define what your classifier will predict. You will also lock in why unseen test data makes its result worth trusting.
Set Up Python and scikit-learn
Your classifier depends on Python 3.14.7 with scikit-learn 1.9.0. A virtual environment keeps that package isolated from macOS.
This step prepares an empty iris-classifier workspace in Visual Studio Code. You will verify the exact versions before writing any classifier code.
In this step, get ready to:
- Confirm Python 3.14.7 is available in your project workspace.
- Create an isolated .venv for the project.
- Install scikit-learn 1.9.0 inside the active environment.
Prepare the project workspace
The Python build check confirms whether your Mac has the exact interpreter required by this project. Start by creating a workspace where every later command has a predictable location.
- Press Cmd+Space to open Spotlight.
You will see the Spotlight search field.
- Type Visual Studio Code into the search field.
- Press Enter to open Visual Studio Code.
Visual Studio Code opens on your Mac.
- Create an empty iris-classifier folder on your Desktop through Visual Studio Code's folder picker.
- Choose the iris-classifier folder as the current workspace.
You will see iris-classifier as the open workspace.
- Select Terminal in the top menu.
- Select New Terminal.
You will see an integrated terminal open at the iris-classifier workspace.
- Check the installed Python build by running this command:
python3.14 -VV
What does this check?
- The python3.14 command selects the Python 3.14 interpreter.
- The -VV flag prints the version plus additional build information.
✔️ I see Python 3.14.7
Python 3.14.7 is ready. You can create the project's isolated environment with this interpreter.
ⓧ I see an older Python version
The installed interpreter is older than the version required for this project. Install Python 3.14.7 before creating the environment.
- Open the official Python 3.14.7 release page.
- Download the signed macOS .pkg installer.
The download gives you the official macOS installer.
- Open the downloaded .pkg file.
- Select Continue in the installer.
The installer now presents the software license.
- Select Agree.
- Select Install.
Python 3.14.7 is now installed on your Mac.
- Navigate to /Applications/Python 3.14/ in Finder.
- Double-click Install Certificates.command.
The certificate window finishes with Successfully installed certifi. It also shows update complete.
- Return to the Visual Studio Code integrated terminal.
- Confirm the new Python build by running this command:
python3.14 -VV
What does this confirm?
This repeats the build check after installation. The output should now identify Python 3.14.7.
ⓧ Command not found
Your terminal cannot find the required Python interpreter. Install Python 3.14.7 before creating the environment.
- Open the official Python 3.14.7 release page.
- Download the signed macOS .pkg installer.
The download gives you the official macOS installer.
- Open the downloaded .pkg file.
- Select Continue in the installer.
The installer now presents the software license.
- Select Agree.
- Select Install.
Python 3.14.7 is now installed on your Mac.
- Navigate to /Applications/Python 3.14/ in Finder.
- Double-click Install Certificates.command.
The certificate window finishes with Successfully installed certifi. It also shows update complete.
- Return to the Visual Studio Code integrated terminal.
- Confirm the installed Python build by running this command:
python3.14 -VV
What does this confirm?
This checks that the new interpreter is available from your terminal. The output should identify Python 3.14.7.
Still not seeing Python 3.14.7?
- Confirm that the macOS installer finished before repeating the check.
- Close the current integrated terminal.
- Create another terminal with Terminal followed by New Terminal.
Ask for help with the installation details: Why can my VS Code terminal not find Python 3.14.7 after installation?
Isolate the project packages
A virtual environment gives this project its own package location. Activating it places the environment-specific python executable on PATH.
- Create the isolated environment inside iris-classifier by running this command:
python3 -m venv .venv
What does this command do?
- The venv module creates a project-specific Python environment.
- The .venv value stores that environment inside iris-classifier/.venv.
- Confirm .venv exists in the Visual Studio Code file list for iris-classifier.
You will see the .venv directory inside your project workspace.
Don't see the .venv directory?
- Confirm that the terminal is open at the iris-classifier workspace.
- Repeat the environment creation command after confirming Python 3.14.7 is available.
Ask for help with the missing directory: Why did Python not create my .venv directory?
- Activate the environment in the integrated terminal by running this command:
source .venv/bin/activate
What does activation change?
Activation places the environment-specific python executable on PATH. It does the same for pip.
- Check the start of your integrated terminal prompt for (.venv).
You will see (.venv) at the start of the prompt. Your next package installation now stays inside this project.
Don't see (.venv) in the prompt?
- Confirm that .venv exists inside iris-classifier.
- Repeat the activation command from the integrated terminal at the project workspace.
Ask for help with activation: Why does my terminal prompt not show the active virtual environment?
Lock in the scikit-learn version
The active environment sends package installations to iris-classifier/.venv. This keeps the classifier's dependency separate from other Python projects.
- Install the pinned scikit-learn release by running this command:
pip install -U scikit-learn==1.9.0
What does this command do?
- The pip command uses the package installer from the active .venv.
- The version pin installs scikit-learn 1.9.0 for this project.
The terminal returns to the prompt after the installation finishes. The package now lives inside the active environment.
Installation did not finish?
- Confirm that your prompt begins with (.venv).
- Check that your Mac has an active internet connection.
- Repeat the installation command after confirming Python 3.14.7 is active.
Ask for help with the package installation: Why is scikit-learn 1.9.0 failing to install in my virtual environment?
Before you run the final check, do you expect the version report to describe macOS Python or the active .venv?
- Verify the active Python environment and installed package by running this command:
python -c "import sklearn; sklearn.show_versions()"
What does this check prove?
- Importing sklearn proves that the active environment can access the installed package.
- The sklearn.show_versions() call prints Python plus scikit-learn environment details.
You will see a report that identifies Python 3.14.7 with scikit-learn 1.9.0. That locks in the exact environment for your classifier.
Versions do not match?
- Confirm that the terminal prompt begins with (.venv).
- Reactivate .venv with the activation command above.
- Repeat the pinned installation command from this substep.
Ask for help with the version report: Why does my active virtual environment report the wrong Python or scikit-learn version?
Your isolated Python environment is ready. Next, you will train the first version of your Iris classifier and expose a misleading evaluation result.
Train the First Misleading Model
Your isolated Python environment is ready. The next goal is a working classification model built with scikit-learn.
Reusing all 150 rows for evaluation produces an impressive-looking result. That score cannot show how the model handles a flower it has never seen.
In this step, get ready to:
- Load the built-in Iris dataset.
- Print a summary of the classification problem.
- Train a model on all 150 rows to expose a misleading score.
Load and inspect the Iris dataset
The Iris dataset stores each flower as four features. Its label identifies the species.
- Use the new-file control at the top of Visual Studio Code's file sidebar to create iris_classifier.py inside the open iris-classifier folder.
You'll see an empty iris_classifier.py tab. The file also appears in the sidebar.
- Paste this dataset-loading code into iris_classifier.py:
from sklearn.datasets import load_iris
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import accuracy_score
iris = load_iris()
X = iris.data
y = iris.target
print(f"Rows: {X.shape[0]}")
print(f"Features per row: {X.shape[1]}")
print(f"Species: {', '.join(iris.target_names)}")
What does this code do?
- The imports provide the dataset loader plus the model and scoring tools used later in this step.
- The iris variable holds the built-in dataset.
- The X variable stores four measurements for each flower.
- The y variable stores the matching species labels.
- The final three lines display the dataset size plus its available target names.
- Save iris_classifier.py.
- Reveal the dataset summary in the integrated terminal from earlier by running this command:
python iris_classifier.py
What does this command do?
The python command comes from your activated .venv. It executes iris_classifier.py inside that isolated environment.
Good progress. Your script now reads all 150 labelled examples from the Iris dataset.
You'll see Rows: 150 followed by Features per row: 4.
The terminal also shows a Species: line containing three target names.
Missing the dataset summary?
- Confirm that you saved iris_classifier.py before running it.
- Check that the integrated terminal prompt still shows the active .venv.
- Compare each import with the code block above if the terminal reports an import or spelling problem.
Help me troubleshoot my Iris dataset script.
Train and score the same rows
A supervised learning model learns a mapping from measurements to known species labels. This first version learns from every row in X.
The evaluation then asks the model to predict those same rows. That deliberate reuse creates the shortfall this step is designed to reveal.
- Place your cursor on the blank line beneath the species summary in iris_classifier.py.
- Add the model training plus its same-data evaluation by pasting this code:
model = LogisticRegression(max_iter=500)
model.fit(X, y)
training_predictions = model.predict(X)
first_prediction = model.predict([X[0]])[0]
print(f"Training accuracy: {accuracy_score(y, training_predictions):.0%}")
print(f"First-row prediction: {iris.target_names[first_prediction]}")
What does this code do?
- The model variable holds a logistic regression classifier configured with extra training iterations.
- The model.fit(X, y) call learns from all 150 labelled rows.
- The model.predict(X) call predicts labels for those same 150 rows.
- Accuracy measures the fraction of labels predicted correctly.
- The first-row prediction maps the predicted class number back to a species name.
- Save iris_classifier.py.
Before you run this, do you think a strong score from reused rows proves that the model handles unseen flowers well?
- Test the complete same-data evaluation by running this command:
python iris_classifier.py
What does this command check?
This run executes dataset loading plus model training in one pass. It exposes the score produced when learning and evaluation reuse the same examples.
Your first classifier now runs from start to finish. You'll see Rows: 150 plus Features per row: 4 near the top.
The terminal also shows the available species names. The final lines begin with Training accuracy: and First-row prediction:.
This result is intentionally misleading. The model learned from X.
The prediction step reused X for scoring. The strong result gives no evidence about unseen flowers.
Missing the final results?
- Check that the model code sits beneath the dataset summary in iris_classifier.py.
- Confirm that every opening parenthesis has a matching closing parenthesis.
- Compare the capitalization of X with each later reference.
Help me fix my model evaluation.
Your completed iris_classifier.py file should match the reference below.
✔️ Awesome, I've got everything!
Your file is saved. Your terminal output confirms that the first model trains and scores all 150 rows.
ⓧ I'd like to double check the full code
from sklearn.datasets import load_iris
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import accuracy_score
iris = load_iris()
X = iris.data
y = iris.target
print(f"Rows: {X.shape[0]}")
print(f"Features per row: {X.shape[1]}")
print(f"Species: {', '.join(iris.target_names)}")
model = LogisticRegression(max_iter=500)
model.fit(X, y)
training_predictions = model.predict(X)
first_prediction = model.predict([X[0]])[0]
print(f"Training accuracy: {accuracy_score(y, training_predictions):.0%}")
print(f"First-row prediction: {iris.target_names[first_prediction]}")
You have exposed the weakness in scoring a model on its own training rows. Next, you'll test the classifier with data it has never seen.
Test on Unseen Data
Your classifier now reports impressive training accuracy. That score comes from the same rows the model studied.
A train/test split reserves some flowers for evaluation. Those held-out rows reveal how the model handles data it has never seen.
In this step, get ready to:
- Split the Iris rows into training and test subsets.
- Fit the classifier using only the training subset.
- Compare accuracy on seen rows with accuracy on unseen rows.
Create the held-out split
The test subset stays outside the fitting process. This separation gives the final test score a clear job.
- In iris_classifier.py, replace the three import lines at the top with this import group:
from sklearn.datasets import load_iris
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import accuracy_score
from sklearn.model_selection import train_test_split
What does this import add?
- The train_test_split function divides matching feature rows and labels into separate subsets.
- The existing imports continue to load the dataset, train logistic regression, and calculate accuracy.
- In iris_classifier.py, find the line print(f"Species: {', '.join(iris.target_names)}").
- Insert this split directly below that line:
X_train, X_test, y_train, y_test = train_test_split(
X,
y,
test_size=0.2,
random_state=42,
stratify=y,
)
How does the split work?
- The test_size=0.2 setting reserves 20% of the 150 rows for testing. The remaining 120 rows become training data.
- The random_state=42 setting makes the shuffled split reproducible.
- The stratify=y setting preserves the class proportions across both subsets.
- Save iris_classifier.py.
- Confirm the split code leaves the existing script runnable by running:
python iris_classifier.py
What should you see?
You should still see 150 rows, four features, the species names, the existing training result, and the first-row prediction. A complete run confirms the new split executes successfully.
Does the script stop running?
- Check that the new import sits with the other imports at the top of iris_classifier.py.
- Check that the closing parenthesis appears directly after stratify=y,.
- Confirm your integrated terminal still shows the activated .venv.
Help me fix the train/test split in my Iris classifier.
Train on the training subset
The model now needs to learn only from X_train and y_train. Separate predictions then measure performance on each subset.
- In iris_classifier.py, find the section that begins with model = LogisticRegression(max_iter=500).
- Replace that section through the final print line with this evaluation code:
model = LogisticRegression(max_iter=500)
model.fit(X_train, y_train)
training_predictions = model.predict(X_train)
test_predictions = model.predict(X_test)
first_prediction = model.predict([X[0]])[0]
print(f"Training accuracy: {accuracy_score(y_train, training_predictions):.0%}")
print(f"Test accuracy: {accuracy_score(y_test, test_predictions):.0%}")
print(f"First-row prediction: {iris.target_names[first_prediction]}")
What does this evaluation do?
- The model.fit(X_train, y_train) call limits learning to the training subset.
- The training_predictions values measure performance on rows the model studied.
- The test_predictions values measure performance on held-out rows.
- Each accuracy_score call compares predictions with labels from the matching subset.
- Save iris_classifier.py.
Compare seen and unseen accuracy
Before you run the script, which accuracy line do you expect to say more about a completely new flower?
- Return to the integrated terminal from earlier.
- Test the held-out evaluation by running:
python iris_classifier.py
What should you see now?
You should see separate Training accuracy: and Test accuracy: lines. The test percentage comes from 30 held-out rows that were excluded from fitting.
Training accuracy describes fit on seen rows. Test accuracy provides evidence about generalization to unseen rows.
Missing the test accuracy line?
- Confirm you saved iris_classifier.py before running it.
- Check that model.fit(X_train, y_train) uses the training variables.
- Check that the test score compares y_test with test_predictions.
Help me debug the separate accuracy results.
You have closed the evaluation gap. Your classifier now proves its performance against flowers it did not study.
✔️ Awesome, I've got everything!
Your split evaluation is complete. Make sure iris_classifier.py is saved.
ⓧ I'd like to double check the full code
from sklearn.datasets import load_iris
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import accuracy_score
from sklearn.model_selection import train_test_split
iris = load_iris()
X = iris.data
y = iris.target
print(f"Rows: {X.shape[0]}")
print(f"Features per row: {X.shape[1]}")
print(f"Species: {', '.join(iris.target_names)}")
X_train, X_test, y_train, y_test = train_test_split(
X,
y,
test_size=0.2,
random_state=42,
stratify=y,
)
model = LogisticRegression(max_iter=500)
model.fit(X_train, y_train)
training_predictions = model.predict(X_train)
test_predictions = model.predict(X_test)
first_prediction = model.predict([X[0]])[0]
print(f"Training accuracy: {accuracy_score(y_train, training_predictions):.0%}")
print(f"Test accuracy: {accuracy_score(y_test, test_predictions):.0%}")
print(f"First-row prediction: {iris.target_names[first_prediction]}")
What should match?
This reference keeps the dataset split before model fitting. It also calculates each accuracy result from its matching subset.
Your model now earns its accuracy score on unseen data. Next, you will add a reusable preprocessing pipeline and let someone classify a flower from their own measurements.
Build an Interactive Predictor
Your train/test split now shows how the classification model handles unseen flowers. Next, you will turn that evaluated model into a predictor someone can try.
A scikit-learn preprocessing pipeline learns scaling from the training subset. The same pipeline reuses that scaling every time the model predicts.
In this step, get ready to:
- Combine feature scaling with logistic regression in one pipeline.
- Collect four flower measurements from the terminal.
- Convert those measurements into a species prediction.
Build the preprocessing pipeline
Flower measurements use different numeric ranges. StandardScaler learns how to scale them from the training rows.
- In iris_classifier.py, find the final import line:
from sklearn.model_selection import train_test_split
What are you looking at?
This import provides the function that creates your training subset and held-out test subset. The two pipeline imports belong directly below it.
- Replace that line with the expanded import group below:
from sklearn.model_selection import train_test_split
from sklearn.pipeline import make_pipeline
from sklearn.preprocessing import StandardScaler
What do these imports add?
- The make_pipeline function connects preprocessing to the classifier.
- The StandardScaler class learns scaling values from the data passed to model.fit().
- Find the existing model definition:
model = LogisticRegression(max_iter=500)
What are you replacing?
The current model sends raw measurements directly into logistic regression. The replacement adds scaling before each measurement reaches the classifier.
- Replace the existing model definition with this pipeline:
model = make_pipeline(
StandardScaler(),
LogisticRegression(max_iter=500),
)
What does the pipeline do?
- The StandardScaler() step learns its scaling values when model.fit(X_train, y_train) runs.
- The LogisticRegression(max_iter=500) step learns to classify the scaled training rows.
- The pipeline applies the stored scaling before every later prediction.
- Save iris_classifier.py.
Before you run the script, do you expect the separate training and test results to remain?
- Check the upgraded model by running:
python iris_classifier.py
What should you see?
The script still prints separate Training accuracy and Test accuracy results. It also prints the first-row prediction.
These results now come from the pipeline. Scaling is fitted only from X_train.
That is a strong checkpoint. Your evaluation now runs through one repeatable preprocessing path.
Pipeline run failing?
- Check that both new imports sit below the train_test_split import.
- Check that model.fit(X_train, y_train) remains directly below the pipeline definition.
- Check that each opening parenthesis in the pipeline has a matching closing parenthesis.
Help me troubleshoot my scikit-learn pipeline.
Collect four measurements
Terminal input turns the saved model into something another person can test. Each response passes through float() so the model receives a numeric measurement.
- In iris_classifier.py, find the line that prints the first-row prediction.
- Add the input block below that line by pasting this code:
print("\nEnter four Iris measurements in centimetres.")
sepal_length = float(input("Sepal length: "))
sepal_width = float(input("Sepal width: "))
petal_length = float(input("Petal length: "))
petal_width = float(input("Petal width: "))
How does the input block work?
- Each input() call pauses the script until you enter a measurement.
- Each float() call converts the response into a decimal number.
- The four variables keep the measurements in the same order as the Iris dataset features.
- Save iris_classifier.py.
Before you run this version, how many measurement prompts do you expect to see?
- Test the new input flow by running:
python iris_classifier.py
What does this check?
The command runs your saved script through the pipeline evaluation. The script then pauses at each measurement prompt.
- Enter 5.0 at the Sepal length prompt.
- Enter 3.0 at the Sepal width prompt.
- Enter 1.0 at the Petal length prompt.
- Enter 0.2 at the Petal width prompt.
You will see all four prompts before the script returns control to the terminal.
Input stopping the script?
- Enter digits with a decimal point at every prompt.
- Check that each input() call is wrapped by float().
- Check that every prompt string has matching quotation marks.
Help me fix my measurement input.
Predict the species
The four numeric values need to become one sample row before prediction. The returned class number then maps to a readable species name.
- In iris_classifier.py, place the prediction block below the petal_width input line by pasting this code:
sample = [[sepal_length, sepal_width, petal_length, petal_width]]
predicted_class = model.predict(sample)[0]
predicted_species = iris.target_names[predicted_class]
print(f"\nPredicted species: {predicted_species}")
How does the prediction work?
- The sample variable stores one row with four features in the dataset's expected order.
- The model.predict(sample)[0] expression returns the predicted class for that row.
- The iris.target_names lookup converts the class into its species name.
- Save iris_classifier.py.
Before you run the finished script, do you expect it to print a class number or a species name?
- Run the finished interactive predictor with:
python iris_classifier.py
What does the final run check?
The command evaluates the saved pipeline before collecting a new sample. The prediction appears after the fourth measurement.
- Enter 5.0 at the Sepal length prompt.
- Enter 3.0 at the Sepal width prompt.
- Enter 1.0 at the Petal length prompt.
- Enter 0.2 at the Petal width prompt.
You will see the held-out Test accuracy result before the prompts. After the fourth measurement, you will see Predicted species: followed by one of the available target names.
You've got the full demo working. Your classifier now evaluates unseen data before turning four measurements into a species prediction.
Prediction missing?
- Check that sample contains all four measurement variables inside a nested list.
- Check that predicted_class uses model.predict(sample)[0].
- Check that the final print line sits below the predicted_species assignment.
Help me find why my species prediction is missing.
✔️ Awesome, I've got everything!
Great. Save iris_classifier.py so your interactive predictor is ready for another run.
ⓧ I'd like to double check the full code
from sklearn.datasets import load_iris
from sklearn.linear_model import LogisticRegression
from sklearn.metrics import accuracy_score
from sklearn.model_selection import train_test_split
from sklearn.pipeline import make_pipeline
from sklearn.preprocessing import StandardScaler
iris = load_iris()
X = iris.data
y = iris.target
print(f"Rows: {X.shape[0]}")
print(f"Features per row: {X.shape[1]}")
print(f"Species: {', '.join(iris.target_names)}")
X_train, X_test, y_train, y_test = train_test_split(
X,
y,
test_size=0.2,
random_state=42,
stratify=y,
)
model = make_pipeline(
StandardScaler(),
LogisticRegression(max_iter=500),
)
model.fit(X_train, y_train)
training_predictions = model.predict(X_train)
test_predictions = model.predict(X_test)
first_prediction = model.predict([X[0]])[0]
print(f"Training accuracy: {accuracy_score(y_train, training_predictions):.0%}")
print(f"Test accuracy: {accuracy_score(y_test, test_predictions):.0%}")
print(f"First-row prediction: {iris.target_names[first_prediction]}")
print("\nEnter four Iris measurements in centimetres.")
sepal_length = float(input("Sepal length: "))
sepal_width = float(input("Sepal width: "))
petal_length = float(input("Petal length: "))
petal_width = float(input("Petal width: "))
sample = [[sepal_length, sepal_width, petal_length, petal_width]]
predicted_class = model.predict(sample)[0]
predicted_species = iris.target_names[predicted_class]
print(f"\nPredicted species: {predicted_species}")
Secret mission
Reveal Prediction Confidence
Your classifier names a species. The label alone does not show how decisive the model was. Add a confidence percentage plus a warning for predictions below the project's 70% threshold.
Clean Up Your Resources
Clean Up Your Resources
Everything you built stays on your Mac. There are no cloud services or ongoing costs.
Choose whether to keep your resources available, pause them to come back later, or delete them entirely.
Resources you used:
- The iris-classifier folder containing your interactive iris_classifier.py script.
- The .venv directory inside iris-classifier, including scikit-learn 1.9.0.
Keep everything running
No action is needed. Choose this option while you are still testing measurements with your Iris classifier.
- Keep the iris-classifier folder in its current location.
- Leave .venv intact to preserve its isolated scikit-learn installation.
- Continue using the current Visual Studio Code workspace for more predictions.
Pause - I'll come back to this later
Pausing this local project means ending the current editor session while preserving every file.
- Close Visual Studio Code to end the current editor session.
The integrated terminal session closes with the editor. Your .venv directory remains available for next time.
- Return to the existing iris-classifier folder in Visual Studio Code when you resume.
- Reactivate .venv using the activation command from Step 1.
Delete - I don't want to use this again
Deleting this folder permanently removes the resources listed above. Your other local projects stay untouched.
- Remove the iris-classifier folder from its parent directory by running these commands in the current integrated terminal:
cd ..
rm -rf iris-classifier
What Does This Cleanup Do?
- The first line moves your terminal one level above iris-classifier.
- The second line permanently removes iris-classifier with all of its contents.
- Check the project area in Visual Studio Code.
You should no longer see iris_classifier.py or .venv.
Still See the Project Files?
- Check that the integrated terminal moved outside iris-classifier before deletion.
- Check that the folder name matches iris-classifier exactly.
Help me remove my local iris-classifier folder safely.
Nice Work!
Nice Work!
You did it! You've built a local Iris flower classifier that tests its performance on unseen data before predicting a species with a confidence signal.
You've learned how to:
- Use supervised learning to train a working classifier from the Iris dataset with scikit-learn.
- Compare training accuracy with held-out test accuracy to measure performance on unseen flowers.
- Create an interactive preprocessing pipeline that scales four measurements before returning an Iris species prediction.
- Secret Mission: Added a prediction confidence percentage that flags uncertain samples below the project-defined threshold.
Ready to quiz yourself?