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
Import Error: cannot import name MLPClassifier
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 ----
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
conda install mingw libpython
You can use the sknn library after.
max_iter: It denotes the number of epochs. activation: The activation function for the hidden layers. solver: This parameter specifies the algorithm for weight optimization across the nodes.
max_iterint, default=200. Maximum number of iterations. The solver iterates until convergence (determined by 'tol') or this number of iterations. For stochastic solvers ('sgd', 'adam'), note that this determines the number of epochs (how many times each data point will be used), not the number of gradient steps.
Yes, with Scikit-Learn, you can create neural network with these three lines of code, which all handles much of the leg work for you. Let's see what is happening in the above script. The first step is to import the MLPClassifier class from the sklearn. neural_network library.
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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With