1 of 10

Regression

Adapted from Lecture Notes Machine-Learning Regression (CS102-Spring 2020)

Stanford

Asrul Abdullah

Universitas Muhammadiyah Pontianak

www.asrulabdullah.my.id

inovasi, kolaborasi & integritas

2 of 10

Machine Learning

Using data to build models and make predictions

Supervised Learning

Regression

Classification

Set of labeled examples to learn from :training data

Develop model from training data

Use model to make predictions about new data

​

Supervised

Training data, each example :

Set of predictor values – “independent variables”

Numeric output values – “dependent variable”

Ex : Predictors : mother height, father height, current_age, Output : height

Like regression except output values are labels or categories

Example

Predictor values: age, gender, income, profession

Output value: buyer, non-buyer

Universitas Muhammadiyah Pontianak

www.asrulabdullah.my.id

inovasi, kolaborasi & integritas

3 of 10

Regression

  • Set of predictor values – “independent variables”
  • Numeric output value – “dependent variable”
  • Model is function from predictors to output

Universitas Muhammadiyah Pontianak

www.asrulabdullah.my.id

inovasi, kolaborasi & integritas

4 of 10

Regression

Goal: Function f applied to training data should produce values as close as possible in aggregate to actual outputs

Universitas Muhammadiyah Pontianak

www.asrulabdullah.my.id

inovasi, kolaborasi & integritas

5 of 10

Simple Linear Regression

  • One numeric predictor value, call it x
  • One numeric output value, call it y
  • Data items are points in two-dimensional space

Universitas Muhammadiyah Pontianak

www.asrulabdullah.my.id

inovasi, kolaborasi & integritas

6 of 10

Simple Linear Regression

  • One numeric predictor value, call it x
  • One numeric output value, call it y
  • Function f(x) = y that are lines

​

Universitas Muhammadiyah Pontianak

www.asrulabdullah.my.id

inovasi, kolaborasi & integritas

7 of 10

Simple Linear Regression

  • Functions f(x)=y that are lines: y = a x + b

y = 0.8x + 2.6

Universitas Muhammadiyah Pontianak

www.asrulabdullah.my.id

inovasi, kolaborasi & integritas

8 of 10

Correlation and Causation

Correlation – Values track each other

  • Grades and GPA Scores
  • Height and Shoe Size

Causation – One value directly influences another

  • Education level Starting salary
  • Temperatures Cold drink sales

Universitas Muhammadiyah Pontianak

www.asrulabdullah.my.id

inovasi, kolaborasi & integritas

9 of 10

Regression and Correlation

  • Linear functions only
  • Correlation positively – when one goes up the other goes up
  • Correlation negatively – when one goes up the other goes down

Ex : latitude versus temperature, car weight versus gas mileage, class absence versus final grade

Universitas Muhammadiyah Pontianak

www.asrulabdullah.my.id

inovasi, kolaborasi & integritas

10 of 10

Hands on

Job Salary

Universitas Muhammadiyah Pontianak

www.asrulabdullah.my.id

inovasi, kolaborasi & integritas