Posts

Machine Learning Lab PCCSL508 Semester 5 KTU CS 2024 Scheme - Dr Binu V P

About Me - Dr Binu V P Syllabus Learn Python well before You start(focus on numpy,pandas,matplotlib )- refer blog Build a strong understanding of the theory before moving on to programming Recommended Tools and Setup for Lab Experiments Regression  Explore Californoa Housing Dataset(learn pandas,scikit-learn and matplotlib ) Simple Linear Regression using Sample Data ( Single variable, Toy Example) Simpe Linear Regression using Sample Data ( using scikit-learn) Simple Linear regression using California Housing Dataset(CSV input) Simple Linear Regression Using California Housing Dataset (using scikit-learn) Simple Linear Regression using Gradient Descent ( Single variable, Toy Example) Simple Linear regression using Gradient Descent on California Housing Dataset Multiple Linear Regression using using Matrix Form ( Toy Dataset) Multiple Linear Regression using scikit-learn for House Price Prediction (synthetic data) Multivariate Linear Regression using Gradient Descent (Toy Dataset) ...

Explore California Housing Dataset

  California Housing Dataset 🔹 Dataset Characteristics Feature Description Number of Instances                20,640 Number of Attributes                8 numerical predictive attributes + 1 target + 1 categorical Target Variable                Median House Value 🔹 Context This dataset is used in the book “Hands-On Machine Learning with Scikit-Learn and TensorFlow” by Aurélien Géron . It is widely used as an introductory dataset for machine learning because: Requires basic preprocessing Has clear and interpretable features Is moderate in size (not too small, not too large) 🔹 Dataset Description The dataset contains information about housing in California districts based on the 1990 U.S. Census . Each row represents a census block group , which is: The smallest geographical unit used by the census Typically contains ...

Recommended Tools and Setup for Lab

  Recommended Tools  Core Stack  Tool Purpose Python           Main language Jupyter Notebook           Interactive lab work NumPy           Numerical computation Pandas           Data handling Matplotlib / Seaborn           Visualization Scikit-learn           ML algorithms Advanced Tools  Tool Use Google Colab      No-install lab  Kaggle Notebooks      datasets + practice TensorFlow / PyTorch           neural networks Streamlit      mini project deployment  Best Offline Setup (Recommended)  Use Anaconda (Easiest) This is the best choice for students . 🔹 Steps: Download Anaconda from  https://www.anaconda.com/download Install it It includes: Python Jupyter Notebook NumPy, ...

Implementation of Multivariate Linear Regression using Gradient Descent (Toy Dataset)

Image
  Experiment  Implementation of Multivariate Linear Regression using Gradient Descent (Toy Dataset) 🎯 Aim To implement multivariate linear regression using gradient descent and evaluate its performance. 🎯 Objectives Understand multivariate regression Implement gradient descent manually Train model on sample dataset Compute MSE and R² Visualize cost convergence 📖 Theory 🔹 Multivariate Linear Regression Model y ^ = θ 0 + θ 1 x 1 + θ 2 x 2 + ⋯ + θ n x n \hat{y} = \theta_0 + \theta_1 x_1 + \theta_2 x_2 + \dots + \theta_n x_n ​ Matrix form: y ^ = X θ \hat{y} = X\theta 🔹 Cost Function (MSE) J ( θ ) = 1 n ∑ ( y − y ^ ) 2 J(\theta) = \frac{1}{n} \sum (y - \hat{y})^2 🔹 Gradient Descent Update Rule θ = θ − α ⋅ 2 n X T ( X θ − y ) \theta = \theta - \alpha \cdot \frac{2}{n} X^T (X\theta - y) 🔹 Evaluation Metrics Mean Squared Error (MSE): M S E = 1 n ∑ ( y − y ^ ) 2 MSE = \frac{1}{n} \sum (y - \hat{y})^2 R-squared (R²): R 2 = 1 − S S r e s S S t o ...