When I use GridSearchCV or RandomizedSearchCV with a param grid that includes a list of estimators, this will raise a TypeError: TypeError(repr(o) + " is not JSON serializable"). This happens inside the _extract_information_from_model() method.
Here is the code to reproduce this error:
import openml
from sklearn.ensemble import AdaBoostClassifier
from sklearn.model_selection import GridSearchCV
from sklearn.tree import DecisionTreeClassifier, ExtraTreeClassifier
task = openml.tasks.get_task(49)
param_grid = {
"base_estimator": [DecisionTreeClassifier(), ExtraTreeClassifier()]
}
clf = GridSearchCV(AdaBoostClassifier(), param_grid=param_grid)
run = openml.runs.run_task(task, clf)
run.publish()
When I use GridSearchCV or RandomizedSearchCV with a param grid that includes a list of estimators, this will raise a TypeError:
TypeError(repr(o) + " is not JSON serializable"). This happens inside the_extract_information_from_model()method.Here is the code to reproduce this error: