cannot import name MLPClassifier
pip install scikit-learn==0.18.rc2
from sklearn.neural_network import MLPClassifier
X = [[0., 0.], [1., 1.]]
y = [0, 1]
clf = MLPClassifier(solver='lbgfs',alpha=1e-5,hidden_layer_sizes=(5, 2), random_state=1)
clf.fit(X, y)
clf.predict([[2., 2.], [-1., -2.]])
参考文献:
http://scikit-learn.org/stable/modules/neural_networks_supervised.html
评论
发表评论