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

后端 未结 6 1437
再見小時候
再見小時候 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:29

    2 solution: philosophy___make your data from 1D to 2D

    1. Just add: []

      vec = [vec]
      
    2. Reshape your data

      import numpy as np
      vec = np.array(vec).reshape(1, -1)
      

提交回复
热议问题