Accumulates a time series of dated observations and builds an AnomalyDetectionModel or ForecastModel from them. Obtained via ChartManager.newRegressionBuilder(String), typically reached from JS via services.chartManager. Add observations with addData(Date, double) in chronological order, then call buildAnomalyDetector() or buildForecaster() to analyse or forecast the series.
Group: Builders
Methods
addData(Date x, double y)
Returns: RegressionBuilder
Adds one dated observation to this builder's data set. Observations should be added in chronological order, since forecasting and anomaly detection treat the accumulated list as a time-ordered series indexed by the order data points were added.
| Parameter | Description |
|---|---|
x | the observation's date; must not be null |
y | the observed value at that date |
withFrequency(Frequency f)
Returns: RegressionBuilder
Sets the frequency at which forecast periods are generated by buildForecaster(); has no effect on anomaly detection.
| Parameter | Description |
|---|---|
f | the forecast period frequency |
withFrequency(String f)
Returns: RegressionBuilder
Sets the forecast frequency by name; see withFrequency(Frequency) for how it is used.
| Parameter | Description |
|---|---|
f | the frequency name, matching a ChartManager.Frequency constant such as DAILY or MONTHLY |
buildAnomalyDetector(Date anomalyStartDate)
Returns: AnomalyDetectionModel
Builds and trains an AnomalyDetectionModel from the observations added so far.
| Parameter | Description |
|---|---|
anomalyStartDate | the date after which anomalies are looked for |
buildForecaster(Date predictionEndDate)
Returns: ForecastModel
Builds and trains a ForecastModel from the observations added so far, forecasting forward to the given end date at the frequency set via withFrequency().
| Parameter | Description |
|---|---|
predictionEndDate | the date to forecast up to |