Supervised Learning Process and Linear Regression

Jun 2, 2024

Supervised Learning Process

Introduction to Linear Regression

  • Focus: Supervised learning process and linear regression model
  • Linear regression: Fitting a straight line to data, widely used
  • Concepts apply to other machine learning models

Example Problem: Predicting House Prices

  • Task: Predict the price of a house based on size
  • Data: House sizes and prices from Portland, USA

Plotting Data Points

  • Horizontal axis: Size of the house (sq ft)
  • Vertical axis: Price of the house (thousands of dollars)
  • Each data point: House with a size and a price

Use Case

  • Real estate scenario: Predict price for a 1250 sq ft house
  • Use linear regression to estimate the price: ~$220,000

Supervised Learning Model

  • Training model with data that has right answers
  • Example: House size (input) and price (output)
  • Linear regression: Predicts numbers (regression problem)

Types of Supervised Learning

  • Regression Model: Predicts numbers (e.g., house prices)
    • Linear regression, other regression models
  • Classification Model: Predicts categories
    • Examples: Cat vs Dog, medical condition prediction

Differences Between Classification and Regression

  • Classification: Finite set of possible outputs
  • Regression: Infinite number of possible outputs

Data Visualization

  • Plot on graph and as data table
  • Data Table: Inputs (size) and outputs (price)
  • Horizontal and vertical axes correspond to columns in data table

Example Data Point

  • House size: 2104 sq ft
  • Price: $400,000

Notation in Machine Learning

  • Training set: Data used to train model
  • Input variable (feature): x, e.g., size of the house
  • Output variable (target): y, e.g., price of the house

Notation Examples

  • First example: x = 2104, y = 400
  • Total training examples: m = 47
  • Single training example: (x, y) = (2104, 400)
  • Using i-th example notation: (x^(i), y^(i))
  • Superscript i: Index of training example, not exponentiation

Conclusion

  • Covered: Training set and associated notation
  • Next: Feeding training set to learning algorithm