Warning
This page is located in archive. Go to the latest version of this course pages.

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 Both sides next revision
courses:be5b33prg:homeworks:spam:step2 [2015/11/25 16:29]
xposik [Preparation]
courses:be5b33prg:homeworks:spam:step2 [2015/11/25 16:30]
xposik [Specifications]
Line 27: Line 27:
   * Function ''​compute_confusion_matrix()''​ represents the basis for evaluation of the filter performance.   * Function ''​compute_confusion_matrix()''​ represents the basis for evaluation of the filter performance.
   * The function can be used in the following way:<​code python>   * The function can be used in the following way:<​code python>
-    ​>>>​ cm1 = compute_confusion_matrix({},​ {}) +>>>​ cm1 = compute_confusion_matrix({},​ {}) 
-    >>>​ print(cm1) +>>>​ print(cm1) 
-    ConfMat(tp=0,​ tn=0, fp=0, fn=0)+ConfMat(tp=0,​ tn=0, fp=0, fn=0)
 </​code>​or<​code python> </​code>​or<​code python>
-    ​>>>​ truth_dict = {'​em1':​ '​SPAM',​ '​em2':​ '​SPAM',​ '​em3':​ '​OK',​ '​em4':'​OK'​} +>>>​ truth_dict = {'​em1':​ '​SPAM',​ '​em2':​ '​SPAM',​ '​em3':​ '​OK',​ '​em4':'​OK'​} 
-    >>>​ pred_dict = {'​em1':​ '​SPAM',​ '​em2':​ '​OK',​ '​em3':​ '​OK',​ '​em4':'​SPAM'​} +>>>​ pred_dict = {'​em1':​ '​SPAM',​ '​em2':​ '​OK',​ '​em3':​ '​OK',​ '​em4':'​SPAM'​} 
-    >>>​ cm2 = compute_confusion_matrix(truth_dict,​ pred_dict, pos_tag='​SPAM',​ neg_tag='​OK'​) +>>>​ cm2 = compute_confusion_matrix(truth_dict,​ pred_dict, pos_tag='​SPAM',​ neg_tag='​OK'​) 
-    >>>​ print(cm2) +>>>​ print(cm2) 
-    ConfMat(tp=1,​ tn=1, fp=1, fn=1)+ConfMat(tp=1,​ tn=1, fp=1, fn=1)
 </​code>​ </​code>​
  
courses/be5b33prg/homeworks/spam/step2.txt · Last modified: 2015/12/04 14:22 by svobodat