onlinerake.Targets

class onlinerake.Targets(age: float = 0.5, gender: float = 0.5, education: float = 0.4, region: float = 0.3)[source]

Bases: object

Target population proportions for binary demographics.

Each attribute represents the desired proportion of cases with indicator value 1. If your survey uses different definitions or more categories per characteristic, either extend this class with additional fields or refactor your raking logic accordingly.

__init__(age: float = 0.5, gender: float = 0.5, education: float = 0.4, region: float = 0.3) None

Methods

__init__([age, gender, education, region])

as_dict()

Return the targets as a plain dictionary.

Attributes

age

education

gender

region

age: float = 0.5
as_dict() dict[source]

Return the targets as a plain dictionary.

Useful for iterating over targets programmatically.

education: float = 0.4
gender: float = 0.5
region: float = 0.3