Class TimeSeriesDataset<L>

    • Constructor Detail

      • TimeSeriesDataset

        public TimeSeriesDataset​(java.util.List<org.nd4j.linalg.api.ndarray.INDArray> valueMatrices,
                                 java.util.List<org.nd4j.linalg.api.ndarray.INDArray> timestampMatrices,
                                 org.nd4j.linalg.api.ndarray.INDArray targets,
                                 IAttributeType<L> targetType)
        Creates a TimeSeries dataset. Let `n` be the number of instances.
        Parameters:
        valueMatrices - Values for the time series variables. List of 2D-Arrays with shape `[n, ?]`.
        timestampMatrices - Timestamps for the time series variables. List of 2D-Arrays with shape `[n, ?]`. Or `null` if no timestamps exist for the corresponding time series variable. The shape of the `i`th index must be equal to the shape of the `i`th element of `valueMatrices`.
        targets - Target values for the instances.
    • Method Detail

      • add

        public void add​(org.nd4j.linalg.api.ndarray.INDArray valueMatrix,
                        org.nd4j.linalg.api.ndarray.INDArray timestampMatrix)
        Add a time series variable to the dataset.
        Parameters:
        valueMatrix - Values for the time series variable to add. 2D-Arrays with shape `[n, ?]` where `n` is the number of instances of the dataset.
        timestampMatrix - Timestamps for the time series variable to add. 2D-Arrays with shape `[n, ?]` where `n` is the number of instances of the dataset. Or `null` if no timestamp exists for this time series variable.
      • remove

        public TimeSeriesInstance<L> remove​(int index)
        Removes the time series variable at a given index.
        Specified by:
        remove in interface java.util.List<L>
        Parameters:
        index -
        Returns:
        Throws:
        java.lang.IndexOutOfBoundsException
      • replace

        public void replace​(int index,
                            org.nd4j.linalg.api.ndarray.INDArray valueMatrix,
                            org.nd4j.linalg.api.ndarray.INDArray timestampMatrix)
        Replaces the time series variable at a given index with a new one.
        Parameters:
        index - Index of the time series varialbe to replace.
        valueMatrix - Values for the time series variable to add. 2D-Arrays with shape `[n, ?]` where `n` is the number of instances of the dataset.
        timestampMatrix - Timestamps for the time series variable to add. 2D-Arrays with shape `[n, ?]` where `n` is the number of instances of the dataset. Or `null` if no timestamp exists for this time series variable.
        Throws:
        java.lang.IndexOutOfBoundsException - Thrown if `numberOfInstances <= index`.
      • getTargets

        public org.nd4j.linalg.api.ndarray.INDArray getTargets()
      • getNumberOfVariables

        public int getNumberOfVariables()
      • getNumberOfInstances

        public long getNumberOfInstances()
      • getValues

        public org.nd4j.linalg.api.ndarray.INDArray getValues​(int index)
      • getTimestamps

        public org.nd4j.linalg.api.ndarray.INDArray getTimestamps​(int index)
      • getValuesOrNull

        public org.nd4j.linalg.api.ndarray.INDArray getValuesOrNull​(int index)
      • getTimestampsOrNull

        public org.nd4j.linalg.api.ndarray.INDArray getTimestampsOrNull​(int index)
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface java.util.Collection<L>
        Specified by:
        isEmpty in interface java.util.List<L>
      • isUnivariate

        public boolean isUnivariate()
      • isMultivariate

        public boolean isMultivariate()
      • get

        public TimeSeriesInstance<L> get​(int index)
        Specified by:
        get in interface java.util.List<L>
      • iterator

        public java.util.Iterator<TimeSeriesInstance<L>> iterator()
        Specified by:
        iterator in interface java.util.Collection<L>
        Specified by:
        iterator in interface java.lang.Iterable<L>
        Specified by:
        iterator in interface java.util.List<L>
      • add

        public boolean add​(TimeSeriesInstance<L> e)
        Specified by:
        add in interface java.util.Collection<L>
        Specified by:
        add in interface java.util.List<L>
      • addAll

        public boolean addAll​(java.util.Collection<? extends TimeSeriesInstance<L>> c)
        Specified by:
        addAll in interface java.util.Collection<L>
        Specified by:
        addAll in interface java.util.List<L>
      • clear

        public void clear()
        Specified by:
        clear in interface java.util.Collection<L>
        Specified by:
        clear in interface java.util.List<L>
      • contains

        public boolean contains​(java.lang.Object o)
        Specified by:
        contains in interface java.util.Collection<L>
        Specified by:
        contains in interface java.util.List<L>
      • containsAll

        public boolean containsAll​(java.util.Collection<?> c)
        Specified by:
        containsAll in interface java.util.Collection<L>
        Specified by:
        containsAll in interface java.util.List<L>
      • remove

        public boolean remove​(java.lang.Object o)
        Specified by:
        remove in interface java.util.Collection<L>
        Specified by:
        remove in interface java.util.List<L>
      • removeAll

        public boolean removeAll​(java.util.Collection<?> c)
        Specified by:
        removeAll in interface java.util.Collection<L>
        Specified by:
        removeAll in interface java.util.List<L>
      • retainAll

        public boolean retainAll​(java.util.Collection<?> c)
        Specified by:
        retainAll in interface java.util.Collection<L>
        Specified by:
        retainAll in interface java.util.List<L>
      • size

        public int size()
        Specified by:
        size in interface java.util.Collection<L>
        Specified by:
        size in interface java.util.List<L>
      • toArray

        public java.lang.Object[] toArray()
        Specified by:
        toArray in interface java.util.Collection<L>
        Specified by:
        toArray in interface java.util.List<L>
      • toArray

        public <T> T[] toArray​(T[] a)
        Specified by:
        toArray in interface java.util.Collection<L>
        Specified by:
        toArray in interface java.util.List<L>
      • add

        public void add​(int arg0,
                        TimeSeriesInstance<L> arg1)
        Specified by:
        add in interface java.util.List<L>
      • addAll

        public boolean addAll​(int arg0,
                              java.util.Collection<? extends TimeSeriesInstance<L>> arg1)
        Specified by:
        addAll in interface java.util.List<L>
      • indexOf

        public int indexOf​(java.lang.Object arg0)
        Specified by:
        indexOf in interface java.util.List<L>
      • lastIndexOf

        public int lastIndexOf​(java.lang.Object arg0)
        Specified by:
        lastIndexOf in interface java.util.List<L>
      • listIterator

        public java.util.ListIterator<TimeSeriesInstance<L>> listIterator()
        Specified by:
        listIterator in interface java.util.List<L>
      • listIterator

        public java.util.ListIterator<TimeSeriesInstance<L>> listIterator​(int arg0)
        Specified by:
        listIterator in interface java.util.List<L>
      • subList

        public java.util.List<TimeSeriesInstance<L>> subList​(int arg0,
                                                             int arg1)
        Specified by:
        subList in interface java.util.List<L>