1
resposta

+ Dúvidas

Olá, continue travado no primeiro "run" eu desistalei o Python2 e tentei agora mas continuo recebendo erros :

C:\Users\Felipe\Desktop\machine_learning>python classificacao.py
Traceback (most recent call last):
  File "classificacao.py", line 21, in <module>
    print(model.predict(unknow))
  File "C:\Python27\lib\site-packages\sklearn\naive_bayes.py", line 66, in predict
    jll = self._joint_log_likelihood(X)
  File "C:\Python27\lib\site-packages\sklearn\naive_bayes.py", line 724, in _joint_log_likelihood
    X = check_array(X, accept_sparse='csr')
  File "C:\Python27\lib\site-packages\sklearn\utils\validation.py", line 441, in check_array
    "if it contains a single sample.".format(array))
ValueError: Expected 2D array, got 1D array instead:
array=[1 1 1].
Reshape your data either using array.reshape(-1, 1) if your data has a single feature or array.reshape(1, -1) if it contains a single sample.

C:\Users\Felipe\Desktop\machine_learning>

Se alguem puder ajudar agradeço

1 resposta

Bom dia parismollochristondis!

Posta o código do arquivo classificacao.py pra a gente dar uma olhada!