Documenting my journey of learning, experimenting, and building projects in Machine Learning, Data Science, AI, and Real-World ML Systems.
Welcome to my Machine Learning repository!
This repository contains my complete hands-on learning journey across:
- Machine Learning (Supervised & Unsupervised)
- Data Analysis & Visualization
- Mathematics & Statistics
- Web Scraping & Data Collection
- Scratch Implementations of ML Algorithms
- Real-World ML Projects
I continuously update this repository as I learn new concepts, implement algorithms, and build projects.
- Python
- SQL
Fundamental package for numerical computing in Python. Used for array operations, matrix math, vectorized computations, and mathematical functions β the backbone of all ML computations.
Powerful data manipulation and analysis library. Used for loading datasets (CSV, JSON), cleaning data, filtering rows, transforming columns, handling missing values, and performing aggregations.
Core Python plotting library. Used for creating line plots, bar charts, scatter plots, histograms, and customizing figures for data analysis and result visualization.
Statistical data visualization library built on Matplotlib. Used for heatmaps, pair plots, distribution plots, and correlation visualizations β makes complex statistical charts easy to build.
The go-to ML library for Python. Used for preprocessing data, building and training ML models, evaluating performance (accuracy, F1, RMSE), hyperparameter tuning, and building pipelines.
HTML and XML parsing library. Used for extracting data from web pages by navigating and searching the parse tree.
HTTP library for Python. Used for making web requests to fetch HTML pages and API data as part of web scraping workflows.
- Jupyter Notebook
- VS Code
- Git & GitHub
Machine_Learning/
β
βββ web_scraping/
β βββ scrap_data/
β βββ scraping_activity.ipynb
β βββ scraping_activity2.ipynb
β βββ scraping_activity3.ipynb
β βββ scraping_activity4.ipynb
β
βββ data_collection/
β βββ cleaned_data/
β β βββ clean1.csv
β βββ scraped_data/
β β βββ data1.html
β βββ beautifulsoup.ipynb
β βββ index.html
β βββ requests.ipynb
β βββ web_scraping.ipynb
β
βββ maths/
β βββ calculus.ipynb
β βββ probability_dist.ipynb
β
βββ matplotlib/
β βββ 1-matplotlib_tutorial.ipynb
β βββ matplotlib.ipynb
β
βββ mini_project/
β βββ data/
β β βββ games.csv
β β βββ games.json
β β βββ items.html
β βββ cleaning_and_visualization.ipynb
β βββ webscraping.ipynb
β βββ README.md
β
βββ numpy/
β βββ numpy.ipynb
β
βββ pandas/
β βββ employee_data.csv
β βββ employee_data.json
β βββ globalAirQuality.csv
β βββ pandas.ipynb
β βββ raw_data.csv
β βββ sorted_data.csv
β
βββ seaborn/
β βββ seaborn.ipynb
β βββ seaborn_tutorial.ipynb
β
βββ Supervised_ML/
β βββ algorithms/
β β βββ adaboost_classifier.ipynb
β β βββ adaboost_regressor.ipynb
β β βββ decision_tree_classifier.ipynb
β β βββ decision_tree_regressor.ipynb
β β βββ elasticNet.ipynb
β β βββ Employee_turnover.ipynb
β β βββ gradient_boosting_classifier.ipynb
β β βββ gradient_boosting_regressor.ipynb
β β βββ house_price_prediction.ipynb
β β βββ iris_flower.ipynb
β β βββ knn.ipynb
β β βββ lasso_regression.ipynb
β β βββ linear_regression.ipynb
β β βββ logistic_regression.ipynb
β β βββ naive_bayes.ipynb
β β βββ random_forest_classifier.ipynb
β β βββ random_forest_regressor.ipynb
β β βββ ridge_regression.ipynb
β β βββ shop_smart.ipynb
β β βββ stacking_classifier.ipynb
β β βββ stacking_regressor.ipynb
β β βββ support_vector_classifier.ipynb
β β βββ support_vector_regressor.ipynb
β β βββ voting_classifier.ipynb
β β βββ voting_regressor.ipynb
β β βββ xgboost_classifier.ipynb
β β βββ xgboost_regressor.ipynb
β β
β βββ datasets/
β β βββ employee_turnover.csv
β β βββ heart.csv
β β βββ HousePricePrediction.csv
β β βββ insurance.csv
β β βββ Iris.csv
β β βββ novagen_dataset.csv
β β βββ shop_smart_ecommerce.csv
β β
β βββ projects/
β β βββ CreditWise_Loan_System/
β β βββ dataset/
β β βββ notebook/
β β
β βββ scratch_implementation/
β βββ knn.ipynb
β βββ linear_reg.ipynb
β βββ logistic_reg.ipynb
β
βββ Unsupervised_ML/
β βββ algorithms/
β β βββ anamoly_detection_dbscan.ipynb
β β βββ anamoly_detection_isolation_forest.ipynb
β β βββ anamoly_detection_lof.ipynb
β β βββ DBSCAN_clustering.ipynb
β β βββ hierarchical_clustering.ipynb
β β βββ iris_kmeans.ipynb
β β βββ K_mean_clustering.ipynb
β β βββ pca.ipynb
β βββ datasets/
β β βββ thyroid_dataset.csv
β βββ projects/
β βββ SmartCart_Customer_Clustering/
β βββ dataset/
β β βββ smartcart_customers.csv
β βββ notebook/
β βββ smartcart.ipynb
β
βββ README.md| Algorithm | What it does |
|---|---|
| Linear Regression | Fits a straight line to predict a continuous output from input features. |
| Ridge Regression | Linear regression with L2 regularization to reduce overfitting by penalizing large weights. |
| Lasso Regression | Linear regression with L1 regularization that can shrink some feature coefficients to zero, performing feature selection. |
| ElasticNet | Combines L1 and L2 regularization β balances feature selection and coefficient shrinkage. |
| Decision Tree Regressor | Splits data into branches based on feature thresholds to predict continuous values. |
| Random Forest Regressor | Ensemble of decision trees whose predictions are averaged for more robust regression. |
| Gradient Boosting Regressor | Sequentially builds trees where each one corrects errors of the previous, for high accuracy regression. |
| AdaBoost Regressor | Boosting method that focuses subsequent weak learners on hard-to-predict samples. |
| Support Vector Regressor (SVR) | Finds a hyperplane that best fits data within a margin of tolerance. |
| XGBoost Regressor | Optimized, fast gradient boosting with built-in regularization β a top performer on tabular data. |
| Voting Regressor | Combines predictions from multiple regression models by averaging their outputs. |
| Stacking Regressor | Trains a meta-model on top of base model predictions to improve overall accuracy. |
| Algorithm | What it does |
|---|---|
| Logistic Regression | Estimates the probability of a binary outcome using a sigmoid function. |
| K-Nearest Neighbors (KNN) | Classifies a point based on the majority class among its K closest neighbors. |
| Naive Bayes | Probabilistic classifier based on Bayes' theorem, assuming feature independence. |
| Decision Tree Classifier | Splits data recursively on feature conditions to assign class labels. |
| Random Forest Classifier | Ensemble of decision trees that votes on the most likely class label. |
| Gradient Boosting Classifier | Builds trees sequentially, each correcting the previous one's misclassifications. |
| AdaBoost Classifier | Boosts performance by assigning higher weights to misclassified samples in each round. |
| Support Vector Classifier (SVC) | Finds the optimal hyperplane that maximizes the margin between classes. |
| XGBoost Classifier | Fast and regularized gradient boosting β excellent for structured/tabular classification tasks. |
| Voting Classifier | Aggregates predictions from multiple classifiers via majority vote. |
| Stacking Classifier | Trains a meta-classifier on base model outputs to learn the best combination. |
| Algorithm | What it does |
|---|---|
| K-Means Clustering | Partitions data into K clusters by minimizing the distance between points and their cluster centers. |
| DBSCAN Clustering | Groups densely packed points into clusters and labels low-density points as outliers. |
| Hierarchical Clustering | Builds a tree of nested clusters by iteratively merging or splitting groups. |
| Algorithm | What it does |
|---|---|
| Isolation Forest | Detects anomalies by isolating outliers in random feature splits β they need fewer splits to be isolated. |
| Local Outlier Factor (LOF) | Identifies anomalies by comparing a point's local density to that of its neighbors. |
| DBSCAN Anomaly Detection | Uses DBSCAN's noise-point labeling to flag low-density outliers as anomalies. |
| Algorithm | What it does |
|---|---|
| PCA (Principal Component Analysis) | Reduces the number of features by transforming data into directions of maximum variance. |
Built core algorithms from scratch using only NumPy to understand the math behind them:
- Linear Regression β Implemented gradient descent to minimize MSE and learn weights manually.
- Logistic Regression β Built sigmoid activation and binary cross-entropy loss with gradient descent.
- KNN β Implemented Euclidean distance computation and majority voting without any ML library.
π Assignment 1 β HomeVista House Price Prediction (Supervised_ML/algorithms/house_price_prediction.ipynb)
Predict residential property sale prices for HomeVista Properties using Linear Regression. Covers preprocessing, feature encoding, and regression evaluation on property features like LotArea, YearBuilt, and OverallCond. Target: SalePrice.
π Assignment 2 β TalentCore Employee Turnover Prediction (Supervised_ML/algorithms/Employee_turnover.ipynb)
Predict whether an employee is likely to leave TalentCore Pvt. Ltd. Builds a baseline Logistic Regression model, then improves it with L1 & L2 Regularization and compares all three on 900 employee records. Target: Employee_Turnover.
πΈ Assignment 3 β Iris Flower Species Classification (Supervised_ML/algorithms/iris_flower.ipynb)
Automate plant identification for a botanical research centre by training and comparing KNN, Logistic Regression, and Naive Bayes β deliberately trained on 50% and tested on 100% to simulate real-world constraints. Target: Species.
π Assignment 4 β ShopSmart Purchase Intent Prediction (Supervised_ML/algorithms/shop_smart.ipynb)
Predict whether a website visitor will make a purchase for ShopSmart using a Decision Tree with pruning on 12,330 user sessions. Handles class imbalance, evaluated on F1 Score (benchmark: 0.55). Target: Revenue.
Intelligent loan approval system for SecureTrust Bank to predict whether a loan should be Approved or Rejected. Covers EDA, missing value imputation, feature encoding, feature engineering (DTI_RatioΒ², Credit_ScoreΒ²), and comparison of Logistic Regression, KNN, and Naive Bayes β Naive Bayes achieved the best precision. Target: Loan_Approved.
Scraped product data from a sandbox e-commerce site, stored it in MySQL, then cleaned and visualized it with Pandas. Covers web scraping, database ingestion, feature engineering, and price distribution analysis.
ποΈ SmartCart Customer Clustering System (Unsupervised_ML/projects/SmartCart_Customer_Clustering/)
Customer segmentation system for SmartCart (2,240 records, 22 features) to replace generic marketing with data-driven personalised strategies. Applies feature engineering, PCA for dimensionality reduction, and compares KMeans vs Agglomerative Clustering β Agglomerative (Ward linkage, K=4) produced the best-defined segments identified via Elbow Method and Silhouette Score.
- Fetched web pages using the Requests library
- Parsed and extracted structured data from HTML using BeautifulSoup
- Cleaned and organized scraped data into CSV format
- Built multi-step scraping workflows across activity notebooks
- Python Fundamentals
- NumPy
- Pandas
- Data Cleaning
- Matplotlib
- Seaborn
- Exploratory Data Analysis (EDA)
- Requests
- BeautifulSoup
- HTML Parsing
- Data Extraction
- Probability Distributions
- Calculus Basics
- Linear Regression
- Ridge, Lasso, ElasticNet
- Logistic Regression
- KNN
- Naive Bayes
- Decision Trees (Classifier & Regressor)
- Random Forest (Classifier & Regressor)
- Gradient Boosting (Classifier & Regressor)
- AdaBoost (Classifier & Regressor)
- Support Vector Machines (Classifier & Regressor)
- XGBoost (Classifier & Regressor)
- Voting & Stacking Ensembles
- Scratch Implementations (Linear Reg, Logistic Reg, KNN)
- Assignment 1 β House Price Prediction (Linear Regression)
- Assignment 2 β Employee Turnover Prediction (Logistic Regression + Regularization)
- Assignment 3 β Iris Species Classification (KNN vs Logistic Regression vs Naive Bayes)
- Assignment 4 β Purchase Intent Prediction (Decision Tree + Pruning, Imbalanced Data)
- K-Means Clustering
- DBSCAN Clustering
- Hierarchical Clustering
- Anomaly Detection (Isolation Forest, LOF, DBSCAN)
- PCA
- End-to-End Clustering Project (SmartCart Customer Segmentation)
Piyush Thakur