Timeframe
add_hourly_thresholds(hourly_stats, residual_lower, residual_upper)
¶
Calculate and add fever and hypothermia thresholds.
PARAMETER | DESCRIPTION |
---|---|
hourly_stats
|
The DataFrame with hourly median temperatures.
TYPE:
|
residual_lower
|
The lower residual bound.
TYPE:
|
residual_upper
|
The upper residual bound.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
DataFrame
|
A DataFrame with added columns for residual bounds and fever/hypothermia |
DataFrame
|
thresholds. |
calculate_stats_by_timeframe(df, timeframe, data_column='y', pred_column='y_hat', date_column='ds', start_from_first=True)
¶
Calculate statistics by specified timeframe, with an option to start from the first timestamp.
PARAMETER | DESCRIPTION |
---|---|
df
|
The input DataFrame.
TYPE:
|
timeframe
|
Group statistics by timeframe - options are "hour" and "day".
TYPE:
|
data_column
|
Name of column containing observed data.
TYPE:
|
pred_column
|
Name of column containing predicted data.
TYPE:
|
date_column
|
The name of the column with timestamps.
TYPE:
|
start_from_first
|
If
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
DataFrame
|
A DataFrame with aggregated statistics by specified timeframe. |