diff options
| author | Jon Whiteaker <jbw@jon-th-desktop.(none)> | 2012-02-24 01:27:40 -0800 |
|---|---|---|
| committer | Jon Whiteaker <jbw@jon-th-desktop.(none)> | 2012-02-24 01:27:40 -0800 |
| commit | 197be2fa794453a7e24aaa5d9ee0217fe0fbb735 (patch) | |
| tree | e192a130386fb98b72caab98e22665c90526f7ea /data/svm/accuracy.py | |
| parent | 474b2518d605b8a9ca47bbec79ec737802b9a742 (diff) | |
| parent | 5ae9358487b6266d2a221ebc2bcf72d735e09b25 (diff) | |
| download | kinect-197be2fa794453a7e24aaa5d9ee0217fe0fbb735.tar.gz | |
Merge branch 'master' of paloalto.thlab.net:kinect-eccv12
Diffstat (limited to 'data/svm/accuracy.py')
| -rwxr-xr-x | data/svm/accuracy.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/data/svm/accuracy.py b/data/svm/accuracy.py new file mode 100755 index 0000000..4d9ea6b --- /dev/null +++ b/data/svm/accuracy.py @@ -0,0 +1,33 @@ +#! /usr/bin/python +import sys +import numpy as np +import matplotlib.pyplot as plt + +log_filename = sys.argv[1] +nums,accuracy = np.loadtxt(log_filename,comments=";",delimiter='#',unpack=True,usecols=(0,2)) +nums_unique = np.unique(nums) +means = [] +mins = [] +maxs = [] +for i in nums_unique: + filtered = accuracy[nums==i] + mean = np.mean(filtered) + min_value = min(filtered) + max_value = max(filtered) + var = np.var(filtered) + means += [mean] + mins += [mean-min_value] + maxs += [max_value-mean] + print ",".join(map(str,[int(i),mean,min_value,max_value,var])) + +x = map(int,list(nums_unique)) +axes = plt.subplot(111) +axes.set_xlabel("Group size") +axes.set_ylabel("Accuracy") +a = axes.set_xlim((0,22)) +axes.set_ylim((0,100)) +axes.set_xticks(x) +plt.errorbar(x,means,yerr=[mins,maxs],linestyle="-",marker="o",ecolor="gray") +plt.savefig("test.png") + + |
