You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hi @burbma, @bearnshaw , thanks for the package, it's been super useful so far. I ran into some issues when trying using blslda.fit(). I used the sklearn package to generate the document-term matrix, but when I tried to pass it into the blslda.fit() function I got the error : "Cannot cast array data from dtype('float64') to dtype('int64') according to the rule 'safe'".
The full traceback is:
TypeError Traceback (most recent call last)
~/anaconda3/lib/python3.6/site-packages/numpy/core/fromnumeric.py in _wrapfunc(obj, method, *args, **kwds)
51 result = wrap(result)
---> 52 return result
53
TypeError: Cannot cast array data from dtype('float64') to dtype('int64') according to the rule 'safe'
During handling of the above exception, another exception occurred:
~/anaconda3/lib/python3.6/site-packages/numpy/core/fromnumeric.py in repeat(a, repeats, axis)
421 mode : {'raise', 'wrap', 'clip'}, optional
422 Specifies how out-of-bounds indices will behave.
--> 423
424 * 'raise' -- raise an error (default)
425 * 'wrap' -- wrap around
~/anaconda3/lib/python3.6/site-packages/numpy/core/fromnumeric.py in _wrapfunc(obj, method, *args, **kwds)
60 # such a method in its class.
61
---> 62 # A TypeError occurs if the object does have such a method
63 # in its class, but its signature is not identical to that
64 # of NumPy's. This situation has occurred in the case of
~/anaconda3/lib/python3.6/site-packages/numpy/core/fromnumeric.py in _wrapit(obj, method, *args, **kwds)
40
41 # functions that are now methods
---> 42 def _wrapit(obj, method, *args, **kwds):
43 try:
44 wrap = obj.array_wrap
TypeError: Cannot cast array data from dtype('float64') to dtype('int64') according to the rule 'safe'
Thank you in advance!
The text was updated successfully, but these errors were encountered:
hi @burbma, @bearnshaw , thanks for the package, it's been super useful so far. I ran into some issues when trying using blslda.fit(). I used the sklearn package to generate the document-term matrix, but when I tried to pass it into the blslda.fit() function I got the error : "Cannot cast array data from dtype('float64') to dtype('int64') according to the rule 'safe'".
The full traceback is:
TypeError Traceback (most recent call last)
~/anaconda3/lib/python3.6/site-packages/numpy/core/fromnumeric.py in _wrapfunc(obj, method, *args, **kwds)
51 result = wrap(result)
---> 52 return result
53
TypeError: Cannot cast array data from dtype('float64') to dtype('int64') according to the rule 'safe'
During handling of the above exception, another exception occurred:
TypeError Traceback (most recent call last)
in ()
~/anaconda3/lib/python3.6/site-packages/slda/topic_models.py in fit(self, X, y)
286 self.n_docs, self.n_terms = X.shape
287 self.n_tokens = X.sum()
--> 288 doc_lookup, term_lookup = self._create_lookups(X)
289 # iterate
290 self.theta, self.phi, self.eta, self.loglikelihoods = gibbs_sampler_blslda(
~/anaconda3/lib/python3.6/site-packages/slda/topic_models.py in _create_lookups(self, X)
37 else:
38 x = X[docs, terms]
---> 39 doc_lookup = np.ascontiguousarray(np.repeat(docs, x), dtype=np.intc)
40 term_lookup = np.ascontiguousarray(np.repeat(terms, x), dtype=np.intc)
41 return doc_lookup, term_lookup
~/anaconda3/lib/python3.6/site-packages/numpy/core/fromnumeric.py in repeat(a, repeats, axis)
421 mode : {'raise', 'wrap', 'clip'}, optional
422 Specifies how out-of-bounds indices will behave.
--> 423
424 * 'raise' -- raise an error (default)
425 * 'wrap' -- wrap around
~/anaconda3/lib/python3.6/site-packages/numpy/core/fromnumeric.py in _wrapfunc(obj, method, *args, **kwds)
60 # such a method in its class.
61
---> 62 # A TypeError occurs if the object does have such a method
63 # in its class, but its signature is not identical to that
64 # of NumPy's. This situation has occurred in the case of
~/anaconda3/lib/python3.6/site-packages/numpy/core/fromnumeric.py in _wrapit(obj, method, *args, **kwds)
40
41 # functions that are now methods
---> 42 def _wrapit(obj, method, *args, **kwds):
43 try:
44 wrap = obj.array_wrap
TypeError: Cannot cast array data from dtype('float64') to dtype('int64') according to the rule 'safe'
Thank you in advance!
The text was updated successfully, but these errors were encountered: