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>
Annotations and comments
  • 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.
  • 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
  • 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
  • Rebuilding the signal
  • website.txt
  • fail if step size > max lag
  • Calculate sample acf
  • signalcolumn
  • Cut Off
  • Calculate row count
  • Max Lag
  • Step Size
  • join with original data
  • ACF
  • PACF
  • check that step size <= max lag
  • Colors
  • export dominant seasonality lag as flow variable
  • Plot no visitors vs. Prediction (no visitors)
  • no visitors (original) vs. Prediction (no visitors) (original)
  • Calculate statistics
  • 90/10 split; Take from the top
  • get only value column
  • take only lag column
  • remove lag col
  • Only allows for numeric selection
  • rename col to data
  • rename lag
  • rename col
  • Value Column
  • get number of rows
  • create col name
  • join with original table
  • create lag cols
  • remove missing rows
  • replace missing vals with 0
  • take only new column
  • name the new column
  • Seasonality Column
  • join both input tables
  • join with original input table
  • Reshape data
  • Remove Column2
  • Exclude missing values

Nodes

Extensions

Links