Lec2 Intro To ML
Lec2 Intro To ML
Introduction to machine
learning
CSCI-P 556
ZORAN TIGANJ
2
Today
u In supervised learning, the training set you feed to the algorithm includes
the desired solutions, called labels
8
Supervised learning
u In supervised learning, the training set you feed to the algorithm includes
the desired solutions, called labels
9
Supervised learning algorithms
u Logistic Regression
u Support Vector Machines (SVMs)
u Decision Trees and Random Forests
10
Unsupervised learning
u In online learning, you train the system incrementally by feeding it data batch learning: trained on all available
data
instances sequentially, either individually or in small groups called online learning: incrementally by
minibatches.
feeding in data sequentially. mini-
batches
u Each learning step is fast and cheap, so the system can learn about new out-of-core learning: Out-of-core
data on the fly, as it arrives algorithms can handle vast quantities
of data that cannot fit in a computer's
main memory. An out-of-core learning
algorithm chops the data into mini-
batches and uses online learning
techniques to learn from these mini-
batches.
19
Instance-Based Versus Model-Based
Learning
u Instance-based learning: the system learns the examples by heart, then
generalizes to new cases by using a similarity measure to compare them to
the learned examples (or a subset of them).
20
Instance-Based Versus Model-Based
Learning
u Model-based learning: build a model of the available examples and then
use that model to make predictions.
21
Model-based learning: example
Model selection: we select a simple linear model with two parameters, θ0 and θ1 :
life_satisfaction = θ0 + θ1 × GDP_per_capita
23
Model-based learning: example
Model selection: we select a simple linear model with two parameters, θ0 and θ1:
life_satisfaction = θ0 + θ1 × GDP_per_capita
24
Model-based learning: example
Model selection: we select a simple linear model with two parameters, θ0 and θ1 :
life_satisfaction = θ0 + θ1 × GDP_per_capita
25
Model-based learning: example
u Poor-Quality Data
u If some instances are clearly outliers, it may help to simply discard them or try to
fix the errors manually.
u If some instances are missing a few features (e.g., 5% of your customers did not
specify their age), you must decide whether you want to ignore this attribute
altogether, ignore these instances, fill in the missing values (e.g., with the median
age), or train one model with the feature and one model without it.
30
Main Challenges of Machine Learning
u Irrelevant Features:
u garbage in, garbage out
u feature engineering can help (selecting the most useful features to train on
among existing features)
31
Main Challenges of Machine Learning
Feature extraction: combining existing features to produce a more useful one (as
we saw earlier, dimensionality reduction algorithms can help).
33
Testing and Validating
u To ensure that our algorithm is not overfitting the training data it is common
to split the data into two sets:
u the training set and
u the test set
u You train your model using the training set, and you test it using the test set.
u The error rate on new cases is called the generalization error (or out-of-
sample error),
Overfitting:
Low training error score but high generalization error
34
Hyperparameter Tuning and Model
Selection
A hyperparameter is a parameter of the learning algorithm itself, not of the model (e.g., the amount of regularization to apply). i.e. learning rate,
batch size, no. of epochs
36
Next time