In [1]:
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline

In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [2]:
# Import stats
FILE = 'cleaned_stats.csv'
# JSON = '../stats.json'
JSON = '../stats50.json'

In [3]:
#df = pd.read_csv(FILE)
df = pd.read_json(JSON)

In [4]:
del df['board']
df.head()


Out[4]:
dimension heuristic rand_degree steps time
0 5 1 15 NaN 1067401.680
1 5 2 15 2164.0 44692.390
2 5 1 15 NaN 1043000.295
3 5 2 15 NaN 1059986.975
4 5 1 15 NaN 1026634.820

In [5]:
df['time_m'] = df['time']/60000
df.head()


Out[5]:
dimension heuristic rand_degree steps time time_m
0 5 1 15 NaN 1067401.680 17.790028
1 5 2 15 2164.0 44692.390 0.744873
2 5 1 15 NaN 1043000.295 17.383338
3 5 2 15 NaN 1059986.975 17.666450
4 5 1 15 NaN 1026634.820 17.110580

In [6]:
df.columns = ['Dimension','Heuristic', 'Rand_degree', 'Steps', 'Time in ms', 'Time in minutes']

In [7]:
df.groupby('Heuristic').describe(include=[np.number])


Out[7]:
Dimension Rand_degree Steps Time in minutes Time in ms
Heuristic
1 count 900.000000 900.000000 737.000000 900.000000 9.000000e+02
mean 4.000000 10.000000 1142.120760 2.634366 1.580620e+05
std 0.816951 4.084753 2202.493057 5.685925 3.411555e+05
min 3.000000 5.000000 2.000000 0.000012 6.950000e-01
25% 3.000000 5.000000 6.000000 0.000053 3.182500e+00
50% 4.000000 10.000000 17.000000 0.004524 2.714175e+02
75% 5.000000 15.000000 921.000000 1.394405 8.366430e+04
max 5.000000 15.000000 9737.000000 37.801713 2.268103e+06
2 count 900.000000 900.000000 787.000000 900.000000 9.000000e+02
mean 4.000000 10.000000 783.714104 1.811633 1.086980e+05
std 0.816951 4.084753 1878.861366 4.641229 2.784737e+05
min 3.000000 5.000000 2.000000 0.000011 6.550000e-01
25% 3.000000 5.000000 5.000000 0.000038 2.265000e+00
50% 4.000000 10.000000 10.000000 0.000119 7.137500e+00
75% 5.000000 15.000000 329.000000 0.131653 7.899185e+03
max 5.000000 15.000000 9995.000000 31.918191 1.915091e+06

In [6]:
dn = df[np.isfinite(df['steps'])]
dn.groupby('heuristic').describe(include=[np.number])


Out[6]:
dimension rand_degree steps time
heuristic
1 count 737.000000 737.000000 737.000000 737.000000
mean 3.905020 8.907734 1142.120760 23112.467110
std 0.835158 3.703649 2202.493057 77859.160373
min 3.000000 5.000000 2.000000 0.695000
25% 3.000000 5.000000 6.000000 2.810000
50% 4.000000 10.000000 17.000000 13.605000
75% 5.000000 10.000000 921.000000 4119.600000
max 5.000000 15.000000 9737.000000 990358.715000
2 count 787.000000 787.000000 787.000000 787.000000
mean 3.946633 9.282084 783.714104 20018.015305
std 0.827146 3.869595 1878.861366 84576.032327
min 3.000000 5.000000 2.000000 0.655000
25% 3.000000 5.000000 5.000000 1.917500
50% 4.000000 10.000000 10.000000 4.460000
75% 5.000000 10.000000 329.000000 542.470000
max 5.000000 15.000000 9995.000000 875336.620000

In [ ]:


In [ ]:


In [ ]:
sns.factorplot(x='dimension', y='steps', data=df, hue='rand_degree', col='heuristic', size=7)

In [ ]:
sns.factorplot(x='dimension', y='time', data=df, hue='rand_degree', col='heuristic', size=7)

