Comments (4)
You can use predict_proba
instead of predict
to get class
probabilities.
Thanks.
On Mon, Feb 8, 2016 at 4:33 PM, michael4john [email protected]
wrote:
I'm looking at the text_classificationpy
classifierpredict(X-test) gets the class number with the highest
probability But I wonder how to get the probabilities for all the classes
per inputThanks in advance!
—
Reply to this email directly or view it on GitHub
#95.
from skflow.
Thanks for the prompt response, @terrytangyuan . predict_proba does work, but it returns me 15 probabilities, which I think has something to do with the n_classes argument of the TensorFlowEstimator function. I changed it to 5 because I only have 5 categories to predict, but the following error message is returned:
Traceback (most recent call last):
File "search_classification.py", line 88, in
classifier.fit(X_train, y_train, logdir='/tmp/tf_examples/word_rnn')
File "/home/fz1662/skflow/estimators/base.py", line 214, in fit
feed_params_fn=self._data_feeder.get_feed_params)
File "/home/fz1662/skflow/trainer.py", line 143, in train
feed_dict = feed_dict_fn()
File "/home/fz1662/skflow/io/data_feeder.py", line 212, in _feed_dict_fn
out.itemset((i, self.y[sample]), 1.0)
IndexError: index 5 is out of bounds for axis 1 with size 5
from skflow.
@michael4john If you are only have 5 classes then this errors indicates that you are using 1-based identification for them. You should make sure your classes are all indexes from 0 to n_classes - 1.
Note, you can always use some of skflow.preprocessing.CategoricalProcessor
functionality to remap output classes into 0 to 4.
from skflow.
@ilblackdragon I reindexed my dataset from 0 to 4. And it works! Thank you so much!
from skflow.
Related Issues (20)
- Verbose is not considered during the training. HOT 1
- need more models in skflow.models HOT 2
- seq2seq example doesn't work HOT 1
- IndexError: index 20860 is out of bounds for axis 0 with size 18805 HOT 3
- TypeError inside skflow HOT 1
- text_classification.py giving error HOT 2
- skflow and tensorboard HOT 1
- Conditional RBM and distributed computing HOT 1
- can not run two tensorflow program one by one HOT 1
- Exception in the Custom model example HOT 2
- Scikitflow documentation update requested HOT 1
- getting none values not supported error HOT 3
- neural_translation.py showing error HOT 4
- Exception when restore DNN model HOT 1
- Tensor name "hiddenlayer_2/biases" not found in checkpoint files HOT 1
- checkpoint can't be restored... HOT 1
- DNNClassifier init failed HOT 1
- Why hasn't this repo been archived yet?
- Is this project still working? HOT 1
- .travis.yml: The 'sudo' tag is now deprecated in Travis CI 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 skflow.