Intel® Distribution for Python*
Engage in discussions with community peers related to Python* applications and core computational packages.
427 Discussions

Sklearn tests: Errors and Failures under Intel Python distribution 3.5.3

sergio_r_
Novice
506 Views

Hello folks,

After googling for a while, an alternative way for running sklearn suite test came to light. It is
via the shell command "nosetests  --exe sklearn"

Shown below are some errors and failures obtained when executing it under
   Python version 3.5.3 |Intel Corporation| (default, May 18 2017,
   22:17:21) [GCC 4 .8.2 20140120 (Red Hat 4.8.2-15)]

Salut,

Sergio

Sergio
Enhance your #MachineLearning and #BigData skills via #Python #SciPy
1) https://www.packtpub.com/big-data-and-business-intelligence/numerical-and-scientific-computing-scipy-video
2) https://www.packtpub.com/big-data-and-business-intelligence/learning-scipy-numerical-and-scientific-computing-second-edition
3) https://www.researchgate.net/publication/301293668_Aprendiendo_a_Programar_en_Python_con_mi_Computador_Primeros_pasos_rumbo_a_computos_de_gran_escala_en_las_Ciencias_e_Ingenierias

$ python -c "import sklearn ; print('scikit-learn:', sklearn.__version__)"
scikit-learn: 0.18.1

$ nosetests  --exe sklearn 
...
....
.....................................................
======================================================================
ERROR: /home/intel2018py/intelpython3/lib/python3.5/site-packages/sklearn/tests/
test_common.py.test_non_meta_estimators:check_estimators_pickle(LinearRegression
)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/intel2018py/intelpython3/lib/python3.5/site-packages/nose/case.py"
, line 197, in runTest
    self.test(*self.arg)
  File "/home/intel2018py/intelpython3/lib/python3.5/site-packages/sklearn/utils
/testing.py", line 830, in __call__
    return self.check(*args, **kwargs)
  File "/home/intel2018py/intelpython3/lib/python3.5/site-packages/sklearn/utils
/testing.py", line 355, in wrapper
    return fn(*args, **kwargs)
  File "/home/intel2018py/intelpython3/lib/python3.5/site-packages/sklearn/utils
/estimator_checks.py", line 889, in check_estimators_pickle
    pickled_estimator = pickle.dumps(estimator)
TypeError: can't pickle SwigPyObject objects

======================================================================
ERROR: /home/intel2018py/intelpython3/lib/python3.5/site-packages/sklearn/tests/
test_common.py.test_non_meta_estimators:check_fit2d_predict1d(LinearRegression)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/intel2018py/intelpython3/lib/python3.5/site-packages/nose/case.py"
, line 197, in runTest
    self.test(*self.arg)
  File "/home/intel2018py/intelpython3/lib/python3.5/site-packages/sklearn/utils
/testing.py", line 830, in __call__
    return self.check(*args, **kwargs)
  File "/home/intel2018py/intelpython3/lib/python3.5/site-packages/sklearn/utils
/estimator_checks.py", line 479, in check_fit2d_predict1d
    getattr(estimator, method), X[0])
  File "/home/intel2018py/intelpython3/lib/python3.5/site-packages/sklearn/utils
/testing.py", line 186, in assert_warns
    result = func(*args, **kw)
  File "/home/intel2018py/intelpython3/lib/python3.5/site-packages/sklearn/daal4
sklearn/linear.py", line 155, in predict
    return daal_predict(self, X)
  File "/home/intel2018py/intelpython3/lib/python3.5/site-packages/sklearn/daal4
sklearn/linear.py", line 55, in daal_predict
    predictionResult = algorithm.compute()
  File "/home/intel2018py/intelpython3/lib/python3.5/site-packages/daal/algorith
ms/linear_model/prediction.py", line 256, in compute
    return _prediction9.Batch_Float64DefaultDense_compute(self)
SystemError: Number of columns in numeric table is incorrect
Details:
Argument name: data


======================================================================
ERROR: /home/intel2018py/intelpython3/lib/python3.5/site-packages/sklearn/tests/
test_common.py.test_non_meta_estimators:check_estimators_pickle(RANSACRegressor)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/intel2018py/intelpython3/lib/python3.5/site-packages/nose/case.py"
, line 197, in runTest
    self.test(*self.arg)
  File "/home/intel2018py/intelpython3/lib/python3.5/site-packages/sklearn/utils
/testing.py", line 830, in __call__
    return self.check(*args, **kwargs)
  File "/home/intel2018py/intelpython3/lib/python3.5/site-packages/sklearn/utils
/testing.py", line 355, in wrapper
    return fn(*args, **kwargs)
  File "/home/intel2018py/intelpython3/lib/python3.5/site-packages/sklearn/utils
/estimator_checks.py", line 889, in check_estimators_pickle
    pickled_estimator = pickle.dumps(estimator)
