Icon

3. Time Series Analysis with Machine Learning

<p><strong>Time Series Analysis with Machine Learning</strong></p><p>This workflow shows an example of a time series analysis using the verified components <em>Inspect Seasonality</em> and <em>Remove Seasonality</em>.</p><p>The data for this example is website traffic data, reflecting the daily number of website visitors, and we want to predict the next day's number of visitors given the number of visitors in the past <em>n</em> days.</p><p>However, to detect and deal with the seasonality in the data we first use the <em>Inspect Seasonality</em> component to find a sign of dominant seasonality. Then, to remove seasonality trends in the data, we use the <em>Remove Seasonality</em> components. In this case we define <em>n</em> (the lag value) as 7. </p><p>Lastly, we train and apply a Linear Regression, however, any other numerical prediction algorithm would have worked as well.</p>

Accessing and preprocessing data

Read website.txt file to get daily numbers of website visitors. Note: "Support short data rows" must be enabled.

Detect & deal with seasonality

Rebuilding the signal

Workflow: Time Series Analysis with Machine Learning


This workflow shows an example of a time series analysis using the verified components Inspect Seasonality and Remove Seasonality.

The data for this example is website traffic data, reflecting the daily number of website visitors, and we want to predict the next day's number of visitors given the number of visitors in the past n days. However, to detect and deal with the seasonality in the data we first use the Inspect Seasonality component to find a sign of dominant seasonality. Then, to remove seasonality trends in the data, we use the Remove Seasonality components. In this case we define n (the lag value) as 7. Lastly, we train and apply a Linear Regression, however, any other numerical prediction algorithm would have worked as well.

Create lag intervals

Copy and shift "no visitors" column n times: from x(t) to x(t), x(t-1), x(t-2), ..., x(t-n).

n = 7 (lag value)

Training Linear Regression & applying trained model on test set

Evaluate prediction

Lag value forhighest maximum: 7
Inspect Seasonality
Remove missing values;sort by date ascending
Clean and sort data
Reshape data
Table Manipulator
website.txt
CSV Reader
On predictions
Return Seasonality
Reshape data
Table Manipulator
On no visitors
Return Seasonality
Lag value: 7
Remove Seasonality
Lag Column
Plot no visitors vs. Prediction (no visitors)
Line Plot
90/10 split;Take from the top
Table Partitioner
Linear Regression Learner
Calculate statistics
Numeric Scorer
Lag value: 7
Remove Seasonality
Lag Column
Regression Predictor
no visitors (original) vs. Prediction (no visitors) (original)
Line Plot

Nodes

Extensions

Links