官方doc:
Signature: mlp.predict(X) Docstring: Predict using the multi-layer
perceptron classifierParameters
---------- X : {array-like, sparse matrix}, shape (n_samples, n_features)
The input data.Returns
------- y : array-like, shape (n_samples,) or (n_samples, n_classes)
The predicted classes. File: c:\users\huawei\appdata\local\programs\python\python36\lib\site-packages\sklearn\neural_network\multilayer_perceptron.py
Type: method
如:
Z=mlp.predict(np.c_[xx.ravel(),yy.ravel()])
其中, np.c_[xx.ravel(),yy.ravel()] 的列数要跟X.train的列数一致, 否则无法predict.