Python Forum
Thread Rating:
  • 2 Vote(s) - 1.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Naive Bayes too slow
#7
(Oct-21-2016, 10:18 PM)snippsat Wrote:
(Oct-21-2016, 09:52 PM)pythlang Wrote: EDIT: What could be causing this to happen?
You have downloaded all  NLTK data?
>>> import nltk >>> nltk.download()
Quote: A new window should open, showing the NLTK Downloader. Click on the File menu and select Change Download Directory. For central installation, set this to C:\nltk_data (Windows), /usr/local/share/nltk_data (Mac), or /usr/share/nltk_data (Unix). Next, select the packages or collections you want to download.

Jordans-MBP:~ jordan$ which python
/usr/bin/python
Jordans-MBP:~ jordan$ python
Python 2.7.10 (default, Jul 30 2016, 18:31:42) 
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path
['', '/Library/Python/2.7/site-packages/pip-8.1.2-py2.7.egg', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload', '/Users/jordanXXX/Library/Python/2.7/lib/python/site-packages', '/Library/Python/2.7/site-packages', '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python', '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC']
>>> quit()
Jordans-MBP:~ jordan$ python3
Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 26 2016, 10:47:25) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path
['', '/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/nltk-3.2.1-py3.5.egg', '/Library/Frameworks/Python.framework/Versions/3.5/lib/python35.zip', '/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5', '/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/plat-darwin', '/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/lib-dynload', '/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages']
>>> 
>>> import nltk.data
path in nltk.data.path
>>> path in nltk.data.path
True
>>> import os, os.path
>>> path = os.path.expanduser('~/nltk_data')
>>> if not os.path.exists(path):
...     os.mkdir(path)
...     os.path.exists(path)
... 
>>> import nltk.data
>>> path in nltk.data.path
True
>>> 
as far as I know i've downloaded all the note data or otherwise i probably wouldn't be able to use these tools and would run into  something like this which has happened when i tried to use matplotlib for the first time.
Error:
no module named "X"
are the installed paths for python3 and nltk_data ok?
Reply


Messages In This Thread
Naive Bayes too slow - by pythlang - Oct-21-2016, 09:22 PM
RE: Naive Bayes too slow - by snippsat - Oct-21-2016, 09:48 PM
RE: Naive Bayes too slow - by pythlang - Oct-21-2016, 09:52 PM
RE: Naive Bayes too slow - by Ofnuts - Oct-21-2016, 10:03 PM
RE: Naive Bayes too slow - by pythlang - Oct-21-2016, 10:07 PM
RE: Naive Bayes too slow - by snippsat - Oct-21-2016, 10:18 PM
RE: Naive Bayes too slow - by pythlang - Oct-21-2016, 11:45 PM
RE: Naive Bayes too slow - by pythlang - Oct-22-2016, 01:32 AM
RE: Naive Bayes too slow - by Larz60+ - Oct-22-2016, 02:42 AM
RE: Naive Bayes too slow - by pythlang - Oct-22-2016, 06:19 PM
RE: Naive Bayes too slow - by Larz60+ - Oct-22-2016, 09:06 PM
RE: Naive Bayes too slow - by pythlang - Oct-22-2016, 09:09 PM
RE: Naive Bayes too slow - by Larz60+ - Oct-22-2016, 09:15 PM
RE: Naive Bayes too slow - by pythlang - Oct-22-2016, 09:29 PM
RE: Naive Bayes too slow - by pythlang - Oct-24-2016, 12:49 AM
RE: Naive Bayes too slow - by Larz60+ - Oct-24-2016, 03:15 AM
RE: Naive Bayes too slow - by pythlang - Oct-24-2016, 12:44 PM
RE: Naive Bayes too slow - by sparkz_alot - Oct-24-2016, 01:20 PM
RE: Naive Bayes too slow - by Larz60+ - Oct-24-2016, 02:58 PM
RE: Naive Bayes too slow - by pythlang - Oct-24-2016, 03:06 PM
RE: Naive Bayes too slow - by snippsat - Oct-24-2016, 03:17 PM
RE: Naive Bayes too slow - by pythlang - Oct-24-2016, 04:53 PM
RE: Naive Bayes too slow - by pythlang - Oct-25-2016, 01:57 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [nltk] Naive Bayes Classifier constantin01 0 2,050 Jun-24-2019, 10:36 AM
Last Post: constantin01

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020