欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 编程语言 > python >内容正文

python

python 多层感知器 sklearn.neural_network MLPClassifier.predict()函数

发布时间:2025/3/19 python 31 豆豆
生活随笔 收集整理的这篇文章主要介绍了 python 多层感知器 sklearn.neural_network MLPClassifier.predict()函数 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

官方doc:

Signature: mlp.predict(X) Docstring: Predict using the multi-layer
perceptron classifier

Parameters
---------- 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.

总结

以上是生活随笔为你收集整理的python 多层感知器 sklearn.neural_network MLPClassifier.predict()函数的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。