Introduction to Regression in Machine Learning

 

Introduction to Regression in Machine Learning

πŸ”Ή What is Regression?

Regression is a type of supervised machine learning technique used to predict continuous (numeric) values.

πŸ‘‰ In simple terms:

Regression finds a relationship between input variables (features) and a continuous output.


πŸ”Ή  Basic Idea

We learn a function:

y=f(x)y = f(x)

Where:

  • xx → input features
  • yy → continuous output

πŸ”ΉExample

πŸ“Œ House Price Prediction

  • Inputs: area, number of rooms, location
  • Output: price

πŸ‘‰ Regression model predicts:

price=f(features)\text{price} = f(\text{features})

πŸ”Ή Types of Regression

🟦 1. Linear Regression (Most Important)

y=wx+by = wx + b
  • Simple linear relationship
  • Easy to understand and widely used

🟩 2. Multiple Linear Regression

y=w1x1+w2x2+...+by = w_1x_1 + w_2x_2 + ... + b
  • Uses multiple features

🟨 3. Polynomial Regression

  • Captures non-linear relationships

🟩 4. Logistic Regression (Classification)

  • Used when output is categorical (0 or 1).

πŸ‘‰ Instead of predicting value directly, it predicts probability.

Example

  • Spam detection
  • Disease prediction

πŸ”ΉHow Regression Works

  1. Collect data
  2. Represent data as feature vectors
  3. Choose model (e.g., linear)
  4. Define loss function (e.g., MSE)
  5. Optimize parameters

πŸ”Ή Loss Functions


πŸ“Œ Linear Regression

L=(yy^)2L = (y - \hat{y})^2

πŸ‘‰ Mean Squared Error (MSE)


πŸ“Œ Logistic Regression 

L=[ylog(y^)+(1y)log(1y^)]L = -[y \log(\hat{y}) + (1-y)\log(1-\hat{y})]

πŸ‘‰ Called Cross-Entropy Loss



πŸ”ΉApplications of Regression

🏠 1. Real Estate

  • Predict house prices

πŸ“ˆ 2. Finance

  • Stock price prediction
  • Risk analysis

🌑️ 3. Weather Forecasting

  • Temperature prediction

πŸ₯ 4. Healthcare

  • Predict patient recovery time
  • Disease Prediction

πŸš— 5. Transportation

  • Predict travel time

πŸ”Ή Advantages

  • Simple and interpretable
  • Works well for many real-world problems
  • Efficient to train

πŸ”ΉLimitations

  • Assumes relationship form (e.g., linear)
  • Sensitive to outliers
  • May underfit complex data

πŸ”Ή Regression vs Classification

Feature        Regression        Classification
Output            Continuous        Discrete
Example         Price        Spam/Not spam

πŸ“ Summary 

  • Regression models relationships between input and output variables
  • Linear regression → continuous output
  • Logistic regression → classification via probability
  • Common model:
y=wx+by = wx + b
  • Uses loss functions like MSE

Comments

Popular posts from this blog

Machine Learning PCCST503 Semester5 KTU CS 2024 Scheme - Dr Binu V P

Introduction to Machine Learning (ML)

Distinguishing Machine Learning from Traditional Programming