建议:2008 Mac w/OSX 10.8 host w/Virtualbox guest Ubuntu 12.04 设置 python、scikit-learn 和其他 ML 工具

Posted

技术标签:

【中文标题】建议:2008 Mac w/OSX 10.8 host w/Virtualbox guest Ubuntu 12.04 设置 python、scikit-learn 和其他 ML 工具【英文标题】:Advice: 2008 Mac w/OSX 10.8 host w/Virtualbox guest Ubuntu 12.04 setting up python, scikit-learn & other ML tools 【发布时间】:2013-10-20 02:49:11 【问题描述】:

我想就我需要完成的任务提供哪些选项或最佳选项的反馈。我有一台较旧的 Macbook pro 2008、8GB RAM、10.8 Mountain Lion。我安装了 Virtualbox 并安装了 Ubuntu 12.04 VM。安装 Ubuntu 的原因是能够运行一些我需要的 perl 脚本来收集数据并将它们放入 MongoDB(我无法在 OSX 中这样做)

从 MongoDB 中,我将数据提取为可以输入到开源机器学习库中的格式。我想从 scikit-learn 开始。其他可能是 WEKA 和小型 Hadoop(因为 Hadoop 也是我想开始学习使用的东西,所以我会用一块石头杀死两只鸟)。甚至可能是graphlab...

数据量不是很大,Mongo之前是原始形式,现在大概3-4GB左右。

因为我有 Ubuntu 虚拟机,所以我决定用它来运行 scikit learn。我在 Ubuntu 上安装了 python3,然后是 numpy、scipy、matplotlib,然后是 scikitlearn。当我运行鼻子测试时,我收到错误并失败。

我已经阅读了各种选项,但不确定最好的方法是什么。我是否使用 Ubuntu 或 OSX 上的预打包工具之一来运行 scikit learn 和 python3?例如:EPD Entought Canopy OR http://docs.continuum.io/anaconda/pkgs.html OR for OSX https://github.com/fonnesbeck/ScipySuperpack

我是否忘记了 python3 并使用 python 2.7 并从源代码安装所有内容..? Ubuntu 或 OSX 哪个是使用 scikit learn 和其他流行的免费机器学习库/工具的最佳选择?

提前感谢您的帮助和时间。

下面是运行 nosetests sklearn --exe 的输出 这是输出的尾端。由于字数限制和错误,第一部分主要是警告..

./usr/local/lib/python3.2/dist-packages/sklearn/datasets/tests/test_base.py:155: UserWarning: Could not load sample images, PIL is not available.
/usr/local/lib/python3.2/dist-packages/sklearn/decomposition/fastica_.py:271: UserWarning: Ignoring n_components with whiten=False.
./usr/local/lib/python3.2/dist-packages/sklearn/utils/__init__.py:75: DeprecationWarning: Class ProbabilisticPCA is deprecated; ProbabilisticPCA will be removed in 0.16. WARNING: the covariance estimation was previously incorrect, your output might be different  than under the previous versions. Use PCA that implements score and score_samples. To work with homoscedastic=False, you should use FactorAnalysis.