TypeError: can't pickle SwigPyObject objects

======================================================================
ERROR: /home/intel2018py/intelpython3/lib/python3.5/site-packages/sklearn/tests/
test_common.py.test_non_meta_estimators:check_supervised_y_2d(RANSACRegressor)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/intel2018py/intelpython3/lib/python3.5/site-packages/nose/case.py"
, line 197, in runTest
    self.test(*self.arg)
  File "/home/intel2018py/intelpython3/lib/python3.5/site-packages/sklearn/utils
/testing.py", line 830, in __call__
    return self.check(*args, **kwargs)
  File "/home/intel2018py/intelpython3/lib/python3.5/site-packages/sklearn/utils
/testing.py", line 355, in wrapper
    return fn(*args, **kwargs)
  File "/home/intel2018py/intelpython3/lib/python3.5/site-packages/sklearn/utils
/estimator_checks.py", line 1151, in check_supervised_y_2d
    estimator.fit(X, y[:, np.newaxis])
  File "/home/intel2018py/intelpython3/lib/python3.5/site-packages/sklearn/linea
r_model/ransac.py", line 363, in fit
    self.residual_threshold))
ValueError: No inliers found, possible cause is setting residual_threshold (None
) too low.

======================================================================
ERROR: /home/intel2018py/intelpython3/lib/python3.5/site-packages/sklearn/tests/
test_common.py.test_non_meta_estimators:check_fit2d_predict1d(RANSACRegressor)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/intel2018py/intelpython3/lib/python3.5/site-packages/nose/case.py"
, line 197, in runTest
    self.test(*self.arg)
  File "/home/intel2018py/intelpython3/lib/python3.5/site-packages/sklearn/utils
/testing.py", line 830, in __call__
    return self.check(*args, **kwargs)
  File "/home/intel2018py/intelpython3/lib/python3.5/site-packages/sklearn/utils
/estimator_checks.py", line 479, in check_fit2d_predict1d
    getattr(estimator, method), X[0])
  File "/home/intel2018py/intelpython3/lib/python3.5/site-packages/sklearn/utils
/testing.py", line 186, in assert_warns
    result = func(*args, **kw)
  File "/home/intel2018py/intelpython3/lib/python3.5/site-packages/sklearn/linea
r_model/ransac.py", line 428, in predict
    return self.estimator_.predict(X)
  File "/home/intel2018py/intelpython3/lib/python3.5/site-packages/sklearn/daal4
sklearn/linear.py", line 155, in predict
    return daal_predict(self, X)
  File "/home/intel2018py/intelpython3/lib/python3.5/site-packages/sklearn/daal4
sklearn/linear.py", line 55, in daal_predict
    predictionResult = algorithm.compute()
  File "/home/intel2018py/intelpython3/lib/python3.5/site-packages/daal/algorith
ms/linear_model/prediction.py", line 256, in compute
    return _prediction9.Batch_Float64DefaultDense_compute(self)
SystemError: Number of columns in numeric table is incorrect
Details:
Argument name: data


======================================================================
ERROR: /home/intel2018py/intelpython3/lib/python3.5/site-packages/sklearn/tests/
test_common.py.test_non_meta_estimators:check_estimators_pickle(Ridge)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/intel2018py/intelpython3/lib/python3.5/site-packages/nose/case.py"
, line 197, in runTest
    self.test(*self.arg)
  File "/home/intel2018py/intelpython3/lib/python3.5/site-packages/sklearn/utils
/testing.py", line 830, in __call__
    return self.check(*args, **kwargs)
  File "/home/intel2018py/intelpython3/lib/python3.5/site-packages/sklearn/utils
/testing.py", line 355, in wrapper
    return fn(*args, **kwargs)
  File "/home/intel2018py/intelpython3/lib/python3.5/site-packages/sklearn/utils
/estimator_checks.py", line 889, in check_estimators_pickle
    pickled_estimator = pickle.dumps(estimator)
TypeError: can't pickle SwigPyObject objects

======================================================================
FAIL: sklearn.cluster.tests.test_bicluster.test_project_and_cluster
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/intel2018py/intelpython3/lib/python3.5/site-packages/nose/case.py"
, line 197, in runTest
    self.test(*self.arg)
  File "/home/intel2018py/intelpython3/lib/python3.5/site-packages/sklearn/clust
er/tests/test_bicluster.py", line 207, in test_project_and_cluster
    assert_array_equal(labels, [0, 0, 1, 1])
  File "/home/intel2018py/intelpython3/lib/python3.5/site-packages/numpy/testing
/utils.py", line 871, in assert_array_equal
    verbose=verbose, header='Arrays are not equal')
  File "/home/intel2018py/intelpython3/lib/python3.5/site-packages/numpy/testing
/utils.py", line 796, in assert_array_compare
    raise AssertionError(msg)
AssertionError: 
Arrays are not equal

