public class Utils extends Object
Constructor and Description |
---|
Utils() |
Modifier and Type | Method and Description |
---|---|
static double |
advanceSuppliedTimeValue(double valueToAdvance,
TSLagMaker.PeriodicityHandler dateBasedPeriodicity)
Utility method to advance a supplied time value by one unit.
|
static double |
decrementSuppliedTimeValue(double valueToDecrement,
TSLagMaker.PeriodicityHandler dateBasedPeriodicity)
Utility method to decrement a supplied time value by one unit.
|
static weka.core.Instances |
insertMissing(weka.core.Instances toInsert,
weka.core.Attribute timeStampAtt,
TSLagMaker.PeriodicityHandler periodicityHandler,
String m_skipEntries,
List<String> missingReport)
Check to see if there are any instances (time steps) that are missing
entirely from the data (and are not in the skip list).
|
static weka.core.Instances |
replaceMissing(weka.core.Instances toReplace,
List<String> targets,
String timeStampName,
boolean dateOnly,
TSLagMaker.Periodicity userHint,
String skipEntries,
Object... missingReport)
Replace missing target values by interpolation.
|
public static weka.core.Instances insertMissing(weka.core.Instances toInsert, weka.core.Attribute timeStampAtt, TSLagMaker.PeriodicityHandler periodicityHandler, String m_skipEntries, List<String> missingReport)
toInsert
- the instances to checktimeStampAtt
- the name of time stamp attperiodicityHandler
- the periodicity handlerm_skipEntries
- the list of data "holes" that are expected (i.e. don't
actually count as time stamp increments)missingReport
- will hold time stamps of any instances we insertpublic static weka.core.Instances replaceMissing(weka.core.Instances toReplace, List<String> targets, String timeStampName, boolean dateOnly, TSLagMaker.Periodicity userHint, String skipEntries, Object... missingReport)
toReplace
- the instances to replace missing target values and time
stamp valuestargets
- a list of target attributes to check for missing valuestimeStampName
- the name of the time stamp attribute (or null if there
is no time stamp)dateOnly
- if true, only replace missing date values and not missing
target values (useful for hold-out test sets)userHint
- user-specified hint as to the data periodicityskipEntries
- any skip entries (may be null)missingReport
- a varargs parameter that, if provided, is expected to
be up to two lists of Integers and one list of Strings. The first
list will be populated with the instance numbers (duplicates are
possible) of instances that have missing targets replaced. The
second list will be populated with the instance numbers of
instances that have missing time stamp values replaced. The third
list will be populated with the time stamps for any new instances
that are inserted into the data (i.e. if we detect that there are
"holes" in the data that aren't covered by the skip list entries.public static double advanceSuppliedTimeValue(double valueToAdvance, TSLagMaker.PeriodicityHandler dateBasedPeriodicity)
valueToAdvance
- the time value to advancedateBasedPeriodicity
- the periodicity to use for data arithmeticpublic static double decrementSuppliedTimeValue(double valueToDecrement, TSLagMaker.PeriodicityHandler dateBasedPeriodicity)
valueToDecrement
- the time value to decrementdateBasedPeriodicity
- the periodicity to use for data arithmeticCopyright © 2019 University of Waikato, Hamilton, NZ. All Rights Reserved.