Comments (3)
Sorry about the trouble, Henrik. I just re-ran this example and it works fine for me. I prepared a simpler example for debugging, using only 100 samples from the movie dataset. Maybe you could try execute them on your system so that we could maybe get a better idea of what's going on. Attached are 4 files, the small movie dataset, the vectorizer.py script, and the 2 scripts to execute. The first one, ch08_pickle-dump-test.py, creates the classifier and stopword pickle files, and the second one, python ch08_pickle-load-test.py, loads the vectorizer and the classifier to make a prediction. The files should be all in the same directory, e.g., just put them on your desktop or so.
When I execute the two files, I get the following ...
~/Desktop$ python ch08_pickle-dump-test.py
~/Desktop$ python ch08_pickle-load-test.py
Prediction: positive
Probability: 85.71%
Would be nice if you could check whether they also throw this AttributeError: Can't get attribute 'tokenizer' on <module '__main__'>
so that we know more!
PS: Sorry, had to ZIP the files since GitHub complained about the attachment via a "Unfortunately, we donβt support that file type. Try again with a PNG, GIF, JPG, DOCX, PPTX, XLSX, TXT, PDF, or ZIP.").
pickle-debugging-1.zip
Best,
Sebastian
from python-machine-learning-book.
Thanks for a fast reply, trying your new example works. And after changes to a new conda virtual env i could also get my code working, must have messed something up in the env.
from python-machine-learning-book.
Glad to here that it was such an "easy" fix and not a deeper problem with the code itself :)
from python-machine-learning-book.
Related Issues (20)
- Machine learning HOT 1
- i need to find somebody who can automate a trading strategy HOT 1
- ch.06(Tuning hyperparameters via grid search) HOT 4
- mlxtend no longer has tf_classifier HOT 3
- ValueError: operands could not be broadcast together with shapes HOT 1
- Chapter 8: Shuffling the DataFrame in newer versions of pandas HOT 1
- ValueError: operands could not be broadcast together with shapes (400,2) (400,)
- AttributeError: 'SGDClassifier' object has no attribute 'max_iter' HOT 1
- Chapter 15: Padding modes figure HOT 1
- Notebook error HOT 2
- IndexError: too many indices for array in CH-5 PCA Plot Code HOT 3
- Python Machine learning
- ValueError: operands could not be broadcast together with shapes (200,) (30000,) HOT 1
- Machine Learning (Python)
- Hello Kaggle! It is a guide for new kaggler
- How to Use the code files HOT 2
- [QUESTION] in ch3.py line 64 HOT 3
- why this is the self.eta*X.T.dot(errors) rather than the -self.eta*X.T.dot(errors) HOT 1
- Graph of curve is misleading HOT 1
- Python machine learning HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-machine-learning-book.