Skip to content

KeyError on pipeline upload #187

@joaquinvanschoren

Description

@joaquinvanschoren

Simple pipeline experiment:

from sklearn import pipeline, ensemble, preprocessing
from openml import tasks,runs, datasets
task = tasks.get_task(59)
pipe = pipeline.Pipeline(steps=[
            ('Imputer', sklearn.preprocessing.Imputer(strategy='median')),
            ('OneHotEncoder', sklearn.preprocessing.OneHotEncoder(sparse=False, handle_unknown='ignore')),
            ('Classifier', sklearn.ensemble.RandomForestClassifier())
           ])
run = runs.run_task(task, pipe)
response = run.publish()

Error:

KeyError                                  Traceback (most recent call last)
<ipython-input-7-bbc4e8d1aa68> in <module>()
      9 run = runs.run_task(task, pipe)
     10 #vars(run)
---> 11 response = run.publish()

/Users/joa/anaconda/lib/python3.5/site-packages/openml-0.3.0-py3.5.egg/openml/runs/run.py in publish(self)
    137 
    138         predictions = arff.dumps(self._generate_arff_dict())
--> 139         description_xml = self._create_description_xml()
    140 
    141         file_elements = {'predictions': ("predictions.arff", predictions),

/Users/joa/anaconda/lib/python3.5/site-packages/openml-0.3.0-py3.5.egg/openml/runs/run.py in _create_description_xml(self)
    164         downloaded_flow = openml.flows.get_flow(self.flow_id)
    165 
--> 166         openml_param_settings = _parse_parameters(self.model, downloaded_flow)
    167 
    168         # as a tag, it must be of the form ([a-zA-Z0-9_\-\.])+

/Users/joa/anaconda/lib/python3.5/site-packages/openml-0.3.0-py3.5.egg/openml/runs/run.py in _parse_parameters(model, flow)
    200         if isinstance(python_param_settings[param], BaseEstimator):
    201             # extract parameters of the subflow individually
--> 202             subflow = flow.components[param]
    203             openml_param_settings += _parse_parameters(python_param_settings[param], subflow)
    204 

KeyError: 'Imputer'

Am I doing something wrong?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions