Forecast
cli_analysis(args)
¶
detect_fever_hypothermia(df, baseline, data_column='y', pred_column='y_hat', residual_column='residual', date_column='ds', date_fmt='%Y-%m-%d %H:%M:%S')
¶
Main function to detect fever and hypothermia thresholds.
This function orchestrates the process of calculating baseline residual bounds, hourly statistics, and fever/hypothermia thresholds.
PARAMETER | DESCRIPTION |
---|---|
df |
The input DataFrame.
TYPE:
|
baseline |
The number of hours to use as baseline.
TYPE:
|
pred_column |
The name of the column with predicted values.
TYPE:
|
residual_column |
The name of the residuals column.
TYPE:
|
date_column |
The name of the date column.
TYPE:
|
date_fmt |
The date format string.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
DataFrame
|
A DataFrame with hourly statistics and fever/hypothermia thresholds. |
tuple[float, float]
|
Lower and upper residual bounds, respectively. |
run_analysis(df, baseline, data_column='y', pred_column='y_hat', residual_column='residual', date_column='ds', date_fmt='%Y-%m-%d %H:%M:%S')
¶
Compute statistics from the DataFrame and hourly stats, and return them as a dictionary.
PARAMETER | DESCRIPTION |
---|---|
df |
The original DataFrame with all data.
TYPE:
|
baseline |
The number of hours to use as baseline.
TYPE:
|
data_column |
Column name with observed data.
TYPE:
|
pred_column |
The name of the column with predicted values.
TYPE:
|
residual_column |
The name of the residuals column.
TYPE:
|
date_column |
The name of the date column.
TYPE:
|
date_fmt |
The date format string.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
dict[str, Any]
|
A dictionary containing the computed statistics. |