Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT] Duplicated code in linker.X_from_labels_Y() #2010

Open
samnlindsay opened this issue Feb 29, 2024 · 0 comments
Open

[FEAT] Duplicated code in linker.X_from_labels_Y() #2010

samnlindsay opened this issue Feb 29, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@samnlindsay
Copy link
Contributor

samnlindsay commented Feb 29, 2024

Is your proposal related to a problem?

Several methods in linker.py duplicate a lot of code by having separate functions, X_from_labels_table and X_from_labels_column where X is:

  • prediction_errors
  • truth_space_table
  • roc_chart
  • precision_recall_chart
  • accuracy_chart
  • confusion_matrix (DELETED)
  • threshold_selection_tool

These functions contribute almost 1000 lines to linker.py

Describe the solution you'd like

Adding arguments to distinguish between labels in the source data or in a separate table would allow for simpler function names and almost halve the lines of code by removing duplication. The charts functions mostly hinge on whether they use truth_space_table_from_labels_table or truth_space_table_from_labels_column to perform the same task.

For example linker.roc_chart_from_labels_table("labels") becomes something like linker.roc_chart("labels", from="table")

Additional context

You could argue that many of these methods are no longer required once #2003 is merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant