changeset 423:b36762259dc6

- Scripts for plotting summary performance graphs.
author tomwalters
date Mon, 01 Nov 2010 00:31:00 +0000
parents ebed9c3fc63b
children f405ead2736f
files trunk/experiments/scripts/cnbh-syllables/results_plotting/munge_results.sh trunk/experiments/scripts/cnbh-syllables/results_plotting/plot_munged_results.py
diffstat 2 files changed, 46 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/trunk/experiments/scripts/cnbh-syllables/results_plotting/munge_results.sh	Mon Nov 01 00:31:00 2010 +0000
@@ -0,0 +1,2 @@
+#!/bin/bash
+find ./ -iname "*.txt" | xargs grep "Score on test talkers" | sed "s/\.\///" | sed "s/4_states_4_mixture_components\/results_iteration_15.txt:# Score on test talkers: //" | sed "s/\//,/g" | sed "s/dB//" | sed "s/snr_//" | sed "s/_talkers//" | sed s/%// | sed s/,0,/,00,/ | sed s/,3,/,03,/ | sed s/,6,/,06,/ | sed s/,9,/,09,/ > results_test_all.csv
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/trunk/experiments/scripts/cnbh-syllables/results_plotting/plot_munged_results.py	Mon Nov 01 00:31:00 2010 +0000
@@ -0,0 +1,44 @@
+#!/usr/bin/python
+"""
+plot_munged_results.py
+
+"""
+
+import numpy as np
+import pylab as p
+import matplotlib.pyplot as plt
+
+f=open("results_test_all.csv","r")
+results = dict()
+for line in f:
+  if line[0] != "#":
+    values = line.strip().split(",")
+    results.setdefault(values[3],dict())
+    results[values[3]].setdefault(values[0], dict())
+    results[values[3]][values[0]].setdefault(values[1], dict())
+    if values[2] == 'clean':
+       snr = 40
+    else:
+       snr = int(values[2])
+       results[values[3]][values[0]][values[1]][snr] = float(values[4])
+#    results[values[3]].append((values[1],values[2],values[2],values[4]))
+
+ax = plt.subplot(111)
+
+train_set = 'inner'
+lines = []
+labels = []
+for feature_type in ('mfcc', 'mfcc_vtln', 'aim'):
+  for feature_subtype in results[train_set][feature_type].keys():
+    this_line = results[train_set][feature_type][feature_subtype].items()
+    this_line.sort(cmp=lambda x,y: x[0] - y[0])
+    xs, ys = zip(*this_line)
+    xs = list(xs)
+    ys = list(ys)
+    line, = ax.plot(xs,ys,'-o',linewidth=2)
+    lines.append(line)
+    labels.append(feature_type + "_" + feature_subtype)
+p.legend(lines, labels, 'upper left', shadow=True)
+p.xlabel('SNR/dB')
+p.ylabel('Recognition performance %')
+plt.show()