Skip to content

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: DataFrame

baseline

The number of hours to use as baseline.

TYPE: float | int

pred_column

The name of the column with predicted values.

TYPE: str DEFAULT: 'y_hat'

residual_column

The name of the residuals column.

TYPE: str DEFAULT: 'residual'

date_column

The name of the date column.

TYPE: str DEFAULT: 'ds'

date_fmt

The date format string.

TYPE: str DEFAULT: '%Y-%m-%d %H:%M:%S'

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: DataFrame

baseline

The number of hours to use as baseline.

TYPE: float | int

data_column

Column name with observed data.

TYPE: str DEFAULT: 'y'

pred_column

The name of the column with predicted values.

TYPE: str DEFAULT: 'y_hat'

residual_column

The name of the residuals column.

TYPE: str DEFAULT: 'residual'

date_column

The name of the date column.

TYPE: str DEFAULT: 'ds'

date_fmt

The date format string.

TYPE: str DEFAULT: '%Y-%m-%d %H:%M:%S'

RETURNS DESCRIPTION
dict[str, Any]

A dictionary containing the computed statistics.