Note that there are some explanatory texts on larger screens.

plurals
  1. POPython NLTK Maximum Entropy Classifier Error
    text
    copied!<p>I'm currently using NLTK's Naive Bayes classifier, however I also wanted to try out the Max Ent classifier. It seems from the documentation that it should take the same format for the feature set as the Naive Bayes, but for some reason I am getting this error when I try it:</p> <pre><code> File "/usr/lib/python2.7/site-packages/nltk/classify/maxent.py", line 323, in train gaussian_prior_sigma, **cutoffs) File "/usr/lib/python2.7/site-packages/nltk/classify/maxent.py", line 1453, in train_maxent_classifier_with_scipy model.fit(algorithm=algorithm) File "/usr/lib64/python2.7/site-packages/scipy/maxentropy/maxentropy.py", line 1026, in fit return model.fit(self, self.K, algorithm) File "/usr/lib64/python2.7/site-packages/scipy/maxentropy/maxentropy.py", line 226, in fit callback=callback) File "/usr/lib64/python2.7/site-packages/scipy/optimize/optimize.py", line 636, in fmin_cg gfk = myfprime(x0) File "/usr/lib64/python2.7/site-packages/scipy/optimize/optimize.py", line 176, in function_wrapper return function(x, *args) File "/usr/lib64/python2.7/site-packages/scipy/maxentropy/maxentropy.py", line 420, in grad G = self.expectations() - self.K ValueError: shape mismatch: objects cannot be broadcast to a single shape </code></pre> <p>I'm not sure what this means, but I am using the same exact input as I am when I run Naive Bayes and that works.(Training data, represented as a list of pairs, the first member of which is a featureset, and the second of which is a classification label.) Any ideas?</p> <p>Thanks!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload