Answer the question
In order to leave comments, you need to log in
How to fix builtins.TypeError: '>' not supported between instances of 'numpy.ndarray' and 'float'?
I want to write a neural network that recognizes what language the words are written in. I'm trying to implement using
sklearn.naive_bayes import GaussianNB but an error occurs. How can this be fixed?
#coding=utf8
import numpy as np
from sklearn.naive_bayes import GaussianNB
x_training = np.array()
y_training = np.array(['ru', 'en', 'en', 'ru'])
clf = GaussianNB()
clf.fit(x_training, y_training)
print(clf.predict(np.array(['при'])))
Answer the question
In order to leave comments, you need to log in
First you need to vectorize the input https://scikit-learn.org/stable/modules/feature_ex...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question