Skip to content

Latest commit

 

History

History
185 lines (132 loc) · 5.49 KB

File metadata and controls

185 lines (132 loc) · 5.49 KB

Machine Learning Playground

This repository is a growing collection of machine learning projects, experiments, and practice work. Each topic is organized into its own folder, with individual projects grouped under the relevant technique.

The current focus is hands-on supervised learning: building small projects that load datasets, prepare features, train models, evaluate predictions, and visualize results.

Repository Structure

ML-playGround/
  linear_regression/
    CR7_Analytics_Engine/
      ronaldo_goals.py
      ronaldo_mock_match_dataset.csv
    PolyRegression/
      icecreamsellingpred.py
      Ice_cream selling data.csv
    Comparision_research/
      ComparativeStudyON_LR,PR,RR.ipynb
      Comparative_research_LR_PR_RR.pdf
  LogisticRegression/
    stress detection/
      README.md
      Stress_Detection.ipynb

Current Projects

Linear Regression

CR7 Analytics Engine

Location:

linear_regression/CR7_Analytics_Engine/

This project uses a mock Cristiano Ronaldo match dataset to practice a basic linear regression workflow for predicting goals from match statistics.

It includes:

  • Loading match data from a CSV file
  • Inspecting competition counts
  • Encoding categorical competition data with one-hot encoding
  • Splitting the data into training and testing sets
  • Training a LinearRegression model
  • Reviewing model intercepts and feature coefficients
  • Comparing actual goals with predicted goals
  • Calculating Mean Absolute Error
  • Plotting actual vs. predicted goals

Run it from the project folder:

cd linear_regression\CR7_Analytics_Engine
python ronaldo_goals.py

Polynomial Regression

Ice Cream Sales Prediction

Location:

linear_regression/PolyRegression/

This project uses temperature and ice cream sales data to practice polynomial regression. It models the relationship between temperature and sales using polynomial features and a linear regression model.

It includes:

  • Loading an ice cream sales dataset from CSV
  • Exploring the dataset with summary methods
  • Checking for missing values
  • Visualizing feature relationships with Seaborn
  • Creating polynomial features with PolynomialFeatures
  • Training a LinearRegression model
  • Evaluating predictions with r2_score
  • Plotting the polynomial regression curve

Run it from the project folder:

cd linear_regression\PolyRegression
python icecreamsellingpred.py

Comparative Regression Research

Diabetes Dataset Model Comparison

Location:

linear_regression/Comparision_research/

This research notebook compares predictive performance across Linear Regression, Polynomial Regression, and Ridge Regression using the scikit-learn diabetes dataset. It focuses on how different regression approaches perform on the same dataset and how model complexity affects train/test results.

It includes:

  • Loading the diabetes dataset with load_diabetes
  • Exploring dataset shape, summary statistics, missing values, and feature distributions
  • Visualizing feature spread with histograms and box plots
  • Studying feature relationships with a correlation heatmap
  • Training and evaluating a baseline LinearRegression model
  • Creating degree-4 polynomial features with PolynomialFeatures
  • Comparing train and test performance for polynomial regression
  • Applying Ridge regression to reduce overfitting on polynomial features
  • Evaluating models with R2 score, MSE, and RMSE
  • Plotting residuals, predicted vs. actual values, and Ridge alpha performance

Open it in Jupyter:

jupyter notebook linear_regression\Comparision_research\ComparativeStudyON_LR,PR,RR.ipynb

Key takeaway: the polynomial model fits the training data very strongly, but Ridge regularization gives better test performance by controlling overfitting.

Logistic Regression

Stress Detection

Location:

LogisticRegression/stress detection/

This notebook uses a synthetic stress dataset to practice a classification workflow with logistic regression. It cleans missing values, explores health and lifestyle features, prepares categorical inputs, and evaluates a stress-label classifier.

It includes:

  • Loading a synthetic stress dataset from an Excel file
  • Filling missing numeric values with column means
  • Filling missing categorical values with the mode
  • Visualizing distributions, counts, box plots, pair plots, and correlations
  • Separating stress_label as the target variable
  • Encoding the sex feature with one-hot encoding
  • Building a Pipeline with StandardScaler and LogisticRegression
  • Evaluating accuracy with stratified 5-fold cross-validation
  • Reporting test accuracy and a classification report

Open it in Jupyter:

jupyter notebook "LogisticRegression\stress detection\Stress_Detection.ipynb"

Note: the notebook currently loads the dataset from a Google Colab path. If running locally, update the Excel file path in the data-loading cell.

Requirements

The projects use Python and common machine learning/data analysis libraries:

  • pandas
  • numpy
  • matplotlib
  • seaborn
  • scikit-learn
  • openpyxl

Install the dependencies with:

pip install pandas numpy matplotlib seaborn scikit-learn openpyxl

Planned Additions

Future folders may include projects for:

  • Decision Trees
  • Random Forest
  • K-Nearest Neighbors
  • Support Vector Machines
  • Clustering
  • Neural Networks

Notes

This repository is mainly for learning, experimentation, and building a structured machine learning portfolio over time.