# HG changeset patch # User tomwalters # Date 1288571460 0 # Node ID 9dd4aee69f586cf8c065cb7819d394706d06f9b2 # Parent 11892847d09559b981d97e8ffafe70084d6b5dd2 - Scripts for plotting summary performance graphs. diff -r 11892847d095 -r 9dd4aee69f58 experiments/scripts/cnbh-syllables/results_plotting/munge_results.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/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 diff -r 11892847d095 -r 9dd4aee69f58 experiments/scripts/cnbh-syllables/results_plotting/plot_munged_results.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/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()