Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go wrong #1

Open
friend-ma opened this issue Dec 3, 2017 · 13 comments
Open

go wrong #1

friend-ma opened this issue Dec 3, 2017 · 13 comments

Comments

@friend-ma
Copy link

creating directory
Traceback (most recent call last):
File "C:/Users/Master/Desktop/enron-sender-detection-master/copy_sent_mails.py", line 80, in
save_to_folder(mailbox_owner, subFolder, file, contents)
File "C:/Users/Master/Desktop/enron-sender-detection-master/copy_sent_mails.py", line 37, in save_to_folder
os.mkdir(OUTPUT_DIR + "/" + mailboxOwner)
WindowsError: [Error 3] : 'C:\Users\Master\Desktop\enron-sender-detection-master\remail/allen-p'

Process finished with exit code 1

I tried your code with python3 and python2, but it is always an error. Why is that?

@nowshad-sust
Copy link
Owner

nowshad-sust commented Dec 3, 2017

It's just an OS issue I guess, see the line
WindowsError: [Error 3] : 'C:\Users\Master\Desktop\enron-sender-detection-master\remail/allen-p'
Here, the error shows the filepath is invalid for windows because of forward and backward slash issue

edit the code on line 33 and 37
you need to change the / into \

@friend-ma
Copy link
Author

I changed them ,but it still do't work....
in py2:
D:\python2\python.exe C:/Users/Master/Desktop/enron-sender-detection-master/copy_sent_mails.py
File "C:/Users/Master/Desktop/enron-sender-detection-master/copy_sent_mails.py", line 33
writepath = OUTPUT_DIR + "" + mailboxOwner + "" + filename
^
SyntaxError: unexpected character after line continuation character

Process finished with exit code 1

in py3:
D:\python-3.6.2\python.exe C:/Users/Master/Desktop/enron-sender-detection-master/copy_sent_mails.py
File "C:/Users/Master/Desktop/enron-sender-detection-master/copy_sent_mails.py", line 33
writepath = OUTPUT_DIR + "" + mailboxOwner + "" + filename
^
SyntaxError: unexpected character after line continuation character

Process finished with exit code 1

@friend-ma
Copy link
Author

I solved it .You did not set up a remail folder at the beginning

MAIL_DIR_PATH = os.path.abspath('maildir')
PREFIX_TRIM_AMOUNT = len(MAIL_DIR_PATH) + 1
MAX_USER_RUN_LIMIT = 500
MAX_USER_EMAILS_PER_FOLDER_FILE_LIMIT = 2000
os.mkdir("remail")
OUTPUT_DIR = os.path.abspath("remail")

@nowshad-sust
Copy link
Owner

nice! I did forget to include that in the readme.

@friend-ma
Copy link
Author

thank you very much.

@friend-ma
Copy link
Author

Do you have a reference for this project? I want to figure it out.

@friend-ma
Copy link
Author

I don't understand zhe remail subfolder named laike allen-p,arnold-j,badeer-r
?

@nowshad-sust
Copy link
Owner

@friend-ma these are names of the owners of mailboxes. These also work as tags of data for training and testing later.

@friend-ma
Copy link
Author

Naive Bayes classifier ~ 0.40( I tried)
why Naive Bayes is so low???

@friend-ma
Copy link
Author

The third program has been running, no results ... Why?

@nowshad-sust
Copy link
Owner

@friend-ma it takes time and a good amount of cpu, memory

@friend-ma
Copy link
Author

friend-ma commented Dec 7, 2017

in Naive Bayes u can set alpha =0.0001,the current rate is ~0.70

text_clf = Pipeline([('vect', CountVectorizer()), ('tfidf', TfidfTransformer()), ('clf', MultinomialNB(alpha=0.0001)), ])

@nowshad-sust
Copy link
Owner

👍
that's a good job
thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@nowshad-sust @friend-ma and others