In [2]:
%matplotlib qt4

from models import tools, optimize, models, filters

import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm

In [4]:
data = tools.load_data(limit=20000, offset=1500000)
data = data[filters.open_questions(data)]
print len(data)


11823

In [7]:
grid_search = optimize.GridSearch(data)

In [23]:
intervals_alpha = np.arange(0.1, 5, 0.2)
intervals_beta = np.arange(0.01, 0.5, 0.02)

result_elo = grid_search.search_elo(intervals_alpha, intervals_beta)


25/25 25/25

In [56]:
intervals_gamma = np.arange(0, 6, 0.12)
intervals_delta = np.arange(-3, 3, 0.12)

result_pfae = grid_search.search_pfae(intervals_gamma, intervals_delta)


50/50 50/50

In [58]:
result_pfae.plot_off(cmap=None)


Out[58]:
<matplotlib.image.AxesImage at 0x7f58af5e79d0>

In [68]:
plt.figure(1)

plt.subplot(121)
result_pfae.plot_rmse(cmap=cm.jet_r, title='RMSE')
plt.xlabel(r'$\gamma$', fontsize=18)
plt.ylabel(r'$\delta$', fontsize=18)

plt.subplot(122)
result_pfae.plot_off(cmap=cm.jet_r, title='predicted - observed')
plt.xlabel(r'$\gamma$', fontsize=18)
plt.ylabel(r'$\delta$', fontsize=18)


Out[68]:
<matplotlib.text.Text at 0x7f58aebb2f90>

In [11]:
def elot_factory(x, y):
    return models.EloResponseTime(zeta=x)

In [12]:
result = grid_search.search(
    elot_factory,
    xvalues=np.arange(1, 50, 2),
    yvalues=[1],
    xlabel='$\zeta$', ylabel='-'
)


25/25 1/1

In [ ]: