-1

I'm training data on anaconda3 to make chatbot with rasa.com and spacy + sklearn. While in training even came out like this, I know this does not cause errors, but it is quite disturbing for me. Why can it appear like this? and how to eliminate it?


C:\Program Files\Anaconda3\lib\site-packages\sklearn\preprocessing\label.py:151: 
DeprecationWarning: The truth value of an empty array is ambiguous. Returning False, but in future this will result in an error. Use `array.size > 0` to check that an array is not empty.
Vivek Kumar
  • 29,214
  • 6
  • 80
  • 113
  • Please post the code that is causing this. It says you are operating on a empty array. – Stev Mar 29 '18 at 12:56
  • @Stev it's not his code directly that's causing the warning, it's happening within sklearn – Neil Apr 05 '18 at 15:25

2 Answers2

0

Maybe you can upgrade sklearn.

pip install scikit-learn --upgrade
djangoliv
  • 1,384
  • 9
  • 21
0

This appears to be a duplicate of this question: deprecation error in sklearn about empty array without any empty array in my code

It isn't related to Anaconda 3 as the title implies, it's appearing for you because of Rasa using sklearn which in turn is doing something slightly ill advised with numpy

I won't repeat all the details from the question I linked to, but it is due to be fixed in sklearn and when Rasa moves to depend on the fixed version you will no longer see it.

Because it is just a warning, you can safely ignore it. Sorry to hear you are disturbed by it (it's best to stay calm!)

As I understand it, the way the numpy authors implemented it, the warning is difficult to suppress. If you really have to hide it, you could theoretically tinker with the code in your installed packages but I don't think this is worth the risk of accidentally breaking things.

Neil
  • 625
  • 1
  • 7
  • 24
  • You may want to take a look at this newer similar answer: https://stackoverflow.com/a/49668081/142780 - the author of that one identified a way to suppress the warnings, something I hadn't managed to do (I'd tried both the methods the questioner mentioned didn't work!) – Neil Apr 11 '18 at 23:59