Skip to content

Remove Duplicate Code in Fairness #17

@danielz02

Description

@danielz02

Is your feature request related to a problem? Please describe.
fairness_evaluation.py and score_calculation_script.py have over 100 lines of mostly identical code. However, score_calculation_script.py calculates numbers differently from fairness_evaluation.py. An ordinary user might find this confusing. The two branches from if args.dry_run: are also repetitive.

Describe the solution you'd like

  • Refactor the score calculation part in fairness_evaluation.py into score_calculation_script.py.
  • get_path function is also weird. Can os.path.dirname do its job?
  • Merge the two branches from if args.dry_run: are also repetitive. Since fairness needs a special do_classification. I added a monkey patch (Line 173). Whether to activate the monkey patch or not can be determined based on whether we are running dry runs. This should be much cleaner once we fully adopt the return object, so we don't need to return a bunch of tuples...

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions