A função me retorna um aviso:
def classificarTexto (texto, colTexto, colClassificacao):
vetorizar = CountVectorizer(lowercase = False, max_features = 50)
bagOfWords = vetorizar.fit_transform(texto[colTexto])
treino, teste, classe_treino, classe_teste = train_test_split(bagOfWords,
texto[colClassificacao],
random_state = 42)
regLogistica = LogisticRegression(solver = 'lbfgs')
regLogistica.fit(treino, classe_treino)
return regLogistica.score(teste, classe_teste)
print(classificarTexto(resenha, "text_pt", "classificacao"))
/srv/conda/envs/notebook/lib/python3.7/site-packages/sklearn/linear_model/base.py:291: DeprecationWarning: np.int
is a deprecated alias for the builtin int
. To silence this warning, use int
by itself. Doing this will not modify any behavior and is safe. When replacing np.int
, you may wish to use e.g. np.int64
or np.int32
to specify the precision. If you wish to review your current use, check the release note link for additional information.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
indices = (scores > 0).astype(np.int)