Skip to Content
Hands-On Industrial Internet of Things
book

Hands-On Industrial Internet of Things

by Giacomo Veneri, Antonio Capasso
November 2018
Intermediate to advanced
556 pages
14h 42m
English
Packt Publishing
Content preview from Hands-On Industrial Internet of Things

Step 3 – building the model

The following code loads the data, splits it into two parts as described previously, builds the model with the training data and, finally predicts production for the next 20 days:

from statsmodels.tsa.arima_model import ARIMAimport matplotlib.pyplot as pltimport pandas as pd# read the datasetdf = pd.read_csv('./data/data_refinery.csv')print(df.head)# splitting data-set between train and testy=df['crude_flow'].valuesn=len(y)s = int(len(y) * 0.7)train, test = y[0:s+1], y[s:n]# Evaluating ARIMAorder=order=(3,1,2)model = ARIMA(train, order)model_fit = model.fit(disp=0)# Forecastingprediction=model_fit.forecast(steps=n-s)[0]# Visualizationplt.plot(train,'y', label='train')plt.plot(range(s,n),test,'k', label='test') ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Internet of Things

Internet of Things

S. Velliangiri, Sathish A.P. Kumar, P. Karthikeyan
Industrial Internet Application Development

Industrial Internet Application Development

Alena Traukina, Jayant Thomas, Prashant Tyagi, Veera Kishore Reddipalli

Publisher Resources

ISBN: 9781789537222Supplemental Content