You are browsing as a guest. Sign up (or log in) to start making projects!

47m 41s logged

Building My Fruit Classifier :apple-smug: 🍊

For this project, I wanted to understand how a machine learning model decides between two categories, so I built a Fruit Classifier using Python, Streamlit, and K-Nearest Neighbors (KNN).


The idea is simple: give the app a fruit’s weight and size, and it predicts whether the fruit is more likely to be an Apple or an Orange.


What made this project interesting was learning how KNN works. Instead of using a huge, complicated formula, the model looks at the fruits that are closest to the new fruit in the dataset and basically asks, “What are my nearest neighbours?” If most of them are apples, it predicts Apple. If most are oranges, it predicts Orange.


I also added a scatter plot so the result is not just a random prediction appearing on the screen. You can actually see the apples and oranges in the dataset and where the fruit you entered appears among them. This made KNN much easier for me to understand visually.


One of the fun parts was testing strange combinations of weight and size just to see what the model would predict. :smug1: Sometimes the result was obvious, and sometimes the fruit landed right between the two groups, which made the classification more interesting.


Now I have a machine that can settle one of life’s most important questions: Apple or Orange? 🍎 :tw_crossed_swords: 🍊

0
4

Comments 0

No comments yet. Be the first!