optpolicy_main.OptimalPolicy.allocate#
- OptimalPolicy.allocate(data_df, data_title: str = '', fair_adjust_decision_vars: bool = False)#
Allocate observations to treatment state.
- Parameters
data_df (DataFrame) – Input data with at least features or policy scores (depending on algorithm).
data_title (String, optional) – This string is used as title in outputs. The default is ‘’.
fair_adjust_decision_vars (Boolean, optional) – If True, it will fairness-adjust the decision variables even when fairness adjustments have not been used in training. If False, no fairness adjustments of decision variables. However, if fairness adjustments of decision variables have already been used in training, then these variables will also be fairness adjusted in the allocate method, independent of the value of
fair_adjust_decision_vars
. The default is False.
- Returns
results – Contains the results. This dictionary has the following structure: ‘allocation_df’ : DataFrame
data_df with optimal allocation appended.
- ’outpath’Path
Location of directory in which output is saved.
- Return type
Dictionary.