Products
Trends
Trends are part of Sahha Insights . They are designed to detect and communicate directional change in a score, factor, or biomarker over time. Rather than just looking at today's value, a trend reveals how that value has evolved over the last few weeks — is it going up? Down? Staying the same? And by how much?
List of Trends
Category | Name | Description | Unit | Value Range | isHigherBetter |
---|---|---|---|---|---|
score | sleep | Overall sleep quality | index | [0, 1] | true |
score | activity | Physical activity and movement levels | index | [0, 1] | true |
score | readiness | Body's recovery state and preparedness for exertion | index | [0, 1] | true |
score | wellbeing | Holistic health combining sleep and activity | index | [0, 1] | true |
score | mental_wellbeing | Mental wellbeing state based on behavioral patterns | index | [0, 1] | true |
factor | sleep_duration | Total time spent asleep | index | [0, 1] | true |
factor | sleep_regularity | Consistency of sleep schedule | index | [0, 1] | true |
factor | sleep_continuity | Uninterrupted sleep with minimal awakenings | index | [0, 1] | true |
factor | sleep_debt | Accumulated sleep deficit | index | [0, 1] | true |
factor | circadian_alignment | Alignment with natural sleep-wake cycle | index | [0, 1] | true |
factor | physical_recovery | Deep sleep phase duration | index | [0, 1] | true |
factor | mental_recovery | REM sleep phase duration | index | [0, 1] | true |
factor | steps | Daily step count | index | [0, 1] | true |
factor | active_hours | Hours with significant physical activity | index | [0, 1] | true |
factor | active_calories | Calories burned during activity | index | [0, 1] | true |
factor | intense_activity_duration | Time spent in high-intensity activity | index | [0, 1] | true |
factor | extended_inactivity | Prolonged sedentary periods | index | [0, 1] | true |
factor | floors_climbed | Vertical movement measurement | index | [0, 1] | true |
factor | activity_regularity | Consistency of daily activity patterns | index | [0, 1] | true |
factor | walking_strain_capacity | Capacity to do low-intensity activities | index | [0, 1] | null |
factor | exercise_strain_capacity | Capacity to do high-intensity exercises | index | [0, 1] | null |
factor | resting_heart_rate | Heart rate during rest | index | [0, 1] | true |
factor | heart_rate_variability | Variation in time between heartbeats | index | [0, 1] | true |
How It Works
Trends analyze the last 4 complete weeks of data on a rolling basis. For each eligible metric (like sleep score, activity score, sleep duration, etc.), Sahha computes a weekly average, compares it to previous weeks, and classifies the directional movement as one of:
- increasing : meaningful upward movement
- decreasing : meaningful downward movement
- stable : no significant change
The overall trend state is determined by the percent change in the latest week's data compared to the previous week.
Trends are generated every week, and include:
- A rolling 4-week time window
- Percent change calculations between each week
- A state label (increasing/decreasing/stable)
- Range and unit metadata
Output Schema
Each trend is scoped to a single profile and metric. It includes the past 4 full weeks of data and is calculated at the end of each week on a rolling basis.
Key | Description |
---|---|
id | Unique identifier for the trend |
type | Always set to trend |
category | One of score , factor , or biomarker |
name | The metric being trended (e.g., sleep ) |
state | Directional movement: increasing , decreasing , or stable |
isHigherBetter | Whether higher values are generally better ( true , false , or null ) |
valueRange | Range of expected values, e.g. [0.0, 1.0] |
unit | Unit of the metric (e.g., index , bpm , steps ) |
periodicity | Frequency at which trends are calculated and updated. Currently, only weekly is available. |
trendStartDateTime | Start of the rolling window |
trendEndDateTime | End of the rolling window |
data | List of entries with value and change info. Currently 4 weekly entries present. |
createdAtUtc | UTC timestamp when the trend was calculated |
version | Version of trends |
Each entry in data
includes:
Key | Description |
---|---|
id | Unique identifier for the data entry |
startDateTime | Start of the week for this data entry |
endDateTime | End of the week for this data entry |
value | Average value for the metric between the entry's start and end datetime |
percentChangeFromPrevious | Percent change from the previous entry's value |
Example:
{ "id": "123e4567-e89b-12d3-a456-426614174000", "type": "trend", "category": "score", "name": "sleep", "state": "increasing", "isHigherBetter": true, "valueRange": [0.0, 1.0], "unit": "index", "periodicity": "weekly", "trendStartDateTime": "2023-05-01T00:00:00+05:00", "trendEndDateTime": "2023-05-29T00:00:00+05:00", "data": [ { "id": "f47ac10b-58cc-4372-a567-0e02b2c3d479", "startDateTime": "2023-05-01T00:00:00+05:00", "endDateTime": "2023-05-08T00:00:00+05:00", "value": 0.65, "percentChangeFromPrevious": null }, { "id": "c9bf9e57-1685-4c89-bafb-ff5af830be8a", "startDateTime": "2023-05-08T00:00:00+05:00", "endDateTime": "2023-05-15T00:00:00+05:00", "value": 0.75, "percentChangeFromPrevious": 0.15 }, { "id": "e7d3c68b-1c9b-4f3b-9f3b-2f3b2f3b2f3b", "startDateTime": "2023-05-15T00:00:00+05:00", "endDateTime": "2023-05-22T00:00:00+05:00", "value": 0.71, "percentChangeFromPrevious": -0.05 }, { "id": "a3bb189e-8bf9-4f3b-9f3b-1740003b2f3b", "startDateTime": "2023-05-22T00:00:00+05:00", "endDateTime": "2023-05-29T00:00:00+05:00", "value": 0.78, "percentChangeFromPrevious": 0.1 } ], "createdAtUtc": "2023-05-30T09:30:00Z", "version": 1}
Getting Started
To start using Trends, you can:
- Use the
GET /api/v1/profile/insight/trend
API to fetch trends for a specific profile and metric.
FAQ
Q: How is the trend state (increasing/decreasing/stable) determined?
A: Sahha uses relative percent change and a metric-specific significance threshold to determine if the movement is meaningful.
Q: What if higher value isn't always better?
A: That's why we include the isHigherBetter
field. It allows consumers to interpret whether a trend is good or bad in the context of the metric.
Q: What if there is missing/no data?
A: That week is skipped in the 4-week window. At least two valid weeks are needed to calculate a trend.
Q: Can I define my own trends or window size?
A: Not yet. For now, all trends use a 4-week rolling window.
Support
For assistance with Trends or the Insights product in general, reach out at support@sahha.ai or join the Sahha Slack Community .