In [1]:
import pandas as pd
import matplotlib.pyplot as plt

S = ['ours', 'pearson', 'cos', 'msd', 'po', 'pc', 'co']
dataset = {}
colors = ['r', 'grey', 'g', 'b', 'y', 'm', 'c', 'k', 'brown']
start = 'stats_ml_'

for sim in S:
    name = start+sim+'.txt'
    df = pd.read_csv(name)
    dataset[sim] = df
    #print(name)
X = dataset[S[0]].Threshold
#print(X)
for sim in S:
    dataset[sim].columns = [column.lstrip() for column in df.columns]
i = 0
#for sim in S:
 #   print(dataset[sim].columns)
X = dataset['pearson']['Threshold'].values
Y = dataset['pearson']['MAE'].values
#plt.plot(X, Y, 'grey')
#plt.xlabel('Thresholds')
#plt.ylabel('Mean Absolute Errors for JMSD')
#fig = plt.gcf()
#plt.show()
#plt.draw()
#fig.savefig('graphs/jmsd_mae.png')
for sim in S:
    for column in dataset[sim]:
        if column != 'Threshold':
            dataset[sim][column] = [100.0*x for x in dataset[sim][column]]
for sim in S:
    #print(sim)
    val = dataset[sim].loc[dataset[sim].Threshold == .4]
    #print(val)

Y = []
for sim in S:
    val = dataset[sim]['Harmonic Mean']
    #val = val[:-3]
    #print(sim +' '+ str(val.mean()))
    Y.append(val.mean())
#print(X, Y)
#dataset['ours'].plot(x='Threshold', y = 'Harmonic Mean')
#fig = plt.gcf()
#plt.show()
#plt.draw()
#fig.savefig('graphs/ourf1.png')
#dataset['cos'].plot()
#plt.show()

In [14]:
import numpy as np
s = ['pearson', 'ours', 'po']
ticks = ['Pearson', 'Proposed', 'Hybrid of Pearson-Proposed']
#X = np.array([0,1,2])
#plt.xticks(X, ticks)
X = dataset[s[1]]['Threshold'].values
#print(X)
Y = dataset[s[1]]['Harmonic Mean'].values
plt.xlabel('Threshold values')
plt.ylabel('Harmonic mean for Proposed')
plt.plot(X, Y, color = np.random.rand(3,))
fig = plt.gcf()
plt.show()
plt.draw()
fig.savefig('graphs/ourf1.png')



In [ ]:


In [ ]: