Skip to content

Commit

Permalink
doc update
Browse files Browse the repository at this point in the history
  • Loading branch information
IssamLaradji committed Aug 23, 2014
1 parent 425ba58 commit e623fdd
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions doc/modules/neural_networks_supervised.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ training samples::
>>> y = [0, 1]
>>> clf = MultilayerPerceptronClassifier(n_hidden=[5, 2], random_state=1)
>>> clf.fit(X, y)
MultilayerPerceptronClassifier(activation='tanh', algorithm='l-bfgs',
MultilayerPerceptronClassifier(activation='relu', algorithm='l-bfgs',
alpha=1e-05, batch_size=200, learning_rate='constant',
learning_rate_init=0.5, max_iter=200, n_hidden=[5, 2],
power_t=0.5, random_state=1, shuffle=False, tol=1e-05,
Expand All @@ -104,7 +104,7 @@ following command,
use :meth:`MultilayerPerceptronClassifier.decision_function`::

>>> clf.decision_function([[2., 2.], [1., 2.]])
array([ 10.63831359, 10.62624867])
array([ 11.55408143, 11.55408143])

Currently, :class:`MultilayerPerceptronClassifier` supports only the
Cross-Entropy loss function, which allows probability estimates by running the
Expand All @@ -115,8 +115,8 @@ Cross-Entropy loss function, giving a vector of probability estimates
:math:`P(y|x)` per sample :math:`x`::

>>> clf.predict_proba([[2., 2.], [1., 2.]])
array([[ 2.39788691e-05, 9.99976021e-01],
[ 2.42699174e-05, 9.99975730e-01]])
array([[ 9.59670230e-06, 9.99990403e-01],
[ 9.59670230e-06, 9.99990403e-01]])

:class:`MultilayerPerceptronClassifier` supports multi-class classification by
applying `Softmax <http://en.wikipedia.org/wiki/Softmax_activation_function>`_
Expand All @@ -131,11 +131,11 @@ value is `1` represents the assigned classes of that samples::

>>> X = [[0., 0.], [1., 1.]]
>>> y = [[0, 1], [1]]
>>> clf = MultilayerPerceptronClassifier(n_hidden=[2], random_state=1)
>>> clf = MultilayerPerceptronClassifier(n_hidden=[15], random_state=1)
>>> clf.fit(X, y)
MultilayerPerceptronClassifier(activation='tanh', algorithm='l-bfgs',
MultilayerPerceptronClassifier(activation='relu', algorithm='l-bfgs',
alpha=1e-05, batch_size=200, learning_rate='constant',
learning_rate_init=0.5, max_iter=200, n_hidden=[2],
learning_rate_init=0.5, max_iter=200, n_hidden=[15],
power_t=0.5, random_state=1, shuffle=False, tol=1e-05,
verbose=False, warm_start=False)
>>> clf.predict([1., 2.])
Expand Down

0 comments on commit e623fdd

Please sign in to comment.