mattfoster (owner)

Revisions

gist: 59382 Download_button fork
public
Public Clone URL: git://gist.github.com/59382.git
Embed All Files: show embed
macheist_plot.py #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import numpy as np
import matplotlib as mpl
import matplotlib.pylab as plt
import time
 
from datetime import datetime
 
f = plt.load('heist_countdown')
x = f[:,1]
y = f[:,0]
 
A = np.vstack([x, np.ones(len(x))]).T
m, c = np.linalg.lstsq(A, y)[0]
# Uncomment for a plot!
plt.plot(x, y )
plt.plot(x, y, 'x', label='Web Data')
xx = np.arange(490, 505, 5)
plt.plot(xx, m*xx + c, 'r', label='Fitted line')
plt.title('MacHeist Release Estimate')
plt.xlabel('Bar Width')
plt.ylabel('Time')
plt.legend()
plt.show()
 
est = m*500 + c
 
print "MacHeist Completion Estimate:",
print datetime.fromtimestamp(est).strftime("%Y-%m-%d %H:%M:%S")