Skip to content

Instantly share code, notes, and snippets.

@wannaphong
Created May 15, 2017
Embed
What would you like to do?
# ทำนายแบบแสดงกราฟ 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