Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scikit-learn
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ian Johnson
scikit-learn
Commits
df0cbb36
Commit
df0cbb36
authored
14 years ago
by
Olivier Grisel
Browse files
Options
Downloads
Patches
Plain Diff
more formatting in SGD reST and fixed docstest broken by last checkin :(
parent
b45d282c
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc/modules/sgd.rst
+7
-6
7 additions, 6 deletions
doc/modules/sgd.rst
with
7 additions
and
6 deletions
doc/modules/sgd.rst
+
7
−
6
View file @
df0cbb36
...
...
@@ -68,12 +68,12 @@ After being fitted, the model can then be used to predict new values::
array([ 1.])
SGD fits a linear model to the training data. The member `coef_` holds
the model parameters:
the model parameters:
:
>>> clf.coef_
array([ 9.90090187, 9.90090187])
Member `intercept_` holds the intercept (aka offset or bias):
Member `intercept_` holds the intercept (aka offset or bias):
:
>>> clf.intercept_
array(-9.9900299301496904)
...
...
@@ -81,7 +81,7 @@ Member `intercept_` holds the intercept (aka offset or bias):
Whether or not the model should use an intercept, i.e. a biased
hyperplane, is controlled by the parameter `fit_intercept`.
To get the signed distance to the hyperplane use `decision_function`:
To get the signed distance to the hyperplane use `decision_function`:
:
>>> clf.decision_function([[2., 2.]])
array([ 29.61357756])
...
...
@@ -100,10 +100,11 @@ probability estimates.
In the case of binary classification and `loss="log"` you get a
probability estimate P(y=C|x) using `predict_proba`, where `C` is the
largest class label:
largest class label:
:
>>> clf = SGDClassifier(loss="log").fit(X, y) >>>
clf.predict_proba([[1., 1.]]) array([ 0.99999949])
>>> clf = SGDClassifier(loss="log").fit(X, y)
>>> clf.predict_proba([[1., 1.]])
array([ 0.99999949])
The concrete penalty can be set via the `penalty` parameter. `SGD`
supports the following penalties:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment