8000 FIX Hotfix Skip non deterministic tests on PowerPC (#13323) · scikit-learn/scikit-learn@5b68720 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5b68720

Browse files
rthjnothman
authored andcommitted
FIX Hotfix Skip non deterministic tests on PowerPC (#13323)
1 parent 3146648 commit 5b68720

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

sklearn/base.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@
66
import copy
77
import warnings
88
from collections import defaultdict
9+
import platform
910

1011
import numpy as np
1112
from scipy import sparse
1213
from .externals import six
1314
from .utils.fixes import signature
15+
from .utils import _IS_32BIT
1416
from . import __version__
1517

1618

@@ -515,7 +517,12 @@ class MetaEstimatorMixin(object):
515517
# this is just a tag for the moment
516518

517519

518-
###############################################################################
520+
class _UnstableArchMixin(object):
521+
"""Mark estimators that are non-determinstic on 32bit or PowerPC"""
522+
def _more_tags(self):
523+
return {'non_deterministic': (
524+
_IS_32BIT or platform.machine().startswith(('ppc', 'powerpc')))}
525+
519526

520527
def is_classifier(estimator):
521528
"""Returns True if the given estimator is (probably) a classifier.

sklearn/cross_decomposition/cca_.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
from .pls_ import _PLS
2+
from ..base import _UnstableArchMixin
23

34
__all__ = ['CCA']
45

56

6-
class CCA(_PLS):
7+
class CCA(_PLS, _UnstableArchMixin):
78
"""CCA Canonical Correlation Analysis.
89
910
CCA inherits from PLS with mode="B" and deflation_mode="canonical".

sklearn/manifold/locally_linear.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from scipy.sparse import eye, csr_matrix
1010
from scipy.sparse.linalg import eigsh
1111

12-
from ..base import BaseEstimator, TransformerMixin
12+
from ..base import BaseEstimator, TransformerMixin, _UnstableArchMixin
1313
from ..utils import check_random_state, check_array
1414
from ..utils.extmath import stable_cumsum
1515
from ..utils.validation import check_is_fitted
@@ -518,7 +518,8 @@ def locally_linear_embedding(
518518
tol=tol, max_iter=max_iter, random_state=random_state)
519519

520520

521-
class LocallyLinearEmbedding(BaseEstimator, TransformerMixin):
521+
class LocallyLinearEmbedding(BaseEstimator, TransformerMixin,
522+
_UnstableArchMixin):
522523
"""Locally Linear Embedding
523524
524525
Read more in the :ref:`User Guide <locally_linear_embedding>`.

0 commit comments

Comments
 (0)
0