optpolicy_main.OptimalPolicy.estrisk_adjust#

OptimalPolicy.estrisk_adjust(data_df, data_title='')#

Adjust policy scores for estimation risk and select them for subsequent policy learning.

The instance uses the returned ‘estrisk_scores_names’ as its active policy-score names. Pass the returned ‘data_estrisk_df’ to solve() or solvefair() to use these adjusted scores. For ‘gen_method’ == ‘best_policy_score’, allocate() also creates adjusted scores when they are absent, using the original scores and their standard errors. Repeated calls use the original score names saved by the first successful call and replace existing ‘_estrisk’ columns. They do not subtract the risk adjustment a second time. A failed call leaves the instance’s risk-adjustment state unchanged.

Parameters:
  • data_df (DataFrame) – Data containing the original policy scores and their standard errors in matching order. Values must be numeric and finite, with nonnegative standard errors. Names formed by adding ‘_estrisk’ to score names must not coincide with any original configured input variable name; conflicting names raise ValueError. Rename the input column and its keyword entry. Repeated calls may replace previously generated scores. Column names are converted to lowercase in the returned data.

  • data_title (String, optional) – This string is used as title in outputs. The default is ‘’.

Returns:

results_dic – Contains the results. This dictionary has the following structure: ‘data_estrisk_df’ : DataFrame

Input data with additional policy scores adjusted for estimation risk: policy_score - estrisk_value * standard_error. The added column names have the suffix ‘_estrisk’. The row index is reset to consecutive integers starting at zero.

’estrisk_scores_names’List of strings.

Names of adjusted scores.

’outpath’Path or None

Directory in which output is saved. None if _int_with_output is False.

Return type:

Dictionary.