SKlearn导入MLPClassifier失败 [英] SKlearn import MLPClassifier fails
问题描述
我正在尝试在python中使用scikit-learn中的多层感知器.我的问题是,导入无法正常工作. scikit-learn的所有其他模块运行正常.
I am trying to use the multilayer perceptron from scikit-learn in python. My problem is, that the import is not working. All other modules from scikit-learn are working fine.
from sklearn.neural_network import MLPClassifier
导入错误:无法导入名称MLPClassifier
Import Error: cannot import name MLPClassifier
我正在Visual Studio 2015中使用Python环境Python64位3.4.
我使用以下命令在控制台上安装了sklearn:conda install scikit-learn
我还安装了numpy和pandas.发生上述错误后,我还使用pip install scikit-neuralnetwork
安装了 scikit-neuralnetwork .
已安装的scikit-learn版本为0.17.
I'm using the Python Environment Python64-bit 3.4 in Visual Studio 2015.
I installed sklearn over the console with: conda install scikit-learn
I also installed numpy and pandas. After I had the error above I also installed scikit-neuralnetwork with: pip install scikit-neuralnetwork
The installed scikit-learn version is 0.17.
我做错了什么?我是否缺少安装?
What have I done wrong? Am I missing an installation?
-----编辑----
----- EDIT ----
除了tttthomassssss的答案外,我还找到了有关如何为神经元网络安装sknn库的解决方案.我遵循了教程. 请执行以下步骤:
In addition to the answer of tttthomasssss, I found the solution on how to install the sknn library for neuronal networks. I followed this tutorial. Do the following steps:
-
pip install scikit-neuralnetwork
- 下载并安装 GCC编译器
- 使用
conda install mingw libpython
安装mingw
pip install scikit-neuralnetwork
- download and install the GCC compiler
- install mingw with
conda install mingw libpython
您可以在之后使用 sknn 库.
推荐答案
MLPClassifier
在scikit-learn
v0.17(截至2015年12月1日)中尚不可用.如果您真的想使用它,可以克隆0.18dev
(但是,我不知道该分支当前的稳定性如何.)
MLPClassifier
is not yet available in scikit-learn
v0.17 (as of 1 Dec 2015). If you really want to use it you could clone 0.18dev
(however, I don't know how stable this branch currently is).
这篇关于SKlearn导入MLPClassifier失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!