-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add per-node scoring functions #127
Conversation
ff22812
to
1f7a270
Compare
dafc6a1
to
dbe7558
Compare
thicket/stats/scoring.py
Outdated
import thicket as th | ||
|
||
|
||
def _scoring_1(means_1, means_2, stds_1, stds_2, num_nodes): |
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.
Can we rename scoring_{1,2..}
to your more descriptive names? Maybe score_delta_mean_delta_stdnorm()
calls score(..., _calc_delta_mean_delta_stdnorm)
.
thicket/stats/scoring.py
Outdated
(means_1[i] - means_2[i]) ** 2 / (stds_1[i] ** 2 + stds_2[i] ** 2) | ||
) | ||
except ZeroDivisionError: | ||
# print("Score 3 std's: ", stds_1[i], stds_2[i], i) |
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.
You can remove these debug statements if they aren't needed anymore.
thicket/stats/scoring.py
Outdated
(stds_1[i] - stds_2[i]) / (np.abs(means_1[i] - means_2[i])) | ||
) | ||
except RuntimeWarning: | ||
print("Score 1 means's: ", means_1[i], means_2[i], i) |
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.
Not sure if this print statement should be removed/commented out like the others below.
thicket/tests/test_stats.py
Outdated
|
||
idx = list(combined_th.dataframe.columns.levels[0][0:2]) | ||
columns = [(idx[0], "Min time/rank"), (idx[1], "Min time/rank")] | ||
output_column_name = "score_1" |
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.
Use longer descriptive name?
thicket/stats/scoring.py
Outdated
import numpy as np | ||
from ..utils import verify_thicket_structures | ||
import math | ||
import thicket as th |
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 like following PEP8 for grouping imports:
Imports should be grouped in the following order:
Standard library imports.
Related third party imports.
Local application/library specific imports.
So let's update this list to be:
import math
import numpy as np
import thicket as th
from ..utils import verify_thicket_structures
thicket/stats/scoring.py
Outdated
|
||
|
||
def _scoring_2(means_1, means_2, stds_1, stds_2, num_nodes): | ||
|
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.
You can remove the newline between the function definition and start of the function body as you've done below in your score()
function.
This PR is for the implementation of the per-node scoring functions. Right now there are four scoring functions. They take in a columnar joined thicket object, and a list of columns to apply a per-node scoring function to.
Note: This is an updated PR since this branch was migrated from LLNL's main repo to TauferLab's fork of this repo. Replaces #114