📊 Machine Learning Projects – KNN Based Predictions
This repository contains end-to-end Machine Learning projects demonstrating the use of K-Nearest Neighbors (KNN) for both classification and regression problems. Each project follows the complete Machine Learning Life Cycle, from problem understanding to business impact.
🚀 Use Case 1: iPhone Purchase Prediction (KNN Classifier) 🎯 Objective
To predict whether a customer will purchase an iPhone based on:
Gender
Age
Salary
This helps retail stores identify high-potential customers and optimize marketing strategies.
⚙️ Solution Overview
Analyzed customer demographic data
Performed Exploratory Data Analysis (EDA) to understand buying behavior
Applied feature encoding and scaling
Built a KNN Classification model
Evaluated model performance using accuracy and confusion matrix
🔍 Key Insights
Age and Estimated Salary are the strongest predictors of iPhone purchase
Higher-income and middle-aged customers are more likely to buy
Gender has minimal influence on purchasing decisions
Feature scaling significantly improves KNN model performance
💼 Business Impact
Improved customer targeting
Reduced marketing costs
Higher conversion rates through personalized campaigns
Data-driven decision-making for sales teams
🏠 Use Case 2: Bangalore House Price Prediction (KNN Regressor) 🎯 Objective
To predict the price of houses in Bangalore using property features:
Total square footage
Number of BHKs, bathrooms, and balconies
Price per square foot
This supports buyers, sellers, and real estate platforms with accurate price estimates.
⚙️ Solution Overview
Used historical Bangalore housing data
Conducted detailed EDA to analyze price trends and feature relationships
Applied feature scaling for distance-based learning
Built a KNN Regression model
Evaluated model using RMSE and R² score
🔍 Key Insights
Total square footage and price per square foot are the most influential features
Higher BHK and bathroom counts generally increase property value
House price distribution is right-skewed due to premium properties
KNN captures local pricing patterns effectively after scaling
💼 Business Impact
Fair and accurate house price estimation
Improved buyer and seller decision-making
Can be integrated into real estate platforms for instant valuation
Helps reduce overpricing and underpricing risks
🛠️ Tools & Technologies Used
Programming Language: Python
Libraries:
Pandas
NumPy
Matplotlib
Seaborn
Scikit-learn
Machine Learning Algorithms:
KNN Classifier
KNN Regressor
Techniques:
Exploratory Data Analysis (EDA)
Feature Scaling
Model Evaluation (Accuracy, RMSE, R²)
🧠 Overall Learnings
Importance of feature scaling in distance-based algorithms
How KNN can be applied to both classification and regression problems
Translating model results into business-ready insights
Building reusable ML pipelines following industry standards