y += noise
a, b, c = polyfit(x, y, 2)
y_pred = polyval([a, b, c], x)
MSE = NP.sqrt(NP.sum((y_pred - y) ** 2) / 10)
x_out = NP.linspace(0, 2, 20)
y_pred = polyval([a, b, c], x_out)
fig = PLT.figure()
ax1 = fig.add_subplot(111)
ax1.plot(x, y, 'g.', x_out, y_pred, 'b-')
PLT.show()
Extrapolation from data plotted using matplotlib