Skip to content

Commit

Permalink
fix library and evaluation test
Browse files Browse the repository at this point in the history
  • Loading branch information
Soeren Sonnenburg committed Dec 5, 2011
1 parent d320074 commit 77c55d7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
Expand Up @@ -21,8 +21,8 @@ def evaluation_thresholds_modular(index):
thresh=evaluator.get_thresholds()
b=thresh[index]

print "tpr", numpy.mean(output[label>0]>b), tp[index]
print "fpr", numpy.mean(output[label<0]>b), fp[index]
#print "tpr", numpy.mean(output[label>0]>b), tp[index]
#print "fpr", numpy.mean(output[label<0]>b), fp[index]

return tp[index],fp[index],numpy.mean(output[label>0]>b),numpy.mean(output[label<0]>b)

Expand Down
19 changes: 13 additions & 6 deletions examples/undocumented/python_modular/library_time.py
@@ -1,12 +1,19 @@
import time
from modshogun import Time

parameter_list = [[1]]
def library_time(sleep_secs):
# measure wall clock time difference
t=Time()
time.sleep(1)
diff=t.cur_time_diff()

# measure wall clock time difference
t=Time()
time.sleep(1)
diff=t.cur_time_diff()
# measure CPU time required
cpu_diff=t.cur_runtime_diff_sec()

# measure CPU time required
# return results as integers to enable testing
return round(diff),round(cpu_diff)

cpu_diff=t.cur_runtime_diff_sec()
if __name__=='__main__':
print 'Time'
library_time(*parameter_list[0])

0 comments on commit 77c55d7

Please sign in to comment.