@@ -0,0 +1,1640 @@
+# get tasks from openml%0A%0Aimport openml%0Aimport pandas as pd%0Afrom pprint import pprint%0A%0Adef read_csv(file):%0A    # reads the given csv file and returns a list containing all dataset ids used for experiment.%0A    dataset_ids = %5B%5D%0A    with open(file) as f:%0A        for line in f:%0A            dataset_id, _ = line.split('/')%5B2%5D.split('_')%0A            dataset_ids.append(int(dataset_id))%0A%0A    return dataset_ids%0A%0Adef get_tasks_ids(dataset_ids):%0A    # returns a list containing tasj_ids%0A    task_ids = %5B%5D%0A%0A    # Some datasets are deactivated. We remove them from the list.%0A    deactivated_list = openml.datasets.list_datasets(status='deactivated')%0A    deactivated_list = list(deactivated_list.keys())%0A    for idx in deactivated_list:%0A        if idx in dataset_ids:%0A            #print(%22datset id %25i is deactivated. Removing from list%22 %25 idx)%0A            dataset_ids.remove(idx)%0A%0A    # Get task ids.%0A    tasks = openml.tasks.list_tasks(task_type_id=1)%0A    tasks = pd.DataFrame.from_dict(tasks, orient=%22index%22)%0A%0A    for did in dataset_ids:%0A        task = tasks.query('did == %7B%7D'.format(did))%0A        task = list(task.tid)%0A        task_ids.append(task%5B0%5D)  # append first task id which has given dataset id.%0A%0A    return task_ids%0A%0Adef main():%0A    datasets = 'resources/datasets.csv'%0A    dataset_ids = read_csv(datasets)%0A    task_ids = get_tasks_ids(dataset_ids)%0A    string_to_print = ''%0A    for tid in task_ids:%0A        string_to_print += str(tid) + ' '%0A    print(string_to_print)%0A%0A%0A%0Aif __name__==%22__main__%22:%0A    tasks = openml.tasks.list_tasks(task_type_id=1)%0A    # For each tasks, if tasks.did in %5Bdataset_ids%5D: remember the its task id.%0A%0A    main()%0A%0A%0A

ADD get_tasks.py. converts given dataset_ids to task_ids.