TrendTimeSeries

class TrendTimeSeries(values: List<TrendHolder> = mutableListOf(), timestamps: List<ZonedDateTime> = mutableListOf(), confidenceIntervalLow: List<TrendHolder> = mutableListOf(), confidenceIntervalHigh: List<TrendHolder> = mutableListOf(), confidence: List<Double> = mutableListOf()) : TimeSeries<TrendHolder>

Constructors

Link copied to clipboard
constructor(values: List<TrendHolder> = mutableListOf(), timestamps: List<ZonedDateTime> = mutableListOf(), confidenceIntervalLow: List<TrendHolder> = mutableListOf(), confidenceIntervalHigh: List<TrendHolder> = mutableListOf(), confidence: List<Double> = mutableListOf())

Functions

Link copied to clipboard
open override fun dropLast(n: Int): TimeSeries.TrendTimeSeries

Returns a list containing all elements except last n elements.

Link copied to clipboard
open override fun dropna(): TimeSeries<TrendHolder>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun fillMissingDays(rewindDays: Int, inplace: Boolean): TimeSeries.TrendTimeSeries

This is an in-place operation. Use this function to fill missing days (the function adds NaNs) both in the future and in the past (up to the specified number of days in the past). Since the SDK does not return a value for the score in a day where the confidence it too low, this function can be useful to fill in blanks for UI/UX purposes.

Link copied to clipboard

This function helps filtering the TimeSeries for elements that follow a certain rule in the timestamps. Provide a lambda that receives a ZonedDateTime and return a boolean.

Link copied to clipboard

This function helps filtering the TimeSeries for elements that follow a certain rule in the values. Provide a lambda that receives a SleepSummary and returns a boolean.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun takeLast(n: Int): TimeSeries.TrendTimeSeries

Returns a time series containing the last n elements.