scikit learn - Unresolved reference "sklearn" in Python while importing GaussianNB -
i trying execute following statements in pycharm on windows. error message in 4th line importing gaussiannb - sklearn: unresolved reference. there package needed included or other way resolve this?
import numpy np x = np.array([[-1, -1], [-2, -1], [-3, -2], [1, 1], [2, 1], [3, 2]]) y = np.array([1, 1, 1, 2, 2, 2]) sklearn.naive_bayes import gaussiannb clf = gaussiannb() clf.fit(x, y) print(clf.predict([[-0.8, -1]]))
from last comment seems scipy module missing.
after installing scipy
error should not appear.
the common scipy - pycharm installation problems have been answered here (just in case error while trying install scipy
)
Comments
Post a Comment