A simple machine learning project that predicts the species of Iris flowers using four measurements:
- Sepal Length
- Sepal Width
- Petal Length
- Petal Width
This project uses the Decision Tree Classifier to classify Iris flowers into:
- Iris-setosa
- Iris-versicolor
- Iris-virginica
Dataset used: Kaggle Iris Dataset (CSV format).
- Python
- Pandas
- Scikit-learn
- NumPy
- Loaded and cleaned the dataset
- Encoded species labels
- Split data into training & testing sets
- Trained a Decision Tree Classifier
- Evaluated accuracy on test data
Prints:
- Accuracy
- Classification Report
- Confusion Matrix
model = DecisionTreeClassifier()
model.fit(X_train, y_train)
pred = model.predict(X_test)
print("Accuracy:", accuracy_score(y_test, pred))- Clone the repository
- Install required libraries
- Run the notebook or Python script
A simple, clean ML model that accurately classifies Iris flower species.