Skip to content
This repository was archived by the owner on Dec 4, 2019. It is now read-only.

Commit 552b546

Browse files
authored
Resolve doctest warnings, except those about missing attributes (#95)
1 parent b21cf10 commit 552b546

File tree

2 files changed

+34
-30
lines changed

2 files changed

+34
-30
lines changed

python/doc/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@
129129
# Add any paths that contain custom static files (such as style sheets) here,
130130
# relative to this directory. They are copied after the builtin static files,
131131
# so a file named "default.css" will overwrite the builtin "default.css".
132-
html_static_path = ['_static']
132+
#html_static_path = ['_static']
133133

134134
# Add any extra paths that contain custom files (such as robots.txt or
135135
# .htaccess) here, relative to this directory. These files are copied

python/spark_sklearn/grid_search.py

Lines changed: 33 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ class GridSearchCV(BaseSearchCV):
3131
3232
The parameters of the estimator used to apply these methods are optimized
3333
by cross-validated grid-search over a parameter grid.
34-
Read more in the :ref:`User Guide <grid_search>`.
35-
34+
3635
Parameters
3736
----------
3837
estimator : estimator object.
@@ -64,15 +63,16 @@ class GridSearchCV(BaseSearchCV):
6463
execution. Reducing this number can be useful to avoid an
6564
explosion of memory consumption when more jobs get dispatched
6665
than CPUs can process. This parameter can be:
67-
- None, in which case all the jobs are immediately
68-
created and spawned. Use this for lightweight and
69-
fast-running jobs, to avoid delays due to on-demand
70-
spawning of the jobs
71-
- An int, giving the exact number of total jobs that are
72-
spawned
73-
- A string, giving an expression as a function of n_jobs,
74-
as in '2*n_jobs'
75-
66+
67+
- None, in which case all the jobs are immediately
68+
created and spawned. Use this for lightweight and
69+
fast-running jobs, to avoid delays due to on-demand
70+
spawning of the jobs
71+
- An int, giving the exact number of total jobs that are
72+
spawned
73+
- A string, giving an expression as a function of n_jobs,
74+
as in '2*n_jobs'
75+
7676
iid : boolean, default=True
7777
If True, the data is assumed to be identically distributed across
7878
the folds, and the loss minimized is the total loss per sample,
@@ -81,15 +81,15 @@ class GridSearchCV(BaseSearchCV):
8181
cv : int, cross-validation generator or an iterable, optional
8282
Determines the cross-validation splitting strategy.
8383
Possible inputs for cv are:
84-
- None, to use the default 3-fold cross validation,
85-
- integer, to specify the number of folds in a `(Stratified)KFold`,
86-
- An object to be used as a cross-validation generator.
87-
- An iterable yielding train, test splits.
84+
85+
- None, to use the default 3-fold cross validation,
86+
- integer, to specify the number of folds in a `(Stratified)KFold`,
87+
- An object to be used as a cross-validation generator.
88+
- An iterable yielding train, test splits.
89+
8890
For integer/None inputs, if the estimator is a classifier and ``y`` is
8991
either binary or multiclass, :class:`StratifiedKFold` is used. In all
9092
other cases, :class:`KFold` is used.
91-
Refer :ref:`User Guide <cross_validation>` for the various
92-
cross-validation strategies that can be used here.
9393
9494
refit : boolean, default=True
9595
Refit the best estimator with the entire dataset.
@@ -145,18 +145,21 @@ class GridSearchCV(BaseSearchCV):
145145
A dict with keys as column headers and values as columns, that can be
146146
imported into a pandas ``DataFrame``.
147147
For instance the below given table
148-
+------------+-----------+------------+-----------------+---+---------+
149-
|param_kernel|param_gamma|param_degree|split0_test_score|...|rank_....|
150-
+============+===========+============+=================+===+=========+
151-
| 'poly' | -- | 2 | 0.8 |...| 2 |
152-
+------------+-----------+------------+-----------------+---+---------+
153-
| 'poly' | -- | 3 | 0.7 |...| 4 |
154-
+------------+-----------+------------+-----------------+---+---------+
155-
| 'rbf' | 0.1 | -- | 0.8 |...| 3 |
156-
+------------+-----------+------------+-----------------+---+---------+
157-
| 'rbf' | 0.2 | -- | 0.9 |...| 1 |
158-
+------------+-----------+------------+-----------------+---+---------+
148+
149+
+------------+-----------+------------+-----------------+---+---------+
150+
|param_kernel|param_gamma|param_degree|split0_test_score|...|rank.....|
151+
+============+===========+============+=================+===+=========+
152+
| 'poly' | -- | 2 | 0.8 |...| 2 |
153+
+------------+-----------+------------+-----------------+---+---------+
154+
| 'poly' | -- | 3 | 0.7 |...| 4 |
155+
+------------+-----------+------------+-----------------+---+---------+
156+
| 'rbf' | 0.1 | -- | 0.8 |...| 3 |
157+
+------------+-----------+------------+-----------------+---+---------+
158+
| 'rbf' | 0.2 | -- | 0.9 |...| 1 |
159+
+------------+-----------+------------+-----------------+---+---------+
160+
159161
will be represented by a ``cv_results_`` dict of::
162+
160163
{
161164
'param_kernel': masked_array(data = ['poly', 'poly', 'rbf', 'rbf'],
162165
mask = [False False False False]...)
@@ -179,6 +182,7 @@ class GridSearchCV(BaseSearchCV):
179182
'std_score_time' : [0.001, 0.002, 0.003, 0.005],
180183
'params' : [{'kernel': 'poly', 'degree': 2}, ...],
181184
}
185+
182186
NOTE that the key ``'params'`` is used to store a list of parameter
183187
settings dict for all the parameter candidates.
184188
The ``mean_fit_time``, ``std_fit_time``, ``mean_score_time`` and
@@ -208,7 +212,7 @@ class GridSearchCV(BaseSearchCV):
208212
209213
n_splits_ : int
210214
The number of cross-validation splits (folds/iterations).
211-
215+
212216
Notes
213217
------
214218
The parameters selected are those that maximize the score of the left out

0 commit comments

Comments
 (0)