0

I am trying to use sklearn in the following way for model prediction:

clf = MultinomialNB()

clf.fit(Xtrain,Ytrain)
Yans=clf.predict(Xtest)

But I am getting the following warning:

/usr/local/lib/python3.4/dist-packages/numpy/core/fromnumeric.py:2641: VisibleDeprecationWarning: `rank` is deprecated; use the `ndim` attribute or function instead. To find the rank of a matrix see `numpy.linalg.matrix_rank`.
  VisibleDeprecationWarning)

Because of this I am not getting the desired prediction. How can I fix this?

1
  • While this is not an error, but a warning (hence I don't understand why you don't get the desired output), you might try to downgrade your numpy installation. Commented Nov 28, 2015 at 12:20

1 Answer 1

1

It seems to be an issue with scipy. Try to upgrade it:

pip3 install --upgrade scipy
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.