gpt4 book ai didi

python-2.7 - 在 Ubuntu 12.04 上测试失败

转载 作者:行者123 更新时间:2023-12-04 19:20:10 25 4
gpt4 key购买 nike

通过“sodu python setup.py install”从版本0.14.1的源代码安装scikit-learn后,我通过“nosetests sklearn --exe”测试了该软件包,并收到以下信息:

==================================================================================
/home/elkan/Downloads/MS2PIP/scikit-learn/sklearn/feature_selection/selector_mixin.py:7: DeprecationWarning: sklearn.feature_selection.selector_mixin.SelectorMixin has been renamed sklearn.feature_selection.from_model._LearntSelectorMixin, and this alias will be removed in version 0.16
DeprecationWarning)
/home/elkan/Downloads/MS2PIP/scikit-learn/sklearn/pls.py:7: DeprecationWarning: This module has been moved to cross_decomposition and will be removed in 0.16
"removed in 0.16", DeprecationWarning)
.......S................../home/elkan/Downloads/MS2PIP/scikit-learn/sklearn/cluster/hierarchical.py:746: DeprecationWarning: The Ward class is deprecated since 0.14 and will be removed in 0.17. Use the AgglomerativeClustering instead.
"instead.", DeprecationWarning)
.........../usr/lib/python2.7/dist-packages/numpy/distutils/system_info.py:1423: UserWarning:
Atlas (http://math-atlas.sourceforge.net/) libraries not found.
Directories to search for the libraries can be specified in the
numpy/distutils/site.cfg file (section [atlas]) or by setting
the ATLAS environment variable.
warnings.warn(AtlasNotFoundError.__doc__)
.............................................../home/elkan/Downloads/MS2PIP/scikit-learn/sklearn/manifold/spectral_embedding_.py:226: UserWarning: Graph is not fully connected, spectral embedding may not work as expected.
warnings.warn("Graph is not fully connected, spectral embedding"
..................................SS..............S.................................................../home/elkan/Downloads/MS2PIP/scikit-learn/sklearn/utils/extmath.py:83: NonBLASDotWarning: Data must be of same type. Supported types are 32 and 64 bit float. Falling back to np.dot.
'Falling back to np.dot.', NonBLASDotWarning)
....................../home/elkan/Downloads/MS2PIP/scikit-learn/sklearn/decomposition/fastica_.py:271: UserWarning: Ignoring n_components with whiten=False.
warnings.warn('Ignoring n_components with whiten=False.')
..................../home/elkan/Downloads/MS2PIP/scikit-learn/sklearn/utils/extmath.py:83: NonBLASDotWarning: Data must be of same type. Supported types are 32 and 64 bit float. Falling back to np.dot.
'Falling back to np.dot.', NonBLASDotWarning)
....................................S................................../home/elkan/Downloads/MS2PIP/scikit-learn/sklearn/externals/joblib/test/test_func_inspect.py:134: UserWarning: Cannot inspect object <functools.partial object at 0xbdebf04>, ignore list will not work.
nose.tools.assert_equal(filter_args(ff, ['y'], (1, )),

FAIL: Check that gini is equivalent to mse for binary output variable
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/home/elkan/Downloads/MS2PIP/scikit-learn/sklearn/tree/tests/test_tree.py", line 301, in test_importances_gini_equal_mse
assert_almost_equal(clf.feature_importances_, reg.feature_importances_)
File "/usr/lib/python2.7/dist-packages/numpy/testing/utils.py", line 452, in assert_almost_equal
return assert_array_almost_equal(actual, desired, decimal, err_msg)
File "/usr/lib/python2.7/dist-packages/numpy/testing/utils.py", line 800, in assert_array_almost_equal
header=('Arrays are not almost equal to %d decimals' % decimal))
File "/usr/lib/python2.7/dist-packages/numpy/testing/utils.py", line 636, in assert_array_compare
raise AssertionError(msg)
AssertionError:
Arrays are not almost equal to 7 decimals

(mismatch 70.0%)
x: array([ 0.2925143 , 0.27676187, 0.18835709, 0.04181255, 0.03699054,
0.01668818, 0.03661717, 0.03439216, 0.04422749, 0.03163866])
y: array([ 0.29599052, 0.27676187, 0.19146823, 0.03837769, 0.03699054,
0.01811955, 0.0362238 , 0.03439216, 0.04137032, 0.03030531])
>> raise AssertionError('\nArrays are not almost equal to 7 decimals\n\n(mismatch 70.0%)\n x: array([ 0.2925143 , 0.27676187, 0.18835709, 0.04181255, 0.03699054,\n 0.01668818, 0.03661717, 0.03439216, 0.04422749, 0.03163866])\n y: array([ 0.29599052, 0.27676187, 0.19146823, 0.03837769, 0.03699054,\n 0.01811955, 0.0362238 , 0.03439216, 0.04137032, 0.03030531])')


----------------------------------------------------------------------
Ran 3950 tests in 150.890s

FAILED (SKIP=19, failures=1)


==================================================================================

python版本为2.7.3,操作系统为32位。
那么,问题可能是什么?

谢谢。

最佳答案

这是 32 位平台上的数值精度差异。您可以放心地忽略它,因为失败的测试正在检查属性 clf.feature_importances_ 的值。随机森林通常不需要精确才能有用(解释对 RF 模型有贡献的最重要特征)。

关于python-2.7 - 在 Ubuntu 12.04 上测试失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22496910/

25 4 0
文章推荐: ubuntu - 如何设置 ipython 工作目录?
文章推荐: graph - 图表中的前身?
文章推荐: flash - 标签中的 classid 有什么作用?