FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

DOC update docstrings to reflect libsvm random_state · DataScience2016/scikit-learn@2d97949 · GitHub

Commit 2d97949

Browse files
committed
DOC update docstrings to reflect libsvm random_state
1 parent 44dd09f commit 2d97949

6 files changed

Lines changed: 25 additions & 23 deletions

File tree

‎doc/modules/pipeline.rst‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ is an estimator object::
3838
Pipeline(steps=[('reduce_dim', PCA(copy=True, n_components=None,
3939
whiten=False)), ('svm', SVC(C=1.0, cache_size=200, class_weight=None,
4040
coef0=0.0, degree=3, gamma=0.0, kernel='rbf', max_iter=-1,
41-
probability=False, shrinking=True, tol=0.001, verbose=False))])
41+
probability=False, random_state=None, shrinking=True, tol=0.001,
42+
verbose=False))])
4243

4344
The estimators of the pipeline are stored as a list in the ``steps`` attribute::
4445

@@ -57,7 +58,8 @@ Parameters of the estimators in the pipeline can be accessed using the
5758
Pipeline(steps=[('reduce_dim', PCA(copy=True, n_components=None,
5859
whiten=False)), ('svm', SVC(C=10, cache_size=200, class_weight=None,
5960
coef0=0.0, degree=3, gamma=0.0, kernel='rbf', max_iter=-1,
60-
probability=False, shrinking=True, tol=0.001, verbose=False))])
61+
probability=False, random_state=None, shrinking=True, tol=0.001,
62+
verbose=False))])
6163

6264
This is particularly important for doing grid searches::
6365

‎doc/modules/svm.rst‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ size ``[n_samples]``, holding the class labels for the training samples::
7777
>>> clf = svm.SVC()
7878
>>> clf.fit(X, y) # doctest: +NORMALIZE_WHITESPACE
7979
SVC(C=1.0, cache_size=200, class_weight=None, coef0=0.0, degree=3,
80-
gamma=0.0, kernel='rbf', max_iter=-1, probability=False, shrinking=True,
81-
tol=0.001, verbose=False)
80+
gamma=0.0, kernel='rbf', max_iter=-1, probability=False, random_state=None,
81+
shrinking=True, tol=0.001, verbose=False)
8282

8383
After being fitted, the model can then be used to predict new values::
8484

@@ -116,8 +116,8 @@ classifiers are constructed and each one trains data from two classes::
116116
>>> clf = svm.SVC()
117117
>>> clf.fit(X, Y) # doctest: +NORMALIZE_WHITESPACE
118118
SVC(C=1.0, cache_size=200, class_weight=None, coef0=0.0, degree=3,
119-
gamma=0.0, kernel='rbf', max_iter=-1, probability=False, shrinking=True,
120-
tol=0.001, verbose=False)
119+
gamma=0.0, kernel='rbf', max_iter=-1, probability=False, random_state=None,
120+
shrinking=True, tol=0.001, verbose=False)
121121
>>> dec = clf.decision_function([[1]])
122122
>>> dec.shape[1] # 4 classes: 4*3/2 = 6
123123
6
@@ -301,7 +301,7 @@ floating point values instead of integer values::
301301
>>> clf.fit(X, y) # doctest: +NORMALIZE_WHITESPACE
302302
SVR(C=1.0, cache_size=200, coef0=0.0, degree=3,
303303
epsilon=0.1, gamma=0.0, kernel='rbf', max_iter=-1, probability=False,
304-
shrinking=True, tol=0.001, verbose=False)
304+
random_state=None, shrinking=True, tol=0.001, verbose=False)
305305
>>> clf.predict([[1, 1]])
306306
array([ 1.5])
307307

@@ -499,7 +499,7 @@ test vectors must be provided.
499499
>>> clf.fit(gram, y) # doctest: +NORMALIZE_WHITESPACE
500500
SVC(C=1.0, cache_size=200, class_weight=None, coef0=0.0, degree=3,
501501
gamma=0.0, kernel='precomputed', max_iter=-1, probability=False,
502-
shrinking=True, tol=0.001, verbose=False)
502+
random_state=None, shrinking=True, tol=0.001, verbose=False)
503503
>>> # predict on training examples
504504
>>> clf.predict(gram)
505505
array([0, 1])

‎doc/tutorial/basic/tutorial.rst‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,8 @@ one::
169169

170170
>>> clf.fit(digits.data[:-1], digits.target[:-1]) # doctest: +NORMALIZE_WHITESPACE
171171
SVC(C=100.0, cache_size=200, class_weight=None, coef0=0.0, degree=3,
172-
gamma=0.001, kernel='rbf', max_iter=-1, probability=False, shrinking=True,
173-
tol=0.001, verbose=False)
172+
gamma=0.001, kernel='rbf', max_iter=-1, probability=False,
173+
random_state=None, shrinking=True, tol=0.001, verbose=False)
174174

