Classify Takes 3-5 minutes to run
Closed this issue · 3 comments
jmwaks commented
My code is giving the correct output but takes 3-5 minutes to go through all the documents. Is this expected?
aronwc commented
Please try to make it more efficient. Mine runs in ~2-3 seconds.
To help, you should only have to pass through the documents once during
training (to count all the token frequencies).
-Aron
On Mon, Mar 28, 2016 at 3:44 PM, jmwaks notifications@github.com wrote:
My code is giving the correct output but takes 3-5 minutes to go through
all the documents. Is this expected?—
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#148
jmwaks commented
Thanks. I will improve that.
AyeshaAhmed commented
Yes I had the same problem. Found 2 fixes:
- I iterated over train documents twice
- in train function I used spam_terms = collections.Counter(num_of_spams)