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
Previous revision
courses:be5b33prg:homeworks:spam:step1 [2015/11/26 09:12]
xposik
courses:be5b33prg:homeworks:spam:step1 [2015/11/30 15:29]
xposik [Specifications]
Line 50: Line 50:
 Function ''​read_classification_from_file()''​ (in module ''​utils.py''​) has to conform to the following specifications: ​ Function ''​read_classification_from_file()''​ (in module ''​utils.py''​) has to conform to the following specifications: ​
  
 +^ ''​read_classification_from_file(fpath)''​ ^^
 ^  Input  | The path to the text file (most likely either ''​!truth.txt''​ or ''​!prediction.txt''​) ​ | ^  Input  | The path to the text file (most likely either ''​!truth.txt''​ or ''​!prediction.txt''​) ​ |
 ^  Output ​ | A dictionary containing either ''​SPAM''​ or ''​OK''​ label for each filename in email corpus. ​ | ^  Output ​ | A dictionary containing either ''​SPAM''​ or ''​OK''​ label for each filename in email corpus. ​ |
Line 59: Line 60:
 email03 SPAM email03 SPAM
 email1234 OK email1234 OK
-... 
 </​code>​ </​code>​
 and creates a dictionary (the order of individual "​rows"​ in the following listing is not important): and creates a dictionary (the order of individual "​rows"​ in the following listing is not important):
Line 84: Line 84:
  
 ^ ''​write_classification_to_file(cls_dict,​ fpath)''​ ^^ ^ ''​write_classification_to_file(cls_dict,​ fpath)''​ ^^
-^  Inputs ​ | (1) dictionary containing the email file names as keys, and email classes (''​SPAM''​ or ''​OK''​) as values.+^  Inputs ​ | (1) dictionary containing the email file names as keys, and email classes (''​SPAM''​ or ''​OK''​) as values. ​|
 ^          | (2) The path to the text file that shall be created. ​ | ^          | (2) The path to the text file that shall be created. ​ |
 ^  Output ​ | None.  | ^  Output ​ | None.  |
courses/be5b33prg/homeworks/spam/step1.txt · Last modified: 2015/11/30 15:29 by xposik