Skip to contents

Task for predicting in-hospital mortality using MIMIC-IV dataset. Uses lab results from the first 48 hours after admission as input features.

Super class

RHealth::BaseTask -> InHospitalMortalityMIMIC4

Public fields

input_window_hours

Numeric, number of hours to look back for lab data.

LAB_CATEGORIES

Named list mapping lab category to subcategory itemids.

LABITEMS

Character vector of all lab itemids (flattened).

Methods


Method new()

Initialize a new InHospitalMortalityMIMIC4 instance.

Usage

InHospitalMortalityMIMIC4$new(input_window_hours = 48)

Arguments

input_window_hours

Numeric, number of hours to look back (default: 48).


Method pre_filter()

Pre-filter hook to retain only necessary columns for this task.

Usage

InHospitalMortalityMIMIC4$pre_filter(df)

Arguments

df

A polars LazyFrame containing all events.

Returns

A filtered LazyFrame with only relevant columns.


Method call()

Main processing method to generate samples.

Usage

InHospitalMortalityMIMIC4$call(patient)

Arguments

patient

An object with method get_events(event_type, ...).

Returns

A list of samples. Each sample is a named list containing:

  • patient_id: character

  • admission_id: character or integer

  • labs: a list of timestamps, lab_values_matrix

  • mortality: binary indicator (0/1)


Method clone()

The objects of this class are cloneable with this method.

Usage

InHospitalMortalityMIMIC4$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.