/usr/local/lib/python3.2/dist-packages/sklearn/externals/joblib/test/test_func_inspect.py:122: UserWarning: Cannot inspect object functools.partial(<function f at 0xba47dec>, 1), ignore list will not work.
  nose.tools.assert_equal(filter_args(ff, ['y'], (1, )),
======================================================================
ERROR: Failure: SyntaxError (invalid syntax (test_text.py, line 561))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.2/dist-packages/nose-1.3.0-py3.2.egg/nose/failure.py", line 38, in runTest
    raise self.exc_val.with_traceback(self.tb)
  File "/usr/local/lib/python3.2/dist-packages/nose-1.3.0-py3.2.egg/nose/loader.py", line 413, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/local/lib/python3.2/dist-packages/nose-1.3.0-py3.2.egg/nose/importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/local/lib/python3.2/dist-packages/nose-1.3.0-py3.2.egg/nose/importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/usr/local/lib/python3.2/dist-packages/sklearn/feature_extraction/tests/test_text.py", line 561
    expected_stop_words = set([u'celeri', u'tomato', u'copyright', u'coke',
                                       ^
SyntaxError: invalid syntax

======================================================================
ERROR: sklearn.metrics.tests.test_metrics.test_classification_report_multiclass_with_string_label
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.2/dist-packages/nose-1.3.0-py3.2.egg/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/usr/local/lib/python3.2/dist-packages/sklearn/metrics/tests/test_metrics.py", line 822, in test_classification_report_multiclass_with_string_label
    report = classification_report(y_true, y_pred)
  File "/usr/local/lib/python3.2/dist-packages/sklearn/metrics/metrics.py", line 1828, in classification_report
    average=None)
  File "/usr/local/lib/python3.2/dist-packages/sklearn/metrics/metrics.py", line 1550, in precision_recall_fscore_support
    'precision', 'predicted', average)
  File "/usr/local/lib/python3.2/dist-packages/sklearn/metrics/metrics.py", line 1331, in _prf_divide
    result = numerator / denominator
ValueError: operands could not be broadcast together with shapes (3) (4) 

======================================================================
ERROR: Failure: SyntaxError (invalid syntax (test_multiclass.py, line 53))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.2/dist-packages/nose-1.3.0-py3.2.egg/nose/failure.py", line 38, in runTest
    raise self.exc_val.with_traceback(self.tb)
  File "/usr/local/lib/python3.2/dist-packages/nose-1.3.0-py3.2.egg/nose/loader.py", line 413, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/local/lib/python3.2/dist-packages/nose-1.3.0-py3.2.egg/nose/importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/local/lib/python3.2/dist-packages/nose-1.3.0-py3.2.egg/nose/importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/usr/local/lib/python3.2/dist-packages/sklearn/utils/tests/test_multiclass.py", line 53
    np.array([u'a', u'b', u'c']),
                 ^
SyntaxError: invalid syntax

======================================================================
ERROR: sklearn.tests.test_common.test_all_estimators
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.2/dist-packages/nose-1.3.0-py3.2.egg/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/usr/local/lib/python3.2/dist-packages/sklearn/tests/test_common.py", line 58, in test_all_estimators
    estimators = all_estimators(include_meta_estimators=True)
  File "/usr/local/lib/python3.2/dist-packages/sklearn/utils/testing.py", line 300, in all_estimators
    module = __import__(modname, fromlist="dummy")
  File "/usr/local/lib/python3.2/dist-packages/sklearn/feature_extraction/tests/test_text.py", line 561
    expected_stop_words = set([u'celeri', u'tomato', u'copyright', u'coke',
                                       ^
SyntaxError: invalid syntax

======================================================================
ERROR: sklearn.tests.test_common.test_all_estimator_no_base_class
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.2/dist-packages/nose-1.3.0-py3.2.egg/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/usr/local/lib/python3.2/dist-packages/sklearn/tests/test_common.py", line 117, in test_all_estimator_no_base_class
    for name, Estimator in all_estimators():
  File "/usr/local/lib/python3.2/dist-packages/sklearn/utils/testing.py", line 300, in all_estimators
    module = __import__(modname, fromlist="dummy")
  File "/usr/local/lib/python3.2/dist-packages/sklearn/feature_extraction/tests/test_text.py", line 561
    expected_stop_words = set([u'celeri', u'tomato', u'copyright', u'coke',
                                       ^
SyntaxError: invalid syntax

======================================================================
ERROR: sklearn.tests.test_common.test_estimators_sparse_data
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.2/dist-packages/nose-1.3.0-py3.2.egg/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/usr/local/lib/python3.2/dist-packages/sklearn/tests/test_common.py", line 131, in test_estimators_sparse_data
    estimators = all_estimators()
  File "/usr/local/lib/python3.2/dist-packages/sklearn/utils/testing.py", line 300, in all_estimators
    module = __import__(modname, fromlist="dummy")
  File "/usr/local/lib/python3.2/dist-packages/sklearn/feature_extraction/tests/test_text.py", line 561
    expected_stop_words = set([u'celeri', u'tomato', u'copyright', u'coke',
                                       ^
SyntaxError: invalid syntax

======================================================================
ERROR: sklearn.tests.test_common.test_transformers_sparse_data
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.2/dist-packages/nose-1.3.0-py3.2.egg/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/usr/local/lib/python3.2/dist-packages/sklearn/tests/test_common.py", line 258, in test_transformers_sparse_data
    estimators = all_estimators(type_filter='transformer')
  File "/usr/local/lib/python3.2/dist-packages/sklearn/utils/testing.py", line 300, in all_estimators
    module = __import__(modname, fromlist="dummy")
  File "/usr/local/lib/python3.2/dist-packages/sklearn/feature_extraction/tests/test_text.py", line 561
    expected_stop_words = set([u'celeri', u'tomato', u'copyright', u'coke',
                                       ^
SyntaxError: invalid syntax

======================================================================
ERROR: sklearn.tests.test_common.test_estimators_nan_inf
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.2/dist-packages/nose-1.3.0-py3.2.egg/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/usr/local/lib/python3.2/dist-packages/sklearn/tests/test_common.py", line 301, in test_estimators_nan_inf
    estimators = all_estimators()
  File "/usr/local/lib/python3.2/dist-packages/sklearn/utils/testing.py", line 300, in all_estimators
    module = __import__(modname, fromlist="dummy")
  File "/usr/local/lib/python3.2/dist-packages/sklearn/feature_extraction/tests/test_text.py", line 561
    expected_stop_words = set([u'celeri', u'tomato', u'copyright', u'coke',
                                       ^
SyntaxError: invalid syntax

======================================================================
ERROR: sklearn.tests.test_common.test_transformers_pickle
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.2/dist-packages/nose-1.3.0-py3.2.egg/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/usr/local/lib/python3.2/dist-packages/sklearn/tests/test_common.py", line 392, in test_transformers_pickle
    transformers = all_estimators(type_filter='transformer')
  File "/usr/local/lib/python3.2/dist-packages/sklearn/utils/testing.py", line 300, in all_estimators
    module = __import__(modname, fromlist="dummy")
  File "/usr/local/lib/python3.2/dist-packages/sklearn/feature_extraction/tests/test_text.py", line 561
    expected_stop_words = set([u'celeri', u'tomato', u'copyright', u'coke',
                                       ^
SyntaxError: invalid syntax

======================================================================
ERROR: sklearn.tests.test_common.test_classifiers_one_label
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.2/dist-packages/nose-1.3.0-py3.2.egg/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/usr/local/lib/python3.2/dist-packages/sklearn/tests/test_common.py", line 457, in test_classifiers_one_label
    classifiers = all_estimators(type_filter='classifier')
  File "/usr/local/lib/python3.2/dist-packages/sklearn/utils/testing.py", line 300, in all_estimators
    module = __import__(modname, fromlist="dummy")
  File "/usr/local/lib/python3.2/dist-packages/sklearn/feature_extraction/tests/test_text.py", line 561
    expected_stop_words = set([u'celeri', u'tomato', u'copyright', u'coke',
                                       ^
SyntaxError: invalid syntax

======================================================================
ERROR: sklearn.tests.test_common.test_clustering
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.2/dist-packages/nose-1.3.0-py3.2.egg/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/usr/local/lib/python3.2/dist-packages/sklearn/tests/test_common.py", line 492, in test_clustering
    clustering = all_estimators(type_filter='cluster')
  File "/usr/local/lib/python3.2/dist-packages/sklearn/utils/testing.py", line 300, in all_estimators
    module = __import__(modname, fromlist="dummy")
  File "/usr/local/lib/python3.2/dist-packages/sklearn/feature_extraction/tests/test_text.py", line 561
    expected_stop_words = set([u'celeri', u'tomato', u'copyright', u'coke',
                                       ^
SyntaxError: invalid syntax

======================================================================
ERROR: sklearn.tests.test_common.test_classifiers_train
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.2/dist-packages/nose-1.3.0-py3.2.egg/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/usr/local/lib/python3.2/dist-packages/sklearn/tests/test_common.py", line 530, in test_classifiers_train
    classifiers = all_estimators(type_filter='classifier')
  File "/usr/local/lib/python3.2/dist-packages/sklearn/utils/testing.py", line 300, in all_estimators
    module = __import__(modname, fromlist="dummy")
  File "/usr/local/lib/python3.2/dist-packages/sklearn/feature_extraction/tests/test_text.py", line 561
    expected_stop_words = set([u'celeri', u'tomato', u'copyright', u'coke',
                                       ^
SyntaxError: invalid syntax

======================================================================
ERROR: sklearn.tests.test_common.test_classifiers_classes
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.2/dist-packages/nose-1.3.0-py3.2.egg/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/usr/local/lib/python3.2/dist-packages/sklearn/tests/test_common.py", line 605, in test_classifiers_classes
    classifiers = all_estimators(type_filter='classifier')
  File "/usr/local/lib/python3.2/dist-packages/sklearn/utils/testing.py", line 300, in all_estimators
    module = __import__(modname, fromlist="dummy")
  File "/usr/local/lib/python3.2/dist-packages/sklearn/feature_extraction/tests/test_text.py", line 561
    expected_stop_words = set([u'celeri', u'tomato', u'copyright', u'coke',
                                       ^
SyntaxError: invalid syntax

======================================================================
ERROR: sklearn.tests.test_common.test_classifiers_input_shapes
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.2/dist-packages/nose-1.3.0-py3.2.egg/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/usr/local/lib/python3.2/dist-packages/sklearn/tests/test_common.py", line 650, in test_classifiers_input_shapes
    classifiers = all_estimators(type_filter='classifier')
  File "/usr/local/lib/python3.2/dist-packages/sklearn/utils/testing.py", line 300, in all_estimators
    module = __import__(modname, fromlist="dummy")
  File "/usr/local/lib/python3.2/dist-packages/sklearn/feature_extraction/tests/test_text.py", line 561
    expected_stop_words = set([u'celeri', u'tomato', u'copyright', u'coke',
                                       ^
SyntaxError: invalid syntax

======================================================================
ERROR: sklearn.tests.test_common.test_classifiers_pickle
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.2/dist-packages/nose-1.3.0-py3.2.egg/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/usr/local/lib/python3.2/dist-packages/sklearn/tests/test_common.py", line 691, in test_classifiers_pickle
    classifiers = all_estimators(type_filter='classifier')
  File "/usr/local/lib/python3.2/dist-packages/sklearn/utils/testing.py", line 300, in all_estimators
    module = __import__(modname, fromlist="dummy")
  File "/usr/local/lib/python3.2/dist-packages/sklearn/feature_extraction/tests/test_text.py", line 561
    expected_stop_words = set([u'celeri', u'tomato', u'copyright', u'coke',
                                       ^
SyntaxError: invalid syntax

======================================================================
ERROR: sklearn.tests.test_common.test_regressors_int
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.2/dist-packages/nose-1.3.0-py3.2.egg/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/usr/local/lib/python3.2/dist-packages/sklearn/tests/test_common.py", line 749, in test_regressors_int
    regressors = all_estimators(type_filter='regressor')
  File "/usr/local/lib/python3.2/dist-packages/sklearn/utils/testing.py", line 300, in all_estimators
    module = __import__(modname, fromlist="dummy")
  File "/usr/local/lib/python3.2/dist-packages/sklearn/feature_extraction/tests/test_text.py", line 561
    expected_stop_words = set([u'celeri', u'tomato', u'copyright', u'coke',
                                       ^
SyntaxError: invalid syntax

======================================================================
ERROR: sklearn.tests.test_common.test_regressors_train
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.2/dist-packages/nose-1.3.0-py3.2.egg/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/usr/local/lib/python3.2/dist-packages/sklearn/tests/test_common.py", line 780, in test_regressors_train
    regressors = all_estimators(type_filter='regressor')
  File "/usr/local/lib/python3.2/dist-packages/sklearn/utils/testing.py", line 300, in all_estimators
    module = __import__(modname, fromlist="dummy")
  File "/usr/local/lib/python3.2/dist-packages/sklearn/feature_extraction/tests/test_text.py", line 561
    expected_stop_words = set([u'celeri', u'tomato', u'copyright', u'coke',
                                       ^
SyntaxError: invalid syntax

======================================================================
ERROR: sklearn.tests.test_common.test_regressor_pickle
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.2/dist-packages/nose-1.3.0-py3.2.egg/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/usr/local/lib/python3.2/dist-packages/sklearn/tests/test_common.py", line 823, in test_regressor_pickle
    regressors = all_estimators(type_filter='regressor')
  File "/usr/local/lib/python3.2/dist-packages/sklearn/utils/testing.py", line 300, in all_estimators
    module = __import__(modname, fromlist="dummy")
  File "/usr/local/lib/python3.2/dist-packages/sklearn/feature_extraction/tests/test_text.py", line 561
    expected_stop_words = set([u'celeri', u'tomato', u'copyright', u'coke',
                                       ^
SyntaxError: invalid syntax

======================================================================
ERROR: sklearn.tests.test_common.test_class_weight_classifiers
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.2/dist-packages/nose-1.3.0-py3.2.egg/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/usr/local/lib/python3.2/dist-packages/sklearn/tests/test_common.py", line 889, in test_class_weight_classifiers
    classifiers = all_estimators(type_filter='classifier')
  File "/usr/local/lib/python3.2/dist-packages/sklearn/utils/testing.py", line 300, in all_estimators
    module = __import__(modname, fromlist="dummy")
  File "/usr/local/lib/python3.2/dist-packages/sklearn/feature_extraction/tests/test_text.py", line 561
    expected_stop_words = set([u'celeri', u'tomato', u'copyright', u'coke',
                                       ^
SyntaxError: invalid syntax

======================================================================
ERROR: sklearn.tests.test_common.test_class_weight_auto_classifies
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.2/dist-packages/nose-1.3.0-py3.2.egg/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/usr/local/lib/python3.2/dist-packages/sklearn/tests/test_common.py", line 926, in test_class_weight_auto_classifies
    classifiers = all_estimators(type_filter='classifier')
  File "/usr/local/lib/python3.2/dist-packages/sklearn/utils/testing.py", line 300, in all_estimators
    module = __import__(modname, fromlist="dummy")
  File "/usr/local/lib/python3.2/dist-packages/sklearn/feature_extraction/tests/test_text.py", line 561
    expected_stop_words = set([u'celeri', u'tomato', u'copyright', u'coke',
                                       ^
SyntaxError: invalid syntax

======================================================================
ERROR: sklearn.tests.test_common.test_estimators_overwrite_params
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.2/dist-packages/nose-1.3.0-py3.2.egg/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/usr/local/lib/python3.2/dist-packages/sklearn/tests/test_common.py", line 974, in test_estimators_overwrite_params
    estimators = all_estimators(type_filter=est_type)
  File "/usr/local/lib/python3.2/dist-packages/sklearn/utils/testing.py", line 300, in all_estimators
    module = __import__(modname, fromlist="dummy")
  File "/usr/local/lib/python3.2/dist-packages/sklearn/feature_extraction/tests/test_text.py", line 561
    expected_stop_words = set([u'celeri', u'tomato', u'copyright', u'coke',
                                       ^
SyntaxError: invalid syntax

======================================================================
ERROR: sklearn.tests.test_common.test_cluster_overwrite_params
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.2/dist-packages/nose-1.3.0-py3.2.egg/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/usr/local/lib/python3.2/dist-packages/sklearn/tests/test_common.py", line 1018, in test_cluster_overwrite_params
    clusterers = all_estimators(type_filter="cluster")
  File "/usr/local/lib/python3.2/dist-packages/sklearn/utils/testing.py", line 300, in all_estimators
    module = __import__(modname, fromlist="dummy")
  File "/usr/local/lib/python3.2/dist-packages/sklearn/feature_extraction/tests/test_text.py", line 561
    expected_stop_words = set([u'celeri', u'tomato', u'copyright', u'coke',
                                       ^
SyntaxError: invalid syntax

======================================================================
FAIL: Test confusion matrix - binary classification case
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.2/dist-packages/nose-1.3.0-py3.2.egg/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/usr/local/lib/python3.2/dist-packages/sklearn/metrics/tests/test_metrics.py", line 630, in test_confusion_matrix_binary
    [str(y) for y in y_pred])
  File "/usr/local/lib/python3.2/dist-packages/sklearn/metrics/tests/test_metrics.py", line 625, in test
    assert_array_almost_equal(mcc, true_mcc, decimal=2)
  File "/usr/lib/python3/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/python3/dist-packages/numpy/testing/utils.py", line 636, in assert_array_compare
    raise AssertionError(msg)
AssertionError: 
Arrays are not almost equal to 2 decimals

(mismatch 100.0%)
 x: array(0.6011393316693135)
 y: array(0.5715476066494083)

======================================================================
FAIL: sklearn.metrics.tests.test_metrics.test_classification_report_multiclass_with_unicode_label
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.2/dist-packages/nose-1.3.0-py3.2.egg/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/usr/local/lib/python3.2/dist-packages/sklearn/metrics/tests/test_metrics.py", line 856, in test_classification_report_multiclass_with_unicode_label
    assert_equal(report, expected_report)
AssertionError: '             precision    recall  f1-score   support\n\n      blue¢       0.63  [truncated]... != '             precision    recall  f1-score   support\n\n      blue¢       0.83  [truncated]...
               precision    recall  f1-score   support

-       blue¢       0.63      0.33      0.44        36
-      green¢       0.17      0.17      0.17         6
+       blue¢       0.83      0.79      0.81        24
+      green¢       0.33      0.10      0.15        31
         red¢       0.42      0.90      0.57        20

- avg / total       0.52      0.50      0.45        62
?                      ^         ^          ----------
+ avg / total       0.51      0.53      0.47        75
?                      ^         ^         ++++++++++


======================================================================
FAIL: Ensure that classification metrics with string labels
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python3.2/dist-packages/nose-1.3.0-py3.2.egg/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/usr/local/lib/python3.2/dist-packages/sklearn/metrics/tests/test_metrics.py", line 1177, in test_invariance_string_vs_numbers_labels
    "test".format(name))
  File "/usr/lib/python3/dist-packages/numpy/testing/utils.py", line 707, in assert_array_equal
    verbose=verbose, header='Arrays are not equal')
  File "/usr/lib/python3/dist-packages/numpy/testing/utils.py", line 636, in assert_array_compare
    raise AssertionError(msg)
AssertionError: 
Arrays are not equal
precision_score failed string vs number invariance test
(mismatch 100.0%)
 x: array(0.85)
 y: array(0.6666666666666666)

----------------------------------------------------------------------
Ran 1714 tests in 129.977s

FAILED (SKIP=16, errors=23, failures=3)

【问题讨论】:

我读过一篇文章说使用 python 2.7 和 python 3 并没有太大区别。我使用 python 3 的原因是学习和使用最新的东西,我假设替换 python 2.7 .因此,如果我使用 python 2.7,我可以使用其中一个预构建的包或仍然从源代码构建。话虽如此,Ubuntu VM 会比 OSX(我的实际操作系统和主机)更好用吗? 如果您希望我们帮助您找到问题的根源,请仅报告错误消息的回溯。 我建议在 OS X 上为 python 2.7 使用 anaconda。虚拟盒子有什么用? ogrisel - 我编辑了带有输出错误的帖子,谢谢。 Andreas - 我需要 Ubuntu 或能够运行 perl 脚本来收集数据并将其存储到 MongoDB。我无法在 OSX 上运行它们。我读过关于蟒蛇的好东西。我会试试看。 您正在运行一个不支持 Python3 的过时 scikit-learn 版本。升级到 0.14。 【参考方案1】:

不支持 Python 3.2(还没有?),如 github 上项目的 README.rst 文件中所写。请暂时安装 Python 3.3 或坚持使用 Python 2.7。

【讨论】:

以上是关于建议:2008 Mac w/OSX 10.8 host w/Virtualbox guest Ubuntu 12.04 设置 python、scikit-learn 和其他 ML 工具的主要内容,如果未能解决你的问题,请参考以下文章

MAC os x 10.8+ 代码签名证书详细信息

如何在 Mac OS X 10.8 / Xcode 4.4 上使用/安装 gcc

envsubst:在 Mac OS X 10.8 上找不到命令

有没有简单的方法在带有 mamp 的 MAC OS 10.8 上安装 mytop?

XAMPP 拒绝在 Mac os 10.8 上启动 Apache

pyQt4 for mac OS 10.8