sci-kit learn: Reshape your data either using X.reshape(-1, 1)

后端 未结 6 1440
再見小時候
再見小時候 2021-02-04 20:56

I\'m training a python (2.7.11) classifier for text classification and while running I\'m getting a deprecated warning message that I don\'t know which line in my code is causin

6条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-04 21:13

    If you want to find out where the Warning is coming from you can temporarly promote Warnings to Exceptions. This will give you a full Traceback and thus the lines where your program encountered the warning.

    with warnings.catch_warnings():
        warnings.simplefilter("error")
        main()
    

    If you run the program from the commandline you can also use the -W flag. More information on Warning-handling can be found in the python documentation.

    I know it is only one part of your question I answered but did you debug your code?

提交回复
热议问题