-
Notifications
You must be signed in to change notification settings - Fork 25
evaluation: Edge evaluation pca-chosen #432
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
base: main
Are you sure you want to change the base?
Conversation
Documentation build overview
Show files changed (5 files in total): 📝 5 modified | ➕ 0 added | ➖ 0 deleted
|
Co-authored-by: Tristan F.-R. <[email protected]>
…s into edge-evaluation-pca-chosen
tristan-f-r
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agitter
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left initial comments and have not run it locally yet. The pre-commit check test is failing.
| edge_output_png = Path(OUT_DIR + 'pr-per-pathway-pca-chosen-not-provided_edges.png') | ||
| edge_output_png.unlink(missing_ok=True) | ||
|
|
||
| file_paths = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It took me a minute to remember what is "not provided" in these node and edge test cases. Adding a single line docstring or a comment to these empty file paths would help with that.
| node_output_file = Path(OUT_DIR + 'pr-per-pathway-pca-chosen_nodes.txt') | ||
| node_output_file.unlink(missing_ok=True) | ||
| node_output_png = Path(OUT_DIR + 'pr-per-pathway-pca-chosen_nodes.png') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| node_output_file = Path(OUT_DIR + 'pr-per-pathway-pca-chosen_nodes.txt') | |
| node_output_file.unlink(missing_ok=True) | |
| node_output_png = Path(OUT_DIR + 'pr-per-pathway-pca-chosen_nodes.png') | |
| node_output_file = Path(OUT_DIR + 'pr-per-pathway-pca-chosen-nodes.txt') | |
| node_output_file.unlink(missing_ok=True) | |
| node_output_png = Path(OUT_DIR + 'pr-per-pathway-pca-chosen-nodes.png') |
| edge_output_file = Path(OUT_DIR + 'pr-per-pathway-pca-chosen_edges.txt') | ||
| edge_output_file.unlink(missing_ok=True) | ||
| edge_output_png = Path(OUT_DIR + 'pr-per-pathway-pca-chosen_edges.png') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| edge_output_file = Path(OUT_DIR + 'pr-per-pathway-pca-chosen_edges.txt') | |
| edge_output_file.unlink(missing_ok=True) | |
| edge_output_png = Path(OUT_DIR + 'pr-per-pathway-pca-chosen_edges.png') | |
| edge_output_file = Path(OUT_DIR + 'pr-per-pathway-pca-chosen-edges.txt') | |
| edge_output_file.unlink(missing_ok=True) | |
| edge_output_png = Path(OUT_DIR + 'pr-per-pathway-pca-chosen-edges.png') |
| all_edges_mixed = y_true_mixed.union(y_pred) | ||
| y_true_mixed_binary = [1 if edge in y_true_mixed else 0 for edge in all_edges_mixed] | ||
| y_pred_mixed_binary = [1 if edge in y_pred else 0 for edge in all_edges_mixed] | ||
| # default to 0.0 if there is a divide by 0 error | ||
| # not using precision_recall_curve because thresholds are binary (0 or 1); rather we are directly | ||
| # calculating precision and recall per pathway | ||
| precision_mixed = precision_score(y_true_mixed_binary, y_pred_mixed_binary, zero_division=0.0) | ||
| recall_mixed = recall_score(y_true_mixed_binary, y_pred_mixed_binary, zero_division=0.0) | ||
| results.append({'Pathway': f, 'Precision': precision_mixed, 'Recall': recall_mixed, 'Gold_Standard_Type': "mixed"}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code block is repeated three times, right? Is there a way to reuse the same code three times and keep it this readable, or does it become harder to follow the logic? I do value the readability.
|
|
||
| else: | ||
| title = "PCA-Chosen Pathway Across All Algorithms Precision and Recall Plot" | ||
| if aggregate_per_algorithm : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if aggregate_per_algorithm : | |
| if aggregate_per_algorithm: |
Adding the code for the edge specific visualization function for the PCA chosen pathways. Closes #374