com.yahoo.egads.models.tsmm
Class OlympicModel2
- java.lang.Object
-
- com.yahoo.egads.models.tsmm.TimeSeriesAbstractModel
-
- com.yahoo.egads.models.tsmm.OlympicModel2
-
- All Implemented Interfaces:
- JsonAble, Model, TimeSeriesModel, java.io.Serializable
public class OlympicModel2 extends TimeSeriesAbstractModel
TODO - rename this! This model generates forecasts using an average of period-over-period baseline data. For example, if the window distance is 1 week and the user asks for 4 past windows, a prediction at time T will be generated from the average (or WINDOW_AGGREGATION) of T - 1 week, T - 2 weeks, T - 3 weeks and T - 4 weeks.Properties
- INTERVAL - REQUIRED: The timestamp interval of the resulting model, in combination with the PERIOD_SIZE_UNITS. E.g. for a 5 minute window period, set this value to "5".
- INTERVAL_UNITS - REQUIRED: A Java ChronoUnit enumerator representing the units of the PERIOD_SIZE. E.g. "minutes" or "seconds".
- WINDOW_SIZE - REQUIRED: How many values should be generated for the model, e.g. if you want to generate a model for a day, set this to 1 and set WINDOW_SIZE_UNITS to "days"
- WINDOW_SIZE_UNITS - REQUIRED: A Java ChronoUnit enumerator representing the units of the WINDOW_SIZE. E.g. "minutes" or "seconds".
- WINDOW_DISTANCE - The timestamp interval between windows in the baseline. E.g. for a week-over-week model, set this value to "1".
- WINDOW_DISTANCE_UNITS - REQUIRED: A Java ChronoUnit enumerator representing the units of the WINDOW_DISTANCE. E.g. "minutes" or "seconds".
- MODEL_START - REQUIRED: The start time of the model in Unix epoch seconds. This will be the first timestamp of the model and determines the offsets for parsing the baseline. E.g. 1474756200.
- HISTORICAL_WINDOWS - The number of windows in the past to generate the model from. E.g. for 4 weeks of week-over-week, set this to 4. Defaults to 1 window.
- WINDOW_AGGREGATOR - An aggregation function to use when merging data points across historical windows. Can be one of SUM, MAX, MIN, COUNT, AVG, WAVG or MEDIAN. Defaults to AVG.
- TIMEZONE - An optional time zone to align data to. Must be parseable by Java's ZoneId, e.g. "Australia/Lord_Howe". Defaults to "UTC".
- ENABLE_WEIGHTING - Whether or not to enable higher weighting for more recent values in the baseline. Defaults to false.
- FUTURE_WINDOWS - How many periods to forecast in the future for generating the model. Defaults to 1.
- NUM_TO_DROP_HIGHEST - How many of the highest values to drop amongst the windows at each timestamp. Defaults to 0.
- NUM_TO_DROP_LOWEST - How many of the lowest values to drop amongst the windows at each timestamp. Defaults to 0.
Optionally weighting can be applied wherein more recent values (e.g. T - 1 week) have more weight than older values (e.g. T - 4 weeks).
Also, for each data point, the n highest and n lowest values can be dropped. Using the example above, if we have T - 1w = 4, T - 2w = 2, T - 3w = 5, T - 4w = 1 and we drop 1 high and 1 low, then the resulting would be the average of T - 1w and T - 2w for a value of 2.
If a time zone is given, the baseline and forecast timestamps will be adjusted for DST if necessary.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description OlympicModel2(java.util.Properties config)Default Ctor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidpredict(TimeSeries.DataSequence sequence)voidreset()voidtrain(TimeSeries.DataSequence data)voidupdate(TimeSeries.DataSequence data)-
Methods inherited from class com.yahoo.egads.models.tsmm.TimeSeriesAbstractModel
betterThan, fromJson, getBias, getMAD, getMAPE, getModelName, getModelType, getMSE, getSAE, toJson
-
-
-
-
Constructor Detail
-
OlympicModel2
public OlympicModel2(java.util.Properties config)
Default Ctor- Parameters:
config- A non-null and non-empty properties map.- Throws:
java.lang.IllegalArgumentException- if a required property is missing.java.lang.NumberFormatException- if a numeric property could not be parsed.
-
-
Method Detail
-
train
public void train(TimeSeries.DataSequence data) throws java.lang.Exception
- Throws:
java.lang.Exception
-
update
public void update(TimeSeries.DataSequence data) throws java.lang.Exception
- Throws:
java.lang.Exception
-
predict
public void predict(TimeSeries.DataSequence sequence) throws java.lang.Exception
- Throws:
java.lang.Exception
-
reset
public void reset()
-
-
DataMelt 3.0 © DataMelt by jWork.ORG