Warning
This page is located in archive.

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
courses:be5b33prg:homeworks:spam:step3 [2015/12/14 14:12]
xposik [Function ''quality_score()'']
courses:be5b33prg:homeworks:spam:step3 [2015/12/14 14:24] (current)
xposik [Function ''quality_score()'']
Line 14: Line 14:
  
 ^ ''​quality_score(tp,​ tn, fp, fn) ''​ Compute the quality score based on the confusion matrix. ^^ ^ ''​quality_score(tp,​ tn, fp, fn) ''​ Compute the quality score based on the confusion matrix. ^^
-^ Inputs | 4-tuple of values ​TP, TN, FP, FN. |+^ Inputs | 4 nonnegative integers for TP, TN, FP, FN. |
 ^ Outputs | A number between 0 and 1 showing the prediction quality measure. | ^ Outputs | A number between 0 and 1 showing the prediction quality measure. |
  
Line 23: Line 23:
   * In module ''​quality.py'',​ create function ''​compute_quality_for_corpus(corpus_dir)''​ which evaluates the filter quality based on the information contained in files ''​!truth.txt''​ and ''​!prediction.txt''​ in the given corpus.   * In module ''​quality.py'',​ create function ''​compute_quality_for_corpus(corpus_dir)''​ which evaluates the filter quality based on the information contained in files ''​!truth.txt''​ and ''​!prediction.txt''​ in the given corpus.
   * The true and predicted classification can be read in the form of dictionaries using function ''​read_classification_from_file()''​.   * The true and predicted classification can be read in the form of dictionaries using function ''​read_classification_from_file()''​.
-  * The confusion matrix for the given corpus can be computed from the dictionaries using method ''​compute_from_dicts()'' ​of ''​BinaryConfusionMatrix''​ class.+  * The confusion matrix for the given corpus can be computed from the dictionaries using method ''​compute_confusion_matrix()'' ​function from step 2.
   * The quality score can be computed from the confusion matrix using function ''​quality_score()''​.   * The quality score can be computed from the confusion matrix using function ''​quality_score()''​.
  
courses/be5b33prg/homeworks/spam/step3.1450098731.txt.gz ยท Last modified: 2015/12/14 14:12 by xposik