Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 274
[WIP] Task upload#607
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
[WIP] Task upload #607
Changes from all commits
e116f7f8fcbe94f6f2cdc959f65a80f2bd6bff49bbfe6882e6a63fe5fea7d8d2e5d03dd27e3e4d1ffb808d377a51444f3804f426e9a77c94a115d2b1ca27df6aff216a9d1395d26baa436f19c327ea7714abf0821bb8351dbfb217adcb401bf5ffc27bb8f6115935f38e79ea7450e8f8b90727b15491e2ae02f8b3e186e89cb9bf9f988cd0632ca91ebb2acf39388418a4ead4c4ff6972fccc1d048e03e0b6979965b0207082ca079578aa080ec7ed7b0e962e332e5991591bac9588ea17ad15ad0381db6e70b83File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -158,6 +158,9 @@ def run_flow_on_task( | ||
| if flow_tags is not None and not isinstance(flow_tags, list): | ||
| raise ValueError("flow_tags should be a list") | ||
| if task.task_id is None: | ||
| raise ValueError("The task should be published at OpenML") | ||
| # TODO: At some point in the future do not allow for arguments in old order (changed 6-2018). | ||
| # Flexibility currently still allowed due to code-snippet in OpenML100 paper (3-2019). | ||
| if isinstance(flow, OpenMLTask) and isinstance(task, OpenMLFlow): | ||
| @@ -452,11 +455,14 @@ def _calculate_local_measure(sklearn_fn, openml_name): | ||
| for i, tst_idx in enumerate(test_indices): | ||
| arff_line = [rep_no, fold_no, sample_no, tst_idx] # type: List[Any] | ||
| for j, class_label in enumerate(task.class_labels): | ||
| arff_line.append(proba_y[i][j]) | ||
| if task.class_labels is not None: | ||
ArlindKadra marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| for j, class_label in enumerate(task.class_labels): | ||
| arff_line.append(proba_y[i][j]) | ||
| arff_line.append(task.class_labels[pred_y[i]]) | ||
| arff_line.append(task.class_labels[test_y[i]]) | ||
| arff_line.append(task.class_labels[pred_y[i]]) | ||
| arff_line.append(task.class_labels[test_y[i]]) | ||
| else: | ||
| raise ValueError('The task has no class labels') | ||
| arff_datacontent.append(arff_line) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -216,30 +216,45 @@ def _generate_arff_dict(self) -> 'OrderedDict[str, Any]': | ||
| 'openml_task_{}_predictions'.format(task.task_id) | ||
| if isinstance(task, OpenMLLearningCurveTask): | ||
| class_labels = task.class_labels # type: ignore | ||
| arff_dict['attributes'] = [('repeat', 'NUMERIC'), | ||
| ('fold', 'NUMERIC'), | ||
| ('sample', 'NUMERIC'), | ||
| ('row_id', 'NUMERIC')] + \ | ||
| [('confidence.' + class_labels[i], | ||
| 'NUMERIC') for i in | ||
| range(len(class_labels))] + \ | ||
| [('prediction', class_labels), | ||
| ('correct', class_labels)] | ||
| class_labels = task.class_labels | ||
| instance_specifications = [ | ||
| ('repeat', 'NUMERIC'), | ||
| ('fold', 'NUMERIC'), | ||
| ('sample', 'NUMERIC'), | ||
| ('row_id', 'NUMERIC') | ||
| ] | ||
| arff_dict['attributes'] = instance_specifications | ||
| if class_labels is not None: | ||
ArlindKadra marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| arff_dict['attributes'] = arff_dict['attributes'] + \ | ||
| [('confidence.' + class_labels[i], | ||
| 'NUMERIC') | ||
| for i in range(len(class_labels))] + \ | ||
| [('prediction', class_labels), | ||
| ('correct', class_labels)] | ||
| else: | ||
| raise ValueError('The task has no class labels') | ||
| elif isinstance(task, OpenMLClassificationTask): | ||
| class_labels = task.class_labels | ||
| instance_specifications = [('repeat', 'NUMERIC'), | ||
| ('fold', 'NUMERIC'), | ||
| ('sample', 'NUMERIC'), # Legacy | ||
| ('row_id', 'NUMERIC')] | ||
| prediction_confidences = [('confidence.' + class_labels[i], | ||
| 'NUMERIC') | ||
| for i in range(len(class_labels))] | ||
| prediction_and_true = [('prediction', class_labels), | ||
| ('correct', class_labels)] | ||
| arff_dict['attributes'] = (instance_specifications | ||
| + prediction_confidences | ||
| + prediction_and_true) | ||
| arff_dict['attributes'] = instance_specifications | ||
| if class_labels is not None: | ||
ArlindKadra marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| prediction_confidences = [('confidence.' + class_labels[i], | ||
| 'NUMERIC') | ||
| for i in range(len(class_labels))] | ||
| prediction_and_true = [('prediction', class_labels), | ||
| ('correct', class_labels)] | ||
| arff_dict['attributes'] = arff_dict['attributes'] + \ | ||
| prediction_confidences + \ | ||
| prediction_and_true | ||
| else: | ||
| raise ValueError('The task has no class labels') | ||
| elif isinstance(task, OpenMLRegressionTask): | ||
| arff_dict['attributes'] = [('repeat', 'NUMERIC'), | ||
| ('fold', 'NUMERIC'), | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.