Skip to content

Latest commit

Β 

History

95 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ Machine Learning & AI Journey

Documenting my journey of learning, experimenting, and building projects in Machine Learning, Data Science, AI, and Real-World ML Systems.


πŸ“Œ About This Repository

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.


πŸ› οΈ Tech Stack & Tools

πŸ’» Languages

  • Python
  • SQL

πŸ“š Libraries & Frameworks

NumPy

Fundamental package for numerical computing in Python. Used for array operations, matrix math, vectorized computations, and mathematical functions β€” the backbone of all ML computations.

Pandas

Powerful data manipulation and analysis library. Used for loading datasets (CSV, JSON), cleaning data, filtering rows, transforming columns, handling missing values, and performing aggregations.

Matplotlib

Core Python plotting library. Used for creating line plots, bar charts, scatter plots, histograms, and customizing figures for data analysis and result visualization.

Seaborn

Statistical data visualization library built on Matplotlib. Used for heatmaps, pair plots, distribution plots, and correlation visualizations β€” makes complex statistical charts easy to build.

Scikit-Learn

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.

BeautifulSoup

HTML and XML parsing library. Used for extracting data from web pages by navigating and searching the parse tree.

Requests

HTTP library for Python. Used for making web requests to fetch HTML pages and API data as part of web scraping workflows.

🧰 Tools

  • Jupyter Notebook
  • VS Code
  • Git & GitHub

πŸ“‚ Repository Structure

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

πŸ€– Supervised ML β€” Algorithms

πŸ“ Regression Algorithms

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.

🏷️ Classification Algorithms

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.

πŸ” Unsupervised ML β€” Algorithms

πŸ—‚οΈ Clustering

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.

🚨 Anomaly Detection

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.

πŸ“‰ Dimensionality Reduction

Algorithm What it does
PCA (Principal Component Analysis) Reduces the number of features by transforming data into directions of maximum variance.

πŸ—οΈ Scratch Implementations

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.

πŸ—„οΈ Projects

Supervised ML β€” Assignment Projects

🏠 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.


πŸ’³ CreditWise Loan System (Supervised_ML/projects/CreditWise_Loan_System/)

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.

πŸ›’ E-Commerce Data Pipeline (mini_project/)

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.


🌐 Web Scraping & Data Collection

  • 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

πŸ“š Learning Progress

βœ… Completed / Practiced

Python & Data Handling

  • Python Fundamentals
  • NumPy
  • Pandas
  • Data Cleaning

Data Visualization

  • Matplotlib
  • Seaborn
  • Exploratory Data Analysis (EDA)

Web Scraping & Data Collection

  • Requests
  • BeautifulSoup
  • HTML Parsing
  • Data Extraction

Mathematics & Statistics

  • Probability Distributions
  • Calculus Basics

Supervised ML

  • 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)

Unsupervised ML

  • K-Means Clustering
  • DBSCAN Clustering
  • Hierarchical Clustering
  • Anomaly Detection (Isolation Forest, LOF, DBSCAN)
  • PCA
  • End-to-End Clustering Project (SmartCart Customer Segmentation)

πŸ‘¨β€πŸ’» Author

Piyush Thakur

About

Documenting my journey of learning and building in Machine Learning.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages