-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
[MRG] Fixing wrapping in named_test.test_common #8558
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -369,11 +369,11 @@ | |
|
||
# No Sample weight support | ||
METRICS_WITHOUT_SAMPLE_WEIGHT = [ | ||
"confusion_matrix", # Left this one here because the tests in this file do | ||
# not work for confusion_matrix, as its output is a | ||
# matrix instead of a number. Testing of | ||
# confusion_matrix with sample_weight is in | ||
# test_classification.py | ||
"confusion_matrix", # Left this one here because the tests in this file do | ||
# not work for confusion_matrix, as its output is a | ||
# matrix instead of a number. Testing of | ||
# confusion_matrix with sample_weight is in | ||
# test_classification.py | ||
"median_absolute_error", | ||
] | ||
|
||
|
@@ -619,9 +619,9 @@ def test_invariance_string_vs_numbers_labels(): | |
|
||
|
||
def test_inf_nan_input(): | ||
invalids =[([0, 1], [np.inf, np.inf]), | ||
([0, 1], [np.nan, np.nan]), | ||
([0, 1], [np.nan, np.inf])] | ||
invalids = [([0, 1], [np.inf, np.inf]), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same comment as above |
||
([0, 1], [np.nan, np.nan]), | ||
([0, 1], [np.nan, np.inf])] | ||
|
||
METRICS = dict() | ||
METRICS.update(THRESHOLDED_METRICS) | ||
|
@@ -1011,7 +1011,8 @@ def check_sample_weight_invariance(name, metric, y1, y2): | |
sample_weight=np.hstack([sample_weight, sample_weight])) | ||
|
||
|
||
def test_sample_weight_invariance(n_samples=50): | ||
def generate_sample_weight_invariance(n_samples=50): | ||
# create generative function to iterate through each relevant metric | ||
random_state = check_random_state(0) | ||
# regression | ||
y_true = random_state.random_sample(size=(n_samples,)) | ||
|
@@ -1088,6 +1089,12 @@ def test_sample_weight_invariance(n_samples=50): | |
metric, y_true, y_pred) | ||
|
||
|
||
def test_sample_weight_invariance(n_samples=50): | ||
# iterate through each metric testing each case | ||
for metrics in generate_sample_weight_invariance(n_samples): | ||
pass | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't understand the original issue as I commented there and I don't think you need this since nose supports yield in test functions ... |
||
|
||
|
||
@ignore_warnings | ||
def test_no_averaging_labels(): | ||
# test labels argument when not using averaging | ||
|
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 is fine for now but from next time kindly avoid unrelated changes :)