Table of Contents

Spam filter - step 3

Create additional functions needed to evaluate the filter quality.

Function ''quality_score()''

Task:

quality_score(tp, tn, fp, fn) Compute the quality score based on the confusion matrix.
Inputs 4 nonnegative integers for TP, TN, FP, FN.
Outputs A number between 0 and 1 showing the prediction quality measure.
 

Function ''compute_quality_for_corpus()''

Task:

Why do we need it?

compute_quality_for_corpus(corpus_dir) Compute the quality of predictions for given corpus.
Inputs A corpus directory evaluated by a filter (i.e. a directory containing !truth.txt and !prediction.txt files).
Outputs Quality of the filter as a number between 0 and 1.