In [ ]:
g = sns.FacetGrid(data=df, row='dimension', col='heuristic', hue='rand_degree', sharex=True, sharey=True, aspect=2, size=7)
g =(g.map(sns.pointplot, "time", "steps").add_legend())

In [ ]:
sns.stripplot( x="dimension", y="steps", data=df, jitter=True,hue="rand_degree", size=4);

In [ ]:
sns.stripplot(x="rand_degree", y="time", data=df, jitter=True, hue="dimension", size=4);

In [ ]:
sns.stripplot(x="dimension", y="steps", data=df, jitter=True, hue="rand_degree", size=4);

In [ ]:
sns.stripplot(x="dimension", y="time", data=df, jitter=True, hue="rand_degree", size=4);

In [ ]:
sns.swarmplot(x="dimension", y="steps", data=df, hue="rand_degree");

In [ ]:
sns.swarmplot(x="dimension", y="time", data=df, hue="rand_degree");

In [ ]:
sns.swarmplot(x="rand_degree", y="steps", data=df, hue="dimension");

In [ ]:
sns.swarmplot(x="rand_degree", y="time", data=df, hue="dimension");

In [ ]:
sns.boxplot(x="rand_degree", y="steps", data=df, hue="dimension");

In [ ]:
sns.boxplot(x="rand_degree", y="time", data=df, hue="dimension");

In [ ]:
sns.boxplot(x="dimension", y="steps", data=df, hue="rand_degree");

In [ ]:
sns.boxplot(x="dimension", y="time", data=df, hue="rand_degree");

In [ ]:
sns.lmplot(x="steps", y="time", hue="dimension", col="heuristic", row='rand_degree', data=df)

In [ ]:
sns.lmplot(x="steps", y="time", hue="rand_degree", col="heuristic", row='dimension', data=df)

In [ ]:
sns.lmplot(x="steps", y="time", row="dimension", col="heuristic", hue="rand_degree",data=df)

In [ ]:
sns.lmplot(x="steps", y="time", hue="dimension", col="heuristic", row="rand_degree", data=df)

In [ ]:
sns.distplot(df['time'], bins=3)

In [ ]:
sns.lmplot(y="time", x="steps", col="dimension", row="rand_degree", data=df)

In [ ]:
sns.lmplot(y="steps", x="dimension", row="dimension", col="heuristic",hue="rand_degree", data=df)

In [ ]:
sns.lmplot(y="time", x="dimension", row="dimension", col="heuristic",hue="rand_degree", data=df)

In [ ]:
sns.lmplot(y="steps", x="dimension", hue="dimension", row="rand_degree", col="heuristic", data=df,  x_jitter=.1)

In [ ]:


In [ ]:


In [ ]:


In [ ]:


In [55]:
g = sns.lmplot(x="Steps", y="Time in minutes", hue="Rand_degree", col="Heuristic", row='Dimension', data=df)



In [44]:
sns.factorplot(x='Dimension', y='Steps', data=df, hue='Rand_degree', col='Heuristic', size=7)


Out[44]:
<seaborn.axisgrid.FacetGrid at 0x11e61c208>

In [45]:
sns.factorplot(x='Dimension', y='Time in minutes', data=df, hue='Rand_degree', col='Heuristic', size=7)


Out[45]:
<seaborn.axisgrid.FacetGrid at 0x11fd33be0>

In [12]:
g = sns.lmplot(y="Steps", x="Dimension", row="Dimension", col="Heuristic",hue="Rand_degree", data=df)
g.set(xticks=[3,4,5])


Out[12]:
<seaborn.axisgrid.FacetGrid at 0x119f3d240>

In [15]:
g= sns.lmplot(y="Time in minutes", x="Dimension", row="Dimension", col="Heuristic",hue="Rand_degree", data=df)
g.set(xticks=[3,4,5])


Out[15]:
<seaborn.axisgrid.FacetGrid at 0x115a9d160>

In [48]:
sns.boxplot(x="Rand_degree", y="Steps", data=df, hue="Dimension");



In [ ]:


In [ ]: