Commit 4d208847 authored by matjaz's avatar matjaz
Browse files

Latino: considerably improved accuracy calculation which is due to complexity...

Latino: considerably improved accuracy calculation which is due to complexity now implemented in c# and not in python as before.
parent 53d7fa8c
......@@ -4159,7 +4159,7 @@
"fields": {
"category": 274815427,
"treeview_image": null,
"name": "Get Vocabulary",
"name": "Get Vocabulary Table",
"is_streaming": false,
"uid": "427e4a62-54dc-4eff-ba86-e0758f5792f1",
"interaction_view": "",
......@@ -7405,13 +7405,13 @@
"post_interact_action": "",
"user": null,
"visualization_view": "",
"action": "compare_lists",
"action": "latino_accuracy_claculation",
"wsdl_method": "",
"wsdl": "",
"interactive": false,
"has_progress_bar": false,
"order": 10,
"description": "Automatically generated widget from function AccuracyClaculation_PYTHON in package latino. The original function signature: AccuracyClaculation_PYTHON."
"description": "Automatically generated widget from function AccuracyClaculation in package latino. The original function signature: AccuracyClaculation."
}
},
{
......@@ -7419,7 +7419,7 @@
"model": "workflows.abstractinput",
"fields": {
"widget": 24727658,
"name": "List 1",
"name": "True Labels",
"short_name": "lst",
"uid": "4337f7d3-5113-be91-9dcd-7f23d955ca3e",
"default": "",
......@@ -7429,7 +7429,7 @@
"variable": "list1",
"parameter": false,
"order": 1,
"description": "System.Object"
"description": "System.Collections.IList"
}
},
{
......@@ -7437,7 +7437,7 @@
"model": "workflows.abstractinput",
"fields": {
"widget": 24727658,
"name": "List 2",
"name": "Predicted Labels",
"short_name": "lst",
"uid": "3865d2f0-cf4f-cacc-78dc-77a6b0071e45",
"default": "",
......@@ -7447,7 +7447,7 @@
"variable": "list2",
"parameter": false,
"order": 2,
"description": "System.Object"
"description": "System.Collections.IList"
}
},
{
......@@ -7473,7 +7473,7 @@
"variable": "statistics",
"uid": "4b9c7c60-639b-3ca5-682b-43b367f67cc3",
"order": 2,
"description": ""
"description": "Statistics:confusionMatrix: first level of confusion matrix dictionary present true labels (first input) while the second, inner layer, presents predicted labels (second output).\r\nStataistics:additinalScores: dictionary\u0027s id presents the label that was considered positive for calculation and dictionary\u0027s value are actual additioanl scores."
}
},
{
......
......@@ -737,6 +737,16 @@ def latino_cross_validation_predef_multi_splits(inputDict):
outputDict['obj'] = execResultPy
return outputDict
def latino_accuracy_claculation(inputDict):
_list1 = ToNetObj(inputDict['list1'])
_list2 = ToNetObj(inputDict['list2'])
execResult = LatinoCF.AccuracyClaculation(_list1, _list2)
execResultPy = ToPyObj(execResult)
outputDict = {}
outputDict['accuracy'] = execResultPy['accuracy']
outputDict['statistics'] = execResultPy['statistics']
return outputDict
def latino_run_csharp_snippet(inputDict):
_snippetParams = ToNetObj(inputDict['snippetParams'])
_snippetCode = ToString(inputDict['snippetCode'])
......
......@@ -43,22 +43,4 @@ def create_range(input_dict):
rng = range(ToInt(input_dict['start']), ToInt(input_dict['stop']), ToInt(input_dict['step']))
return {'range':rng }
def compare_lists(input_dict):
l1 = input_dict['list1']
l2 = input_dict['list2']
l = min(len(l1),len(l2))
cntEq = 0
for i in range(0,l):
if l1[i]==l2[i]:
cntEq += 1
return {
'accuracy':(0.0+cntEq)/l,
'statistics':{
'elements':l,
'equal':cntEq,
'different':l-cntEq,
'accuracy':(0.0+cntEq)/l,
'error':(0.0+l-cntEq)/l,
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment