Skip to content

Running regression flow requires clases? #312

@joaquinvanschoren

Description

@joaquinvanschoren

See example error below.

%matplotlib inline
import openml as oml
import pandas as pd
import numpy as np
import seaborn as sns
from matplotlib import pyplot
from sklearn import neighbors, model_selection, tree, ensemble

oml.config.apikey = "5a17d410c0a181e5ec2595ee9da79849"

task = oml.tasks.get_task(146685)

clf = ensemble.RandomForestRegressor()

flow = oml.flows.sklearn_to_flow(clf)

run = oml.runs.run_flow_on_task(task, flow)
#myrun = run.publish()
#print("Uploaded to http://www.openml.org/r/" + str(myrun.run_id))
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-5-e4b1318833fe> in <module>()
     15 flow = oml.flows.sklearn_to_flow(clf)
     16 
---> 17 run = oml.runs.run_flow_on_task(task, flow)
     18 #myrun = run.publish()
     19 #print("Uploaded to http://www.openml.org/r/" + str(myrun.run_id))

/usr/local/lib/python3.6/site-packages/openml/runs/functions.py in run_flow_on_task(task, flow, avoid_duplicate_runs, flow_tags, seed)
     99 
    100     # execute the run
--> 101     res = _run_task_get_arffcontent(flow.model, task, class_labels)
    102 
    103     if flow.flow_id is None:

/usr/local/lib/python3.6/site-packages/openml/runs/functions.py in _run_task_get_arffcontent(model, task, class_labels)
    424                     model_classes = used_estimator.best_estimator_.classes_
    425                 else:
--> 426                     model_classes = used_estimator.classes_
    427 
    428                 if can_measure_runtime:

AttributeError: 'RandomForestRegressor' object has no attribute 'classes_'

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions