Week 1 Lecture 4: Evaluation and Cross Validation

Week 1 Lecture 4: Evaluation and Cross Validation

Given a hypothesis space H and training data S, the learning algo comes up with a function h. To understand how good the h is, we need to evaluate it using experimental evaluation, ie having a metric using which we evaluate, eg

These evaluations are done on the training set or even better a seperate test set.

Given y’ = h(x) is a prediction on x and y is the actual value. If y’ differs from y, we have an error.

Types of errors:

Definitions:

In classification, we define a confusion matrix

Hyp Class\True ClassPositiveNegative
PositiveTrue Positive[TP]False Positive[FP]
NegativeFalse Negative[FN]True Negative[TN]
∑ = P∑ = N

Obviously the diagonal elements are either all true or all false

Accuracy = (TP + TN) / (P + N)

\How many are correctly predicted

Precision = TP/ (TP + FP)

\Answers how many are correctly positive

Recall = TP / P

How many of the positive examples are retrieved as positive, also called true positive rate. False positive rate also exists.

Error Got on Sample is called sample error. The actual error is called the true error.

We split the example dataset, using a part for training the learner, and a disjoint dataset for testing the learner.

If testset is small, the varience increases.

How to test with limited data

K - Fold cross validation

  1. Split Data into K Equal subsets
  2. Perform K Rounds of learning. On each round
  1. Compute average test set score of K Rounds

Final accuracy is given by average of each of these K Subsets

Trade off [TLDR]