Lect3 Supervised1
Lect3 Supervised1
Lect3 Supervised1
learning:
Classification and
Regression
CCCS 416 Applied machine learning
https://link.springer.com/chapter/10.1007%2F978-1-4842-6513-0_2
Outline
qSupervised leaning
qClassification vs regression
qGeneralization, overfitting, and underfitting
APPLIED MACHINE
LEARNING IN PYTHON
https://www.slideshare.net/EdurekaIN/linear-regression-vs-logistic-regression-edureka
Classification vs regression
https://in.springboard.com/blog/regression-vs-classification-in-machine-learning/
Supervised Learning
APPLIED MACHINE
LEARNING IN PYTHON
(classification example)
Training set Future sample
X Y
Sample Target Value (Label)
Classifier
𝑥𝑥1 Apple 𝑦𝑦1 f : X →Y
"cat"
"cat"
Clicking and reading the "Mackinac Island" result can be
an implicit label for the search engine to learn that
"dog" "Mackinac Island" is especially relevant for the query
[vacations in michigan] for that specific user.
Crowdsourcing platform
APPLIED MACHINE
LEARNING IN PYTHON
Feature Representations
Feature Count Feature representation
to 1
To: Chris Brooks chris 2
From: Daniel Romero brooks 1
Email Subject: Next course offering
Hi Daniel,
from 1 A list of words with
daniel 2
Could you please send the outline for the romero 1
their frequency counts
next course offering? Thanks! -- Chris the 2
...
Feature Value
DorsalFin Yes
Sea Creatures MainColor
Stripes
Orange
Yes A set of attribute values
StripeColor1 White
StripeColor2 Black
Length 4.3 cm
APPLIED MACHINE
LEARNING IN PYTHON
Predicted class
(apple)
APPLIED MACHINE
LEARNING IN PYTHON
Evaluation
APPLIED MACHINE
LEARNING IN PYTHON
Feature and
model Evaluation
refinement
APPLIED MACHINE
LEARNING IN PYTHON
lemon
height
apple
orange
Credit: Original version of the fruit dataset created by Dr. Iain Murray, Univ. of Edinburgh
APPLIED MACHINE
LEARNING IN PYTHON
…
X_train, X_test, y_train, y_test
= train_test_split(X, y)
Coding Example
• Training and test sets
• Model/Estimator
– Model fitting
produces a 'trained
model'.
– Training is the
process of estimating
model parameters.
• Evaluation method
APPLIED MACHINE
LEARNING IN PYTHON
Overfitting in regression
Target variable
Input variable
APPLIED MACHINE
LEARNING IN PYTHON
Overfitting in classification
Feature 2
Feature 1
Summary of today’s lesson
• Supervised machine learning learn to predict target values from labelled data.
• Classification is the task for predicting discrete values while regression is for
predicting continuous values.
• Represent, train, evaluate, refine cycle.
• Models that are too complex (overfit) or too simple (underfit) decreases the
algorithm ability to generalize