(mismatch 100.0%)
 x: array([1, 1, 0, 0], dtype=int32)
 y: array([0, 0, 1, 1])

======================================================================
FAIL: sklearn.cluster.tests.test_k_means.test_k_means_non_collapsed
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/intel2018py/intelpython3/lib/python3.5/site-packages/nose/case.py"
, line 197, in runTest
    self.test(*self.arg)
  File "/home/intel2018py/intelpython3/lib/python3.5/site-packages/sklearn/clust
er/tests/test_k_means.py", line 552, in test_k_means_non_collapsed
    assert_equal(len(np.unique(km.labels_)), 3)
AssertionError: 1 != 3

======================================================================
FAIL: sklearn.manifold.tests.test_spectral_embedding.test_pipeline_spectral_clus
tering
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/intel2018py/intelpython3/lib/python3.5/site-packages/nose/case.py"
, line 197, in runTest
    self.test(*self.arg)
  File "/home/intel2018py/intelpython3/lib/python3.5/site-packages/sklearn/manif
old/tests/test_spectral_embedding.py", line 198, in test_pipeline_spectral_clust
ering
    true_labels), 1.0, 2)
  File "/home/intel2018py/intelpython3/lib/python3.5/site-packages/numpy/testing
/utils.py", line 979, in assert_array_almost_equal
    precision=decimal)
  File "/home/intel2018py/intelpython3/lib/python3.5/site-packages/numpy/testing
/utils.py", line 796, in assert_array_compare
    raise AssertionError(msg)
AssertionError: 
Arrays are not almost equal to 2 decimals

(mismatch 100.0%)
 x: array(0.5866188259941206)
 y: array(1.0)

======================================================================
FAIL: sklearn.mixture.tests.test_dpgmm.test_class_weights
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/intel2018py/intelpython3/lib/python3.5/site-packages/nose/case.py"
, line 197, in runTest
    self.test(*self.arg)
  File "/home/intel2018py/intelpython3/lib/python3.5/site-packages/sklearn/utils
/testing.py", line 355, in wrapper
    return fn(*args, **kwargs)
  File "/home/intel2018py/intelpython3/lib/python3.5/site-packages/sklearn/mixtu
re/tests/test_dpgmm.py", line 41, in test_class_weights
    assert_array_less(dpgmm.weights_[~active], .05)
  File "/home/intel2018py/intelpython3/lib/python3.5/site-packages/numpy/testing
/utils.py", line 1051, in assert_array_less
    header='Arrays are not less-ordered')
  File "/home/intel2018py/intelpython3/lib/python3.5/site-packages/numpy/testing
/utils.py", line 796, in assert_array_compare
    raise AssertionError(msg)
AssertionError: 
Arrays are not less-ordered

(mismatch 14.285714285714292%)
 x: array([ 0.227048,  0.035354,  0.034998,  0.03491 ,  0.034875,  0.034874,
        0.034887])
 y: array(0.05)

======================================================================
FAIL: /home/intel2018py/intelpython3/lib/python3.5/site-packages/sklearn/tests/t
est_common.py.test_non_meta_estimators:check_estimators_nan_inf(LinearRegression
)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/intel2018py/intelpython3/lib/python3.5/site-packages/nose/case.py"
, line 197, in runTest
    self.test(*self.arg)
  File "/home/intel2018py/intelpython3/lib/python3.5/site-packages/sklearn/utils
/testing.py", line 830, in __call__
    return self.check(*args, **kwargs)
  File "/home/intel2018py/intelpython3/lib/python3.5/site-packages/sklearn/utils
/estimator_checks.py", line 840, in check_estimators_nan_inf
    raise AssertionError(error_string_predict, Estimator)
AssertionError: ("Estimator doesn't check for NaN and inf in predict.", <class '
sklearn.linear_model.base.LinearRegression'>)

======================================================================
FAIL: /home/intel2018py/intelpython3/lib/python3.5/site-packages/sklearn/tests/t
est_common.py.test_non_meta_estimators:check_estimators_nan_inf(RANSACRegressor)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/intel2018py/intelpython3/lib/python3.5/site-packages/nose/case.py"
, line 197, in runTest
    self.test(*self.arg)
  File "/home/intel2018py/intelpython3/lib/python3.5/site-packages/sklearn/utils
/testing.py", line 830, in __call__
    return self.check(*args, **kwargs)
  File "/home/intel2018py/intelpython3/lib/python3.5/site-packages/sklearn/utils
/estimator_checks.py", line 840, in check_estimators_nan_inf
    raise AssertionError(error_string_predict, Estimator)
AssertionError: ("Estimator doesn't check for NaN and inf in predict.", <class '
sklearn.linear_model.ransac.RANSACRegressor'>)

----------------------------------------------------------------------
Ran 7166 tests in 222.162s

FAILED (SKIP=14, errors=6, failures=6)

 

0 Kudos
0 Replies
Reply