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

Commit cd2b91f

Browse files
committed
Use spark-sklearn GridSearchCV in doctest
1 parent 72d0091 commit cd2b91f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

python/spark_sklearn/grid_search.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,13 @@ class GridSearchCV(BaseSearchCV):
112112
Examples
113113
--------
114114
>>> from sklearn import svm, datasets
115-
>>> from sklearn.model_selection import GridSearchCV
115+
>>> from spark_sklearn.grid_search import GridSearchCV
116+
>>> from spark_sklearn.util import createLocalSparkSession
117+
>>> sc = createLocalSparkSession().sparkContext
116118
>>> iris = datasets.load_iris()
117119
>>> parameters = {'kernel':('linear', 'rbf'), 'C':[1, 10]}
118120
>>> svr = svm.SVC()
119-
>>> clf = GridSearchCV(svr, parameters)
121+
>>> clf = GridSearchCV(sc, svr, parameters)
120122
>>> clf.fit(iris.data, iris.target)
121123
... # doctest: +NORMALIZE_WHITESPACE +ELLIPSIS
122124
GridSearchCV(cv=None, error_score=...,

0 commit comments

Comments
 (0)