Skip to content

Instantly share code, notes, and snippets.

@wannaphong
Created May 15, 2017 03:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wannaphong/f74625ec7e02a0c7ff57169ae7e80d7b to your computer and use it in GitHub Desktop.
Save wannaphong/f74625ec7e02a0c7ff57169ae7e80d7b to your computer and use it in GitHub Desktop.
# ทำนายแบบแสดงกราฟ 10 ปี
time2 = pd.date_range('2018', periods=10, freq='A')
data2=pd.DataFrame({'date':time2.values})
data2['date_ordinal'] = data2['date'].apply(lambda x: x.toordinal())
x= data2[['date_ordinal']]
aa=pd.DataFrame({'date':time2,'value':model.predict(x)})
plt.plot(listtime+time2.tolist(),thai+list(model.predict(x))) # หากเติม a1 กับ thai จะแสดงปีทั้งหมดรวมถึงที่ทำนาย
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment