Icon

3. Time Series Analysis with Flow Variables

<p><strong>Time Series Analysis with Machine Learning and Flow Variables</strong></p><p>This workflow is similar to the workflow shown in Chapter 4 "3. Time Series Analysis with Machine Learning". It 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>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. Instead of adjusting the value manually in the configuration window of the component, this time we use a flow variable to overwrite the setting. </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 and Flow Variables This workflow is similar to the workflow shown in Chapter 4 "3. Time Series Analysis with Machine Learning". It shows an example of a time series analysis using the verified components Inspect Seasonality and Remove Seasonality. However, instead of finding the lag value manually and adjusting the configuration of the Remove Seasonality components, we use the flow variable created by the Inspect Seasonaility component to overwrite the setting in the component. The rest of the example workflow remained unchanged.
  • 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
  • Remove Column2
  • Exclude missing values
  • 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
  • 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
  • Lag Value
  • 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
  • 90/10 split; Take from the top

Nodes

Extensions

Links