Skip to content

Policy Generator (Python) has problems #993

@ahouseholder

Description

@ahouseholder

Note

In the original version of this issue, I mistakenly referred to policy_explorer when I meant policy_generator. The corrected version appears below.

Describe the bug

policy_generator.py is reporting an error

Traceback (most recent call last):
  File "/Users/adh/Documents/git/SSVC_pub/src/ssvc/policy_generator.py", line 388, in <module>
    main()
    ~~~~^^
  File "/Users/adh/Documents/git/SSVC_pub/src/ssvc/policy_generator.py", line 382, in main
    imp = csv_analyzer.drop_col_feature_importance(df, "outcome")
  File "/Users/adh/Documents/git/SSVC_pub/src/ssvc/csv_analyzer.py", line 306, in drop_col_feature_importance
    X2, y = _prepare_data(df, target)
            ~~~~~~~~~~~~~^^^^^^^^^^^^
  File "/Users/adh/Documents/git/SSVC_pub/src/ssvc/csv_analyzer.py", line 277, in _prepare_data
    raise KeyError(f"Column '{target}' not found in {list(df.columns)}")
KeyError: "Column 'outcome' not found in ['ssvc_e_1_0_0', 'ssvc_exp_1_0_1', 'ssvc_a_2_0_0', 'ssvc_hi_2_0_0', 'ssvc_dsoi_1_0_0']"

To Reproduce
Steps to reproduce the behavior:

  1. Run policy_generator.py
  2. Witness error

Expected behavior

Should run without errors.

Additional context

It's unclear whether we really still need policy_generator.py now that we have the DecisionTable class. So the first decision to make here is whether to just get rid of it entirely, or maybe refactor it to use the more recent DecisionTable class.

A second decision is what to rename this since we're trying to avoid confusion on the use of the term "policy" (so probably rename to Decision Table Generator or somesuch).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions