Results
Simulation output for a single model run.
Usage
Results(model)Methods
| Name | Description |
|---|---|
| __init__() | Create instance of Results. |
| mean_by_category() | Find mean of metric by response category, and then also by outcome. |
| patient_df() | Return per-patient results as a DataFrame. |
| summary_df() | Return run-level summary in long format. |
| utilisation() | Return mean time-weighted ambulance utilisation. |
| utilisation_df() | Return time-weighted ambulance utilisation intervals. |
__init__()
Create instance of Results.
Usage
__init__(model)Parameters
model: Model- A model instance that has already been executed (model.run())
mean_by_category()
Find mean of metric by response category, and then also by outcome.
Usage
mean_by_category(df, col, name)Parameters
df: pd.DataFrame-
Patient-level dataframe.
col: str-
Column to aggregate.
name: str- Name to assign in the metric column.
Returns
pd.DataFrame- Long-format dataframe with aggregated results.
patient_df()
Return per-patient results as a DataFrame.
Usage
patient_df()Each row represents one patient. Patients who had not completed their full pathway by the end of the run will have NaN for unset time attributes.
Returns
pd.DataFrame- Dataframe with patient-level results.
summary_df()
Return run-level summary in long format.
Usage
summary_df()Returns
pd.DataFrame- Run-level summary.
utilisation()
Return mean time-weighted ambulance utilisation.
Usage
utilisation()Returns
float- Mean time-weighted ambulance utilisation.
utilisation_df()
Return time-weighted ambulance utilisation intervals.
Usage
utilisation_df()Returns
pd.DataFrame- Columns: time, busy, interval_duration, utilisation.