Commit 8bb4d9ca authored by Georgios Dagkakis's avatar Georgios Dagkakis

methods moved in generic plugin

parent 99169c7a
......@@ -104,20 +104,4 @@ class BatchesTabularExit(plugin.OutputPreparationPlugin):
"%.2f" % avgCycleTimeCI['lb'],
"%.2f" % avgCycleTimeCI['ub']]
)
return data
def getConfidenceInterval(self, value_list, confidenceLevel):
from dream.KnowledgeExtraction.ConfidenceIntervals import Intervals
from dream.KnowledgeExtraction.StatisticalMeasures import BasicStatisticalMeasures
BSM=BasicStatisticalMeasures()
lb, ub = Intervals().ConfidIntervals(value_list, confidenceLevel)
return {'lb': lb,
'ub': ub,
'avg': BSM.mean(value_list)
}
def getAverage(self, value_list):
return sum(value_list) / float(len(value_list))
def getStDev(self, value_list):
return numpy.std(value_list)
\ No newline at end of file
return data
\ No newline at end of file
from copy import deepcopy
import json
import numpy
from zope.dottedname.resolve import resolve
......@@ -32,6 +33,25 @@ class Plugin(object):
successors.append(edge['destination'])
return successors
# calcualted the confidence inteval for a list and a confidence level
def getConfidenceInterval(self, value_list, confidenceLevel):
from dream.KnowledgeExtraction.ConfidenceIntervals import Intervals
from dream.KnowledgeExtraction.StatisticalMeasures import BasicStatisticalMeasures
BSM=BasicStatisticalMeasures()
lb, ub = Intervals().ConfidIntervals(value_list, confidenceLevel)
return {'lb': lb,
'ub': ub,
'avg': BSM.mean(value_list)
}
# return the average of a list
def getAverage(self, value_list):
return sum(value_list) / float(len(value_list))
# return the standard deviation of a list
def getStDev(self, value_list):
return numpy.std(value_list)
# returns name of a node given its id
def getNameFromId(self, data, node_id):
return data['graph']['node'][node_id]['name']
......
Markdown is supported
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