Docsity

Supervised Learning: Perceptron, KNN, Decision Trees, Naive Bayes, Logistic Regression, SV, Study notes of Computer Science

Partial preview of the text

Download Supervised Learning: Perceptron, KNN, Decision Trees, Naive Bayes, Logistic Regression, SV and more Study notes Computer Science in PDF only on Docsity!

  • Lecture
    • Oct – 26 -

Supervised learning Summary

Perceptron

KNN

Decision treeNaïve bayes

Logistic regression

SVM

LTU

Directly learning adecisionboundary Learn P(X, Y),

or P(X|Y) Generative

model Learn P(Y|X) Discriminative

model

Lazy learning Onlinelearning

Eager learning

batch learning

A note to clarify:Logistic regression is a

probabilistic discriminative model

Methods that directly learn decision boundaries are alsoreferred to as

discriminative models

But generative models are all probabilistic and learn P(X,Y)

Supervised learning

Perceptron

KNN

Decision treeNaïve bayes

Logistic regression

SVM

Ensemble

methodsFeatureselection

Why do we have the two dashed lines? What are they useful for?

What kind of c values will likely give the following

SVM solutions for soft margin SVM?

Perceptron

KNN

Decision treeNaïve bayes

Logistic regression

SVM

Ensemble

methodsFeatureselection

C is small for this one.Because a slack onlycauses a small penalty onthe objective function, thuswe can allow it.

C is large for this one.Because a slack causes alarge penalty on theobjective function, thus wecan not afford to have it.

Supervised learning

Filter approach evaluate each featureseparately based on how related it is withthe target (y)

One scoring function: information gain

Pro: fast

Con: don’t consider interactions, don’tconsider learning algorithm

Wrapper approach searches throughfeature subsets based on how well theyperform when used by chosen learningalgorithm

Exhaustive search impractical

Greedy search: forward and backward

Pro and cons of each one?

Filter and wrapper can be combined

Perceptron

KNN

Decision treeNaïve bayes

Logistic regression

SVM

Ensemblemethods

Featureselection

Important concepts throughout

Training set, test set, validation set, hypothesis class

Overfitting

What causes it? What does it mean to overfit?

Two possible views:

-^

Too many parameters, too little data

-^

Fitting chance structure

How to avoid?

-^

Occam’s razor: use simpler models

-^

Reduce the feature set size

-^

Reduce the complexity of the decision boundaries

Increasing k for K-nn

Pruning for DT

Model selection (tightly related to overfitting)

We have seen different forms of model selection: Feature selection, parameterselection (c for SVM, k for KNN), compare and select different learningalgorithms, and so on

We can use hold-out set to select

Or use k-fold cross-validation (benefits over simple hold-out?)

Why is it a bad idea to use training error to select models?

Unsupervised learning and pattern discovery

x

1

1

,x

2

1

, x

3

1

,…, x

m

1

x

1

2

,x

2

2

, x

3

2

,…, x

m

2

x

1

n

,x

2

n

, x

3

n

,…, x

m

n

y

1 y

2 y

n

So far, our data has beenin this form:

x

1

1

,x

2

1

, x

3

1

,…, x

m

1

x

1

2

,x

2

2

, x

3

2

,…, x

m

2

x

1

n

,x

2

n

, x

3

n

,…, x

m

n

We will be looking at unlabeled data:

What do we expect to learn from such data? I have tons of data and need to:

organize them betterfind trends in themunderstand them better

Hierarchicalclustering ofweb pages

Dimension reduction for visualization

Clustering

  • Partition unlabeled examples into disjoint

subsets of

clusters

, such that:

  • Examples within a cluster are very similar– Examples in different clusters are very

different

Example Applications

Information retrieval – cluster retrieveddocuments to present more organized andunderstandable results

Image segmentation: decompose an image intoregions with coherent color and texture

Vector quantization for data Compression: groupvectors into similar groups, and use group meanto represent group members

Computational biology: group gene into co-expressed families based on their expressionprofile

Important components in clustering• Distance/similarity measure

  • How to measure the similarity between two

objects?

  • Clustering algorithm
    • How to find the clusters based on the

distance/similarity measures

  • Evaluation of results
    • How do we know that our clustering result is

good

Common distance/similarity measures

Euclidean distance

City block distance (Manhattan distance)

Cosine similarity

More flexible measures:

one can learn the appropriate weights given user guidance

Note: We can always transform between distance and similarity using a

monotonically decreasing function

∑

=

−

=

d i

i

i^

x

x

x

x

L

1

2 2 1 2 1 2 )

(

)

,

(

2 2

1

1

2

1

)

(

)

,

(

i

d i

i

i^

x x w x x D

∑

=

−

=

Flat and Hierarchical Clustering

A flat (non-hierarchical) clustering produces a singlepartition of the unlabeled data

  • Image segmentation ( distinct regions )

Hierarchical clustering builds a tree-based hierarchicaltaxonomy (

dendrogram

)

Recursive application of flat clustering can produce ahierarchical clustering.

animal

vertebrate

fish reptile

L

mammal

worm

L

insect

invertebrate