Class TimeFeature

java.lang.Object
ai.djl.timeseries.timefeature.TimeFeature

public final class TimeFeature extends Object
this is a class to generate time feature by frequency.
  • Method Details

    • secondOfMinute

      public static ai.djl.ndarray.NDArray secondOfMinute(ai.djl.ndarray.NDManager manager, List<LocalDateTime> index)
      Computes feature by seconds.
      Parameters:
      manager - default NDManager.
      index - time data
      Returns:
      the result feature
    • minuteOfHour

      public static ai.djl.ndarray.NDArray minuteOfHour(ai.djl.ndarray.NDManager manager, List<LocalDateTime> index)
      Computes feature by minutes.
      Parameters:
      manager - default NDManager.
      index - time data
      Returns:
      the result feature
    • hourOfDay

      public static ai.djl.ndarray.NDArray hourOfDay(ai.djl.ndarray.NDManager manager, List<LocalDateTime> index)
      Computes feature by hours.
      Parameters:
      manager - default NDManager.
      index - time data
      Returns:
      the result feature
    • dayOfWeek

      public static ai.djl.ndarray.NDArray dayOfWeek(ai.djl.ndarray.NDManager manager, List<LocalDateTime> index)
      Computes feature by days of the week.
      Parameters:
      manager - default NDManager.
      index - time data
      Returns:
      the result feature
    • dayOfMonth

      public static ai.djl.ndarray.NDArray dayOfMonth(ai.djl.ndarray.NDManager manager, List<LocalDateTime> index)
      Computes feature by days fo the month.
      Parameters:
      manager - default NDManager.
      index - time data
      Returns:
      the result feature
    • dayOfYear

      public static ai.djl.ndarray.NDArray dayOfYear(ai.djl.ndarray.NDManager manager, List<LocalDateTime> index)
      Computes feature by days of the year.
      Parameters:
      manager - default NDManager.
      index - time data
      Returns:
      the result feature
    • monthOfYear

      public static ai.djl.ndarray.NDArray monthOfYear(ai.djl.ndarray.NDManager manager, List<LocalDateTime> index)
      Computes feature by months of the year.
      Parameters:
      manager - default NDManager.
      index - time data
      Returns:
      the result feature
    • weekOfYear

      public static ai.djl.ndarray.NDArray weekOfYear(ai.djl.ndarray.NDManager manager, List<LocalDateTime> index)
      Computes feature by weeks of the year.
      Parameters:
      manager - default NDManager.
      index - time data
      Returns:
      the result feature
    • timeFeaturesFromFreqStr

      public static List<BiFunction<ai.djl.ndarray.NDManager,List<LocalDateTime>,ai.djl.ndarray.NDArray>> timeFeaturesFromFreqStr(String freqStr)
      Returns a list of time features that will be appropriate for the given frequency string.
      Parameters:
      freqStr - Frequency string of the form [multiple][granularity] such as "12H", "1D"
      Returns:
      time features