Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sklearn/calibration.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ class that has the highest probability, and can thus be different

def _more_tags(self):
return {
'_xfail_test': {
'_xfail_checks': {
'check_sample_weights_invariance(kind=zeros)':
'zero sample_weight is not equivalent to removing samples',
}
Expand Down
4 changes: 2 additions & 2 deletions sklearn/cluster/_kmeans.py
Original file line number Diff line number Diff line change
Expand Up @@ -1211,7 +1211,7 @@ def score(self, X, y=None, sample_weight=None):

def _more_tags(self):
return {
'_xfail_test': {
'_xfail_checks': {
'check_sample_weights_invariance(kind=zeros)':
'zero sample_weight is not equivalent to removing samples',
}
Expand Down Expand Up @@ -1876,7 +1876,7 @@ def predict(self, X, sample_weight=None):

def _more_tags(self):
return {
'_xfail_test': {
'_xfail_checks': {
'check_sample_weights_invariance(kind=zeros)':
'zero sample_weight is not equivalent to removing samples',
}
Expand Down
2 changes: 1 addition & 1 deletion sklearn/ensemble/_iforest.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ def _compute_score_samples(self, X, subsample_features):

def _more_tags(self):
return {
'_xfail_test': {
'_xfail_checks': {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name of the tag was changed on master

'check_sample_weights_invariance(kind=zeros)':
'zero sample_weight is not equivalent to removing samples',
}
Expand Down
2 changes: 1 addition & 1 deletion sklearn/linear_model/_logistic.py
Original file line number Diff line number Diff line change
Expand Up @@ -2086,7 +2086,7 @@ def score(self, X, y, sample_weight=None):

def _more_tags(self):
return {
'_xfail_test': {
'_xfail_checks': {
'check_sample_weights_invariance(kind=zeros)':
'zero sample_weight is not equivalent to removing samples',
}
Expand Down
2 changes: 1 addition & 1 deletion sklearn/linear_model/_ransac.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ def score(self, X, y):

def _more_tags(self):
return {
'_xfail_test': {
'_xfail_checks': {
'check_sample_weights_invariance(kind=zeros)':
'zero sample_weight is not equivalent to removing samples',
}
Expand Down
2 changes: 1 addition & 1 deletion sklearn/linear_model/_ridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -1912,7 +1912,7 @@ def classes_(self):

def _more_tags(self):
return {
'_xfail_test': {
'_xfail_checks': {
'check_sample_weights_invariance(kind=zeros)':
'zero sample_weight is not equivalent to removing samples',
}
Expand Down
4 changes: 2 additions & 2 deletions sklearn/linear_model/_stochastic_gradient.py
Original file line number Diff line number Diff line change
Expand Up @@ -1096,7 +1096,7 @@ def _predict_log_proba(self, X):

def _more_tags(self):
return {
'_xfail_test': {
'_xfail_checks': {
'check_sample_weights_invariance(kind=zeros)':
'zero sample_weight is not equivalent to removing samples',
}
Expand Down Expand Up @@ -1586,7 +1586,7 @@ def __init__(self, loss="squared_loss", *, penalty="l2", alpha=0.0001,

def _more_tags(self):
return {
'_xfail_test': {
'_xfail_checks': {
'check_sample_weights_invariance(kind=zeros)':
'zero sample_weight is not equivalent to removing samples',
}
Expand Down
2 changes: 1 addition & 1 deletion sklearn/neighbors/_kde.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ def sample(self, n_samples=1, random_state=None):

def _more_tags(self):
return {
'_xfail_test': {
'_xfail_checks': {
'check_sample_weights_invariance(kind=zeros)':
'sample_weight must have positive values',
}
Expand Down
12 changes: 6 additions & 6 deletions sklearn/svm/_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ def fit(self, X, y, sample_weight=None):

def _more_tags(self):
return {
'_xfail_test': {
'_xfail_checks': {
'check_sample_weights_invariance(kind=zeros)':
'zero sample_weight is not equivalent to removing samples',
}
Expand Down Expand Up @@ -434,7 +434,7 @@ def fit(self, X, y, sample_weight=None):

def _more_tags(self):
return {
'_xfail_test': {
'_xfail_checks': {
'check_sample_weights_invariance(kind=zeros)':
'zero sample_weight is not equivalent to removing samples',
}
Expand Down Expand Up @@ -668,7 +668,7 @@ def __init__(self, *, C=1.0, kernel='rbf', degree=3, gamma='scale',

def _more_tags(self):
return {
'_xfail_test': {
'_xfail_checks': {
'check_sample_weights_invariance(kind=zeros)':
'zero sample_weight is not equivalent to removing samples',
}
Expand Down Expand Up @@ -1055,7 +1055,7 @@ def probB_(self):

def _more_tags(self):
return {
'_xfail_test': {
'_xfail_checks': {
'check_sample_weights_invariance(kind=zeros)':
'zero sample_weight is not equivalent to removing samples',
}
Expand Down Expand Up @@ -1193,7 +1193,7 @@ def __init__(self, *, nu=0.5, C=1.0, kernel='rbf', degree=3,

def _more_tags(self):
return {
'_xfail_test': {
'_xfail_checks': {
'check_sample_weights_invariance(kind=zeros)':
'zero sample_weight is not equivalent to removing samples',
}
Expand Down Expand Up @@ -1416,7 +1416,7 @@ def probB_(self):

def _more_tags(self):
return {
'_xfail_test': {
'_xfail_checks': {
'check_sample_weights_invariance(kind=zeros)':
'zero sample_weight is not equivalent to removing samples',
}
Expand Down
12 changes: 2 additions & 10 deletions sklearn/utils/estimator_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,6 @@ def check_estimator(Estimator, generate_only=False):
warnings.warn(msg, FutureWarning)

checks_generator = _generate_class_checks(Estimator)
estimator = _construct_instance(Estimator)
else:
# got an instance
estimator = Estimator
Expand All @@ -499,19 +498,12 @@ def check_estimator(Estimator, generate_only=False):
if generate_only:
return checks_generator

xfail_checks = _safe_tags(estimator, '_xfail_test')

for estimator, check in checks_generator:
check_name = _set_check_estimator_ids(check)
if xfail_checks and check_name in xfail_checks:
# skip tests marked as a known failure and raise a warning
msg = xfail_checks[check_name]
warnings.warn(f'Skipping {check_name}: {msg}', SkipTestWarning)
continue
Copy link
Member Author

@rth rth May 10, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All changes to check_estimator revert the modifications in #16507 since they are no longer relevant.

try:
check(estimator)
except SkipTest as exception:
# raise warning for tests that are are skipped
# the only SkipTest thrown currently results from not
# being able to import pandas.
warnings.warn(str(exception), SkipTestWarning)


Expand Down