Skip to content

Ayiaza/Machine-Learning-with-Python-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 

Repository files navigation

🌸 Iris Flower Classifier β€” Random Forest ML Model

A beginner-friendly machine learning project that trains a Random Forest classifier on the classic Iris dataset to predict flower species with high accuracy β€” covering the full ML pipeline from data loading to model evaluation.


πŸ› οΈ Technologies Used

  • Python 3 β€” Core programming language
  • pandas β€” Used to load and structure the dataset into a readable DataFrame
  • scikit-learn β€” Provides the Iris dataset, train/test splitting, Random Forest model, and evaluation metrics
  • matplotlib β€” Imported for potential data visualization support
  • RandomForestClassifier β€” An ensemble learning model that combines multiple decision trees for accurate predictions
  • accuracy_score & classification_report β€” Metrics used to measure how well the model performs

πŸ”„ How It Works β€” Step by Step

  1. Load the dataset β€” The built-in Iris dataset is loaded from scikit-learn and converted into a pandas DataFrame with proper column names
  2. Explore the data β€” The first 5 rows of features (sepal length, sepal width, petal length, petal width) are printed for inspection
  3. Split the data β€” The dataset is divided into 80% training and 20% testing using train_test_split with a fixed random_state=42 for reproducibility
  4. Initialize the model β€” A RandomForestClassifier is created with random_state=42 to ensure consistent results across runs
  5. Train the model β€” The model is fitted on the training data using model.fit(X_train, y_train)
  6. Make predictions β€” The trained model predicts flower species for the unseen test data
  7. Evaluate performance β€” accuracy_score calculates overall accuracy and classification_report breaks down precision, recall, and F1-score per class

πŸ“š What I Learned

  • How to build a complete machine learning pipeline in Python β€” from loading and splitting data to training and evaluating a classifier using scikit-learn
  • How Random Forest works as an ensemble model, and how metrics like accuracy, precision, recall, and F1-score are used to measure real model performance

βœ… Conclusion

This project demonstrates a clean, end-to-end machine learning workflow using one of the most popular algorithms in data science. It's a strong foundation for anyone stepping into the world of supervised learning and model evaluation.

Run the Project

Screen.Recording.2026-06-25.172224.mp4

About

A machine learning project that trains a Random Forest classifier on the Iris dataset to predict flower species with 100% accuracy using scikit-learn.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages