Boa noite, escrevi meu codigo a apresentou esse erro: Traceback (most recent call last): File "", line 1, in File "C:\Python36\lib\site-packages\sklearn\naive_bayes.py", line 579, in fit X, y = check_X_y(X, y, 'csr') File "C:\Python36\lib\site-packages\sklearn\utils\validation.py", line 573, in check_X_y ensure_min_features, warn_on_dtype, estimator) File "C:\Python36\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=[0 0 0 0 0 1 0 1 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 1 0 1 1 1 1 0 0 1 0 0 0 1 0 0 1 1 0 0 0 0 1 0 1 0 1 0 1 0 1 0 0 0 1 1 0 1 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 1 0 0 0 0 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.
Pra não restar duvida, escrevi o proprio codigo escrito pelo professor e continua dando esse erro.
>>> from dados import carregar_acessos
>>> X,Y = carregar_acessos()
>>> treino_dados = X[:90]
>>> treino_marcacoes = Y[:90]
>>> teste_dados = X[-9:]
>>> teste_marcacoes = Y[-9:]
>>> from sklearn.naive_bayes import MultinomialNB
>>> modelo = MultinomialNB()
>>> modelo.fit(treino_dados, treino_marcacoes)