Input Components

These are all of the inputs that are pulled for a model run. Some may not be pulled depending on the settings (for example, some models don’t have cause-specific mortality data).

Crosswalk Version

class cascade_at.inputs.data.CrosswalkVersion(crosswalk_version_id, exclude_outliers, demographics, conn_def, gbd_round_id)[source]

Bases: cascade_at.inputs.base_input.BaseInput

Pulls and formats all of the data from a crosswalk version in the epi database.

Parameters
  • crosswalk_version_id (int) – The crosswalk version to pull from

  • exclude_outliers (bool) – whether to exclude outliers

  • conn_def (str) – database connection definition

  • gbd_round_id (int) – The GBD round

  • demographics (Demographics) – The demographics object

get_raw()[source]

Pulls the raw crosswalk version from the database. These are the observations that will be used in the bundle.

configure_for_dismod(relabel_incidence, measures_to_exclude=None)[source]

Configures the crosswalk version for DisMod.

Parameters
  • measures_to_exclude (Optional[List[str]]) – list of parameters to exclude, by name

  • relabel_incidence (int) – how to label incidence – see RELABEL_INCIDENCE_MAP

Return type

DataFrame

static map_to_integrands(df, relabel_incidence)[source]

Maps the data from the IHME databases to the integrands expected by DisMod AT.

Parameters
  • df (DataFrame) – A data frame to map to integrands

  • relabel_incidence (int) – A relabel incidence code. Can be found in RELABEL_INCIDENCE_MAP

Cause-Specific Mortality Rate

class cascade_at.inputs.csmr.CSMR(cause_id, demographics, decomp_step, gbd_round_id)[source]

Bases: cascade_at.inputs.base_input.BaseInput

Get cause-specific mortality rate for demographic groups from a specific CodCorrect output version.

Parameters
  • cause_id (int) – The GBD cause of death to pull mortality from

  • demographics (Demographics) –

  • decomp_step (str) –

  • gbd_round_id (int) –

get_raw()[source]

Pulls the raw CSMR and assigns it to this class.

attach_to_model_version_in_db(model_version_id, conn_def)[source]

Uploads the CSMR for this model and attaches it to the model version so that it can be viewed in EpiViz.

configure_for_dismod(hold_out=0)[source]

Configures CSMR for DisMod.

Parameters

hold_out (int) – hold-out value for Dismod. 0 means it will be fit, 1 means held out

Return type

DataFrame

cascade_at.inputs.csmr.get_best_cod_correct(gbd_round_id)[source]

Gets the best codcorrect version for a given GBD round.

Parameters

gbd_round_id (int) –

Returns

Return type

The process_version_id to be used with a db_queries.get_outputs call.

All-Cause Mortality Rate

class cascade_at.inputs.asdr.ASDR(demographics, decomp_step, gbd_round_id)[source]

Bases: cascade_at.inputs.base_input.BaseInput

Gets age-specific all-cause death rate for all demographic groups.

Parameters
  • demographics (Demographics) –

  • decomp_step (str) –

  • gbd_round_id (int) –

get_raw()[source]

Pulls the raw ASDR and assigns them to this class.

configure_for_dismod(hold_out=0)[source]

Configures ASDR for DisMod.

Parameters

hold_out (int) – hold-out value for Dismod. 0 means it will be fit, 1 means held out

Return type

DataFrame

Population

class cascade_at.inputs.population.Population(demographics, decomp_step, gbd_round_id)[source]

Bases: cascade_at.inputs.base_input.BaseInput

Gets population for all demographic groups. This is not and input for DisMod-AT (and therefore does not subclass BaseInput. It is just used to do covariate interpolation over non-standard age groups and years.

Parameters
  • demographics (Demographics) – A demographics object

  • decomp_step (str) – The decomp step

  • gbd_round_id (int) – The gbd round

get_population()[source]

Gets the population counts from the database for the specified demographic group.

configure_for_dismod()[source]

Configures population inputs for use in dismod by converting to age lower and upper from GBD age groups.

Return type

DataFrame