Package ai.djl.timeseries.timefeature
Class TimeFeature
java.lang.Object
ai.djl.timeseries.timefeature.TimeFeature
this is a class to generate time feature by frequency.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ai.djl.ndarray.NDArray
dayOfMonth
(ai.djl.ndarray.NDManager manager, List<LocalDateTime> index) Computes feature by days fo the month.static ai.djl.ndarray.NDArray
dayOfWeek
(ai.djl.ndarray.NDManager manager, List<LocalDateTime> index) Computes feature by days of the week.static ai.djl.ndarray.NDArray
dayOfYear
(ai.djl.ndarray.NDManager manager, List<LocalDateTime> index) Computes feature by days of the year.static ai.djl.ndarray.NDArray
hourOfDay
(ai.djl.ndarray.NDManager manager, List<LocalDateTime> index) Computes feature by hours.static ai.djl.ndarray.NDArray
minuteOfHour
(ai.djl.ndarray.NDManager manager, List<LocalDateTime> index) Computes feature by minutes.static ai.djl.ndarray.NDArray
monthOfYear
(ai.djl.ndarray.NDManager manager, List<LocalDateTime> index) Computes feature by months of the year.static ai.djl.ndarray.NDArray
secondOfMinute
(ai.djl.ndarray.NDManager manager, List<LocalDateTime> index) Computes feature by seconds.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.static ai.djl.ndarray.NDArray
weekOfYear
(ai.djl.ndarray.NDManager manager, List<LocalDateTime> index) Computes feature by weeks of the year.
-
Method Details
-
secondOfMinute
public static ai.djl.ndarray.NDArray secondOfMinute(ai.djl.ndarray.NDManager manager, List<LocalDateTime> index) Computes feature by seconds.- Parameters:
manager
- defaultNDManager
.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
- defaultNDManager
.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
- defaultNDManager
.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
- defaultNDManager
.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
- defaultNDManager
.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
- defaultNDManager
.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
- defaultNDManager
.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
- defaultNDManager
.index
- time data- Returns:
- the result feature
-
timeFeaturesFromFreqStr
public static List<BiFunction<ai.djl.ndarray.NDManager,List<LocalDateTime>, timeFeaturesFromFreqStrai.djl.ndarray.NDArray>> (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
-