diff --git a/workflows/base/db/package_data.json b/workflows/base/db/package_data.json index 4b8b8ea577abdb8c736da40e18b9b14de0f4d39c..4297902f3a1d819db1656f8946a0a03c86c449ea 100644 --- a/workflows/base/db/package_data.json +++ b/workflows/base/db/package_data.json @@ -931,6 +931,171 @@ "description": "Result of evaluation" } }, + { + "pk": 239, + "model": "workflows.abstractwidget", + "fields": { + "category": 33, + "treeview_image": "", + "name": "Extract results", + "is_streaming": false, + "uid": "3ddf7c0b-6b63-46f2-9a39-b1270c51b7c1", + "interaction_view": "", + "image": "", + "package": "base", + "static_image": "", + "post_interact_action": "", + "user": null, + "visualization_view": "", + "streaming_visualization_view": "", + "action": "base_extract_results", + "wsdl_method": "", + "wsdl": "", + "interactive": false, + "has_progress_bar": false, + "order": 1, + "description": "This widget is useful for preparing results for visualization using the Viper widget." + } + }, + { + "pk": 523, + "model": "workflows.abstractinput", + "fields": { + "widget": 239, + "name": "F score", + "short_name": "f", + "uid": "46771a73-77e1-40d1-9a53-1a4ffed49f21", + "default": "", + "required": false, + "multi": false, + "parameter_type": null, + "variable": "fscore", + "parameter": false, + "order": 1, + "description": "" + } + }, + { + "pk": 524, + "model": "workflows.abstractinput", + "fields": { + "widget": 239, + "name": "Precision", + "short_name": "pre", + "uid": "119a7253-5c19-468a-82b7-91b95fdecf36", + "default": "", + "required": false, + "multi": false, + "parameter_type": null, + "variable": "precision", + "parameter": false, + "order": 1, + "description": "" + } + }, + { + "pk": 525, + "model": "workflows.abstractinput", + "fields": { + "widget": 239, + "name": "Recall", + "short_name": "rec", + "uid": "ed759223-3e5d-4f27-8fa3-26000808fda0", + "default": "", + "required": false, + "multi": false, + "parameter_type": null, + "variable": "recall", + "parameter": false, + "order": 1, + "description": "" + } + }, + { + "pk": 526, + "model": "workflows.abstractinput", + "fields": { + "widget": 239, + "name": "Area under curve", + "short_name": "auc", + "uid": "9a580915-5bef-445b-9195-13711ee0080d", + "default": "", + "required": false, + "multi": false, + "parameter_type": null, + "variable": "auc", + "parameter": false, + "order": 1, + "description": "" + } + }, + { + "pk": 527, + "model": "workflows.abstractinput", + "fields": { + "widget": 239, + "name": "Accuracy", + "short_name": "acc", + "uid": "af085bcc-39a0-4d04-b709-6fe6fd953920", + "default": "", + "required": false, + "multi": false, + "parameter_type": null, + "variable": "accuracy", + "parameter": false, + "order": 1, + "description": "" + } + }, + { + "pk": 528, + "model": "workflows.abstractinput", + "fields": { + "widget": 239, + "name": "Runtime", + "short_name": "bmk", + "uid": "9d2b4fd5-e977-41c0-a857-ef9c00499c0f", + "default": "", + "required": false, + "multi": false, + "parameter_type": null, + "variable": "runtime", + "parameter": false, + "order": 1, + "description": "" + } + }, + { + "pk": 529, + "model": "workflows.abstractinput", + "fields": { + "widget": 239, + "name": "Name", + "short_name": "nam", + "uid": "01af240a-0a52-4c7d-9c82-9ac1bd0982d8", + "default": "", + "required": false, + "multi": false, + "parameter_type": "text", + "variable": "name", + "parameter": false, + "order": 1, + "description": "" + } + }, + { + "pk": 249, + "model": "workflows.abstractoutput", + "fields": { + "widget": 239, + "name": "Results", + "short_name": "res", + "variable": "results", + "uid": "bb0d42b8-dc77-4b01-b6ad-480d52e917c2", + "order": 1, + "description": "results" + } + }, { "pk": 176, "model": "workflows.abstractwidget", diff --git a/workflows/base/library.py b/workflows/base/library.py index 72cf0a482e1bd5671e4b77ed36c90471135e8700..cfc57974a2eb397bb4214a09e91f936aff3f50b3 100644 --- a/workflows/base/library.py +++ b/workflows/base/library.py @@ -155,3 +155,17 @@ def split_documents(input_dict): new_documents.append(doc.split(" ",1)[1]) output_dict['string']="\n".join(new_documents) return output_dict + +def base_extract_results(input_dict): + fbeta = 1 + fscore = input_dict['fscore'] + precision = input_dict['precision'] + recall = input_dict['recall'] + auc = input_dict['auc'] + accuracy = input_dict['accuracy'] + runtime = input_dict['runtime'] + name = input_dict['name'] + results = {'fbeta':1,'fscore':fscore,'name': name,'precision': precision,'recall': recall,'auc': auc,'accuracy': accuracy,'runtime': runtime} + output_dict = {} + output_dict['results']=results + return output_dict diff --git a/workflows/ilp/library.py b/workflows/ilp/library.py index b889c352058a4111dccc4feac9637619b530700d..77eae6233235bc7e9638889fe8187b1b60b1aa77 100644 --- a/workflows/ilp/library.py +++ b/workflows/ilp/library.py @@ -117,4 +117,4 @@ def ilp_treeliker(input_dict): 'max_degree': input_dict.get('max_degree') } arff = TreeLiker(dataset, template).run(settings=settings) - return {'arff': arff} + return {'arff': arff} \ No newline at end of file