Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
dream
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
dream
Commits
8bb4d9ca
Commit
8bb4d9ca
authored
Feb 23, 2015
by
Georgios Dagkakis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
methods moved in generic plugin
parent
99169c7a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
17 deletions
+21
-17
dream/plugins/BatchesTabularExit.py
dream/plugins/BatchesTabularExit.py
+1
-17
dream/plugins/plugin.py
dream/plugins/plugin.py
+20
-0
No files found.
dream/plugins/BatchesTabularExit.py
View file @
8bb4d9ca
...
...
@@ -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
dream/plugins/plugin.py
View file @
8bb4d9ca
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'
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment