Search
This is an old revision of the document!
Create 3 simple non-adaptive filters, paranoid, naive, and random, and evaluate their quality.
You should think about and write down on a piece of paper:
Tasks:
simplefilters.py
NaiveFilter
OK
ParanoidFilter
SPAM
RandomFilter
BaseFilter
basefilter.py
Why do we need it?
To facilitate later automatic testing of the final filter, we require your filter to be named MyFilter and defined in module filter.py. In this step, however, you shall create 3 classes called NaiveFilter, ParanoidFilter, and RandomFilter placed in module named simplefilters.py.
MyFilter
filter.py
A filter will be represented by a class with at least 2 public methods: train() and test(). Filters unable to learn from data will probably have the method train() empty. The rest of the class structure is up to you.
train()
test()
Methods train():
!truth.txt
Method test():
!prediction.txt
Create a simple script that computes the quality of a specified filter. The script shall:
compute_quality_for_corpus()