175175
Now you can predict new values, in particular, we can ask to the
176176
classifier what is the digit of our last image in the `digits` dataset,
@@ -207,8 +207,8 @@ persistence model, namely `pickle <http://docs.python.org/library/pickle.html>`_
207207
>>> X, y = iris.data, iris.target
208208
>>> clf.fit(X, y) # doctest: +NORMALIZE_WHITESPACE
209209
SVC(C=1.0, cache_size=200, class_weight=None, coef0=0.0, degree=3, gamma=0.0,
210-
kernel='rbf', max_iter=-1, probability=False, shrinking=True, tol=0.001,
211-
verbose=False)
210+
kernel='rbf', max_iter=-1, probability=False, random_state=None,
211+
shrinking=True, tol=0.001, verbose=False)
212212

213213
>>> import pickle
214214
>>> s = pickle.dumps(clf)

‎doc/tutorial/statistical_inference/supervised_learning.rst‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -452,8 +452,8 @@ classification --:class:`SVC` (Support Vector Classification).
452452
>>> svc = svm.SVC(kernel='linear')
453453
>>> svc.fit(iris_X_train, iris_y_train) # doctest: +NORMALIZE_WHITESPACE
454454
SVC(C=1.0, cache_size=200, class_weight=None, coef0=0.0, degree=3, gamma=0.0,
455-
kernel='linear', max_iter=-1, probability=False, shrinking=True, tol=0.001,
456-
verbose=False)
455+
kernel='linear', max_iter=-1, probability=False, random_state=None,
456+
shrinking=True, tol=0.001, verbose=False)
457457

458458

459459
.. warning:: **Normalizing data**

‎sklearn/grid_search.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ class GridSearchCV(BaseSearchCV):
644644
GridSearchCV(cv=None,
645645
estimator=SVC(C=1.0, cache_size=..., coef0=..., degree=...,
646646
gamma=..., kernel='rbf', max_iter=-1, probability=False,
647-
shrinking=True, tol=...),
647+
random_state=None, shrinking=True, tol=...),
648648
fit_params={}, iid=True, loss_func=None, n_jobs=1,
649649
param_grid=...,
650650
...)

‎sklearn/svm/classes.py‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,8 @@ class frequencies.
247247
>>> clf = SVC()
248248
>>> clf.fit(X, y) #doctest: +NORMALIZE_WHITESPACE
249249
SVC(C=1.0, cache_size=200, class_weight=None, coef0=0.0, degree=3,
250-
gamma=0.0, kernel='rbf', max_iter=-1, probability=False,
251-
shrinking=True, tol=0.001, verbose=False)
250+
gamma=0.0, kernel='rbf', max_iter=-1, probability=False,
251+
random_state=None, shrinking=True, tol=0.001, verbose=False)
252252
>>> print(clf.predict([[-0.8, -1]]))
253253
[1]
254254
@@ -371,8 +371,8 @@ class NuSVC(BaseSVC):
371371
>>> clf = NuSVC()
372372
>>> clf.fit(X, y) #doctest: +NORMALIZE_WHITESPACE
373373
NuSVC(cache_size=200, coef0=0.0, degree=3, gamma=0.0, kernel='rbf',
374-
max_iter=-1, nu=0.5, probability=False, shrinking=True, tol=0.001,
375-
verbose=False)
374+
max_iter=-1, nu=0.5, probability=False, random_state=None,
375+
shrinking=True, tol=0.001, verbose=False)
376376
>>> print(clf.predict([[-0.8, -1]]))
377377
[1]
378378
@@ -490,8 +490,8 @@ class SVR(BaseLibSVM, RegressorMixin):
490490
>>> clf = SVR(C=1.0, epsilon=0.2)
491491
>>> clf.fit(X, y) #doctest: +NORMALIZE_WHITESPACE
492492
SVR(C=1.0, cache_size=200, coef0=0.0, degree=3, epsilon=0.2, gamma=0.0,
493-
kernel='rbf', max_iter=-1, probability=False, shrinking=True, tol=0.001,
494-
verbose=False)
493+
kernel='rbf', max_iter=-1, probability=False, random_state=None,
494+
shrinking=True, tol=0.001, verbose=False)
495495
496496
See also
497497
--------
@@ -606,8 +606,8 @@ class NuSVR(BaseLibSVM, RegressorMixin):
606606
>>> clf = NuSVR(C=1.0, nu=0.1)
607607
>>> clf.fit(X, y) #doctest: +NORMALIZE_WHITESPACE
608608
NuSVR(C=1.0, cache_size=200, coef0=0.0, degree=3, gamma=0.0, kernel='rbf',
609-
max_iter=-1, nu=0.1, probability=False, shrinking=True, tol=0.001,
610-
verbose=False)
609+
max_iter=-1, nu=0.1, probability=False, random_state=None,
610+
shrinking=True, tol=0.001, verbose=False)
611611
612612
See also
613613
--------

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL