public class LinearRegressionProcessor extends Object implements TimeSeriesProcessor<double[],Double,DoubleTimeSeries>
LinearRegression
model, a time series is used as input to
calculate the coefficients of a linear regression such that value = b * time
+ c
This is the simplest kind of model that can be applied to a time seriesConstructor and Description |
---|
LinearRegressionProcessor()
Calculate the regression from the same time series inputed
|
LinearRegressionProcessor(LinearRegression reg)
Use reg as the linear regression to predict.
|
Modifier and Type | Method and Description |
---|---|
LinearRegression |
getRegression() |
void |
holdreg(boolean regdefined) |
void |
process(DoubleTimeSeries series) |
public LinearRegressionProcessor()
public LinearRegressionProcessor(LinearRegression reg)
process(DoubleTimeSeries)
function simply calls
LinearRegression.predict(Matrix)
with the times in the series as
inputreg
- public void process(DoubleTimeSeries series)
process
in interface TimeSeriesProcessor<double[],Double,DoubleTimeSeries>
series
- alter this time series in placepublic void holdreg(boolean regdefined)
regdefined
- if true, process holds its last LinearRegression
public LinearRegression getRegression()
LinearRegressionProcessor
's underlying
LinearRegression
model