Skip to content

Estimators inside parameter grid don't work #2

@Yatoom

Description

@Yatoom

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()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions