saaps.ann
Class TimeSeriesToDataMap
java.lang.Object
|
+--saaps.ann.TimeSeriesToDataMap
- public class TimeSeriesToDataMap
- extends java.lang.Object
The TimeSeriesToDataMap
is used to convert a TimeSeries
object
into a Data
object to be used as input to a neural network. Two things are
made with the mapper: normalization and transformation.
The mapping information is given in two integer arrays connecting the elements in the
TimeSeries
object to the Data
object.
The first array, the time
array, describes the time delay or time shifts.
The second array, the field
array, describes what data field should be used.
The lengths of time
and field
must be the same. The number of
connections (inputs) of the resulting Data
object will equal the length of
time
(and field
). The number of examples in the Data
object will equal the number of examples in the TimeSeries
object minus the
length of time
plus one.
The easiest way to determine time
and field
is to consider what the
first example in the Data
object should be. Suppose that the first three
observations of data fields 2 and 3 of the TimeSeries
object should make up the
first example in the Data
object. Then we will have time=[0,1,2,0,1,2]
and field=[2,2,2,3,3,3]
. The same mapping is then shifted one time step at a time
through the TimeSeries
object to generate new examples in the Data
object.
Constructor Summary |
TimeSeriesToDataMap()
Creates new TimeSeriesToDataMap |
TimeSeriesToDataMap(int[] times,
int[] fields)
Create the mapping object from two integer arrays of the same length. |
Method Summary |
Data |
convert(TimeSeries ts)
Convert the TimeSeries object into a Data object
according to the specified mapping. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
TimeSeriesToDataMap
public TimeSeriesToDataMap()
- Creates new TimeSeriesToDataMap
TimeSeriesToDataMap
public TimeSeriesToDataMap(int[] times,
int[] fields)
- Create the mapping object from two integer arrays of the same length.
- Parameters:
times
- The time mappingfields
- The data field mapping
convert
public Data convert(TimeSeries ts)
- Convert the
TimeSeries
object into a Data
object
according to the specified mapping.
- Parameters:
ts
- The time series to be converted- Returns:
- The
Data
object