Created
June 9, 2018 18:09
-
-
Save RadoslawB/8457367c78f1507eed95eb9b0ac7ce4d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from matplotlib import animation | |
predictions_history = [] | |
# append arrays of Y_test values to predictions hostory | |
fig, ax = plt.subplots() | |
ax.grid() | |
scatter = ax.scatter(X_train,Y_train, s=5, c='r') | |
parabola, = ax.plot(X_train, predictions_history[0]) | |
# initialization function: plot the background of each frame | |
def init(): | |
return parabola, | |
# animation function. This is called sequentially | |
def animate(i): | |
parabola.set_ydata(predictions_history[i]) | |
return parabola, | |
# call the animator. blit=True means only re-draw the parts that have changed. | |
anim = animation.FuncAnimation(fig, animate, init_func=init, | |
frames=50, interval=10, blit=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment