Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Project 2: Data Classification Using AI

Goal: Train a supervised machine learning model to classify iris flowers into three species based on their measurements.

Key Concepts: Supervised learning, train-test split, feature scaling, K-Nearest Neighbors (KNN), confusion matrix, F1 score.

How it works:

  • Loads the Iris dataset (150 samples, 4 features, 3 classes)
  • Scales features using StandardScaler so no single measurement dominates
  • Splits data 80/20 into training and testing sets (shuffled)
  • Trains a KNeighborsClassifier with K=5
  • Evaluates using accuracy score, confusion matrix, and a full classification report

Files: classifier.py

Dependencies:

pip install scikit-learn

How to run:

cd "C:\Users\user\OneDrive\Desktop\Project2"
python classifier.py

Sample output:

Dataset shape: (150, 4)
Classes: ['setosa', 'versicolor', 'virginica']
Accuracy: 1.0

Confusion Matrix:
[[10  0  0]
 [ 0  9  0]
 [ 0  0 11]]

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages