TypeError: Can't instantiate abstract class GridSearchCV with abstract methods _run_search
up vote
1
down vote
favorite
I'm working with spark-sklearn
in PySpark and I tried this code:
from sklearn import svm, datasets
from spark_sklearn.grid_search import GridSearchCV
from spark_sklearn.util import createLocalSparkSession
sc = createLocalSparkSession().sparkContext
iris = datasets.load_iris()
parameters = {'kernel':('linear', 'rbf'), 'C':[1, 10]}
svr = svm.SVC()
clf = GridSearchCV(sc, svr, parameters)
clf.fit(iris.data, iris.target)
And the error:
TypeError: Can't instantiate abstract class GridSearchCV with abstract methods _run_search
TypeErrorTraceback (most recent call last)
in engine
----> 1 clf = GridSearchCV(sc, svr, parameters)
TypeError: Can't instantiate abstract class GridSearchCV with abstract methods _run_search
Please, can you help me to fix this?
python pyspark
New contributor
add a comment |
up vote
1
down vote
favorite
I'm working with spark-sklearn
in PySpark and I tried this code:
from sklearn import svm, datasets
from spark_sklearn.grid_search import GridSearchCV
from spark_sklearn.util import createLocalSparkSession
sc = createLocalSparkSession().sparkContext
iris = datasets.load_iris()
parameters = {'kernel':('linear', 'rbf'), 'C':[1, 10]}
svr = svm.SVC()
clf = GridSearchCV(sc, svr, parameters)
clf.fit(iris.data, iris.target)
And the error:
TypeError: Can't instantiate abstract class GridSearchCV with abstract methods _run_search
TypeErrorTraceback (most recent call last)
in engine
----> 1 clf = GridSearchCV(sc, svr, parameters)
TypeError: Can't instantiate abstract class GridSearchCV with abstract methods _run_search
Please, can you help me to fix this?
python pyspark
New contributor
1
What version of sklearn are you using (import sklearn; print(sklearn.__version__)
?
– Matt Messersmith
6 hours ago
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I'm working with spark-sklearn
in PySpark and I tried this code:
from sklearn import svm, datasets
from spark_sklearn.grid_search import GridSearchCV
from spark_sklearn.util import createLocalSparkSession
sc = createLocalSparkSession().sparkContext
iris = datasets.load_iris()
parameters = {'kernel':('linear', 'rbf'), 'C':[1, 10]}
svr = svm.SVC()
clf = GridSearchCV(sc, svr, parameters)
clf.fit(iris.data, iris.target)
And the error:
TypeError: Can't instantiate abstract class GridSearchCV with abstract methods _run_search
TypeErrorTraceback (most recent call last)
in engine
----> 1 clf = GridSearchCV(sc, svr, parameters)
TypeError: Can't instantiate abstract class GridSearchCV with abstract methods _run_search
Please, can you help me to fix this?
python pyspark
New contributor
I'm working with spark-sklearn
in PySpark and I tried this code:
from sklearn import svm, datasets
from spark_sklearn.grid_search import GridSearchCV
from spark_sklearn.util import createLocalSparkSession
sc = createLocalSparkSession().sparkContext
iris = datasets.load_iris()
parameters = {'kernel':('linear', 'rbf'), 'C':[1, 10]}
svr = svm.SVC()
clf = GridSearchCV(sc, svr, parameters)
clf.fit(iris.data, iris.target)
And the error:
TypeError: Can't instantiate abstract class GridSearchCV with abstract methods _run_search
TypeErrorTraceback (most recent call last)
in engine
----> 1 clf = GridSearchCV(sc, svr, parameters)
TypeError: Can't instantiate abstract class GridSearchCV with abstract methods _run_search
Please, can you help me to fix this?
python pyspark
python pyspark
New contributor
New contributor
edited 6 hours ago
Ram Ghadiyaram
15.4k53972
15.4k53972
New contributor
asked 6 hours ago
María Villena
61
61
New contributor
New contributor
1
What version of sklearn are you using (import sklearn; print(sklearn.__version__)
?
– Matt Messersmith
6 hours ago
add a comment |
1
What version of sklearn are you using (import sklearn; print(sklearn.__version__)
?
– Matt Messersmith
6 hours ago
1
1
What version of sklearn are you using (
import sklearn; print(sklearn.__version__)
?– Matt Messersmith
6 hours ago
What version of sklearn are you using (
import sklearn; print(sklearn.__version__)
?– Matt Messersmith
6 hours ago
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
María Villena is a new contributor. Be nice, and check out our Code of Conduct.
María Villena is a new contributor. Be nice, and check out our Code of Conduct.
María Villena is a new contributor. Be nice, and check out our Code of Conduct.
María Villena is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53400322%2ftypeerror-cant-instantiate-abstract-class-gridsearchcv-with-abstract-methods%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
What version of sklearn are you using (
import sklearn; print(sklearn.__version__)
?– Matt Messersmith
6 hours ago