com.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException: The macro 'next_previous_link3' is unknown.

Sample 0116 - Performing Linear Regression


Introduction

This sample demonstrates how to run Linear Regression using the Timeseries Toolbox. This sample uses Event Simulator for inputs and the logger publisher for logging the outputs to the DAS console.

The data used for the regression is from a baseball stats dataset. The dependent variable (predictor variable) is the salary of the Baseball player based on his performance statistics which are the independent variables – rbi, walks, strikeouts and errors.

The execution plan used in this sample is as follows:

 

from baseballData#timeseries:regress(2, 10000, 0.95, salary, rbi, walks, strikeouts, errors)
select *
insert into regResults;

The inputs to the regression function are as follows.

  • Calculation Interval – 2

  • Batch size – 10,000

  • Confidence Interval – 0.95

  • Y (dependent) variable – salary

  • X (independent) variables – rbi, walks, strikeouts, errors

The output of the query will be the coefficients of the regression equation for the accumulated dataset at each 2nd event. The output attributes will include the input variable values, beta coefficients for each X variable, beta zero and the standard error.

For more detail on input and output parameters of regression see Regression.

Prerequisites

Set up the prerequisites required for all samples.

Building the sample

Start the WSO2 DAS server with the sample configuration numbered 0116. For instructions, see Starting sample CEP configurations.

This sample configuration does the following:

  •  Points the default Axis2 repo to the <DAS_HOME>/samples/cep/artifacts/0116 directory (by default, the Axis2 repo is <DAS_HOME>/repository/deployment/server).

Executing the sample

  1. Log into the DAS management console.

  2. Go to Tools -> Event Simulator. Under the Multiple Events section, the BaseballData.csv file is listed. This file contains the sample data. Click Play to start sending sample events from the file.

  3. See the output events received from the DAS console. This sample uses the logger adaptor to log output events to the console.

For example, given below is a screenshot of the final regression output for this data.



com.atlassian.confluence.content.render.xhtml.migration.exceptions.UnknownMacroMigrationException: The macro 'next_previous_links2' is unknown.