Skip to content

Instantly share code, notes, and snippets.

@ogrisel
Last active December 20, 2015 08:49
Show Gist options
  • Select an option

  • Save ogrisel/6102848 to your computer and use it in GitHub Desktop.

Select an option

Save ogrisel/6102848 to your computer and use it in GitHub Desktop.
sklearn 0.14 packaged tests
======================================================================
FAIL: Doctest: sklearn.ensemble.partial_dependence.partial_dependence
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python3.3/doctest.py", line 2154, in runTest
raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for sklearn.ensemble.partial_dependence.partial_dependence
File "/home/vagrant/venvs/venv3/lib/python3.3/site-packages/sklearn/ensemble/partial_dependence.py", line 76, in partial_dependence
----------------------------------------------------------------------
File "/home/vagrant/venvs/venv3/lib/python3.3/site-packages/sklearn/ensemble/partial_dependence.py", line 121, in sklearn.ensemble.partial_dependence.partial_dependence
Failed example:
partial_dependence(gb, [0], **kwargs) # doctest: +ELLIPSIS
Exception raised:
Traceback (most recent call last):
File "/usr/lib/python3.3/doctest.py", line 1287, in __run
compileflags, 1), test.globs)
File "<doctest sklearn.ensemble.partial_dependence.partial_dependence[5]>", line 1, in <module>
partial_dependence(gb, [0], **kwargs) # doctest: +ELLIPSIS
NameError: name 'partial_dependence' is not defined
======================================================================
FAIL: Doctest: sklearn.linear_model.coordinate_descent.lasso_path
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python3.3/doctest.py", line 2154, in runTest
raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for sklearn.linear_model.coordinate_descent.lasso_path
File "/home/vagrant/venvs/venv3/lib/python3.3/site-packages/sklearn/linear_model/coordinate_descent.py", line 93, in lasso_path
----------------------------------------------------------------------
File "/home/vagrant/venvs/venv3/lib/python3.3/site-packages/sklearn/linear_model/coordinate_descent.py", line 198, in sklearn.linear_model.coordinate_descent.lasso_path
Failed example:
_, coef_path, _ = lasso_path(X, y, alphas=[5., 1., .5],
return_models=False, fit_intercept=False)
Exception raised:
Traceback (most recent call last):
File "/usr/lib/python3.3/doctest.py", line 1287, in __run
compileflags, 1), test.globs)
File "<doctest sklearn.linear_model.coordinate_descent.lasso_path[2]>", line 1, in <module>
_, coef_path, _ = lasso_path(X, y, alphas=[5., 1., .5],
NameError: name 'lasso_path' is not defined
----------------------------------------------------------------------
File "/home/vagrant/venvs/venv3/lib/python3.3/site-packages/sklearn/linear_model/coordinate_descent.py", line 200, in sklearn.linear_model.coordinate_descent.lasso_path
Failed example:
print(coef_path)
Exception raised:
Traceback (most recent call last):
File "/usr/lib/python3.3/doctest.py", line 1287, in __run
compileflags, 1), test.globs)
File "<doctest sklearn.linear_model.coordinate_descent.lasso_path[3]>", line 1, in <module>
print(coef_path)
NameError: name 'coef_path' is not defined
======================================================================
FAIL: Doctest: sklearn.metrics.metrics.log_loss
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python3.3/doctest.py", line 2154, in runTest
raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for sklearn.metrics.metrics.log_loss
File "/home/vagrant/venvs/venv3/lib/python3.3/site-packages/sklearn/metrics/metrics.py", line 2153, in log_loss
----------------------------------------------------------------------
File "/home/vagrant/venvs/venv3/lib/python3.3/site-packages/sklearn/metrics/metrics.py", line 2187, in sklearn.metrics.metrics.log_loss
Failed example:
log_loss(["spam", "ham", "ham", "spam"], # doctest: +ELLIPSIS
[[.1, .9], [.9, .1], [.8, .2], [.35, .65]])
Exception raised:
Traceback (most recent call last):
File "/usr/lib/python3.3/doctest.py", line 1287, in __run
compileflags, 1), test.globs)
File "<doctest sklearn.metrics.metrics.log_loss[0]>", line 1, in <module>
log_loss(["spam", "ham", "ham", "spam"], # doctest: +ELLIPSIS
NameError: name 'log_loss' is not defined
======================================================================
FAIL: Doctest: sklearn.random_projection.johnson_lindenstrauss_min_dim
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python3.3/doctest.py", line 2154, in runTest
raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for sklearn.random_projection.johnson_lindenstrauss_min_dim
File "/home/vagrant/venvs/venv3/lib/python3.3/site-packages/sklearn/random_projection.py", line 52, in johnson_lindenstrauss_min_dim
----------------------------------------------------------------------
File "/home/vagrant/venvs/venv3/lib/python3.3/site-packages/sklearn/random_projection.py", line 97, in sklearn.random_projection.johnson_lindenstrauss_min_dim
Failed example:
johnson_lindenstrauss_min_dim(1e6, eps=0.5)
Exception raised:
Traceback (most recent call last):
File "/usr/lib/python3.3/doctest.py", line 1287, in __run
compileflags, 1), test.globs)
File "<doctest sklearn.random_projection.johnson_lindenstrauss_min_dim[0]>", line 1, in <module>
johnson_lindenstrauss_min_dim(1e6, eps=0.5)
NameError: name 'johnson_lindenstrauss_min_dim' is not defined
----------------------------------------------------------------------
File "/home/vagrant/venvs/venv3/lib/python3.3/site-packages/sklearn/random_projection.py", line 100, in sklearn.random_projection.johnson_lindenstrauss_min_dim
Failed example:
johnson_lindenstrauss_min_dim(1e6, eps=[0.5, 0.1, 0.01])
Exception raised:
Traceback (most recent call last):
File "/usr/lib/python3.3/doctest.py", line 1287, in __run
compileflags, 1), test.globs)
File "<doctest sklearn.random_projection.johnson_lindenstrauss_min_dim[1]>", line 1, in <module>
johnson_lindenstrauss_min_dim(1e6, eps=[0.5, 0.1, 0.01])
NameError: name 'johnson_lindenstrauss_min_dim' is not defined
----------------------------------------------------------------------
File "/home/vagrant/venvs/venv3/lib/python3.3/site-packages/sklearn/random_projection.py", line 103, in sklearn.random_projection.johnson_lindenstrauss_min_dim
Failed example:
johnson_lindenstrauss_min_dim([1e4, 1e5, 1e6], eps=0.1)
Exception raised:
Traceback (most recent call last):
File "/usr/lib/python3.3/doctest.py", line 1287, in __run
compileflags, 1), test.globs)
File "<doctest sklearn.random_projection.johnson_lindenstrauss_min_dim[2]>", line 1, in <module>
johnson_lindenstrauss_min_dim([1e4, 1e5, 1e6], eps=0.1)
NameError: name 'johnson_lindenstrauss_min_dim' is not defined
======================================================================
FAIL: Doctest: sklearn.utils.extmath.cartesian
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python3.3/doctest.py", line 2154, in runTest
raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for sklearn.utils.extmath.cartesian
File "/home/vagrant/venvs/venv3/lib/python3.3/site-packages/sklearn/utils/extmath.py", line 386, in cartesian
----------------------------------------------------------------------
File "/home/vagrant/venvs/venv3/lib/python3.3/site-packages/sklearn/utils/extmath.py", line 404, in sklearn.utils.extmath.cartesian
Failed example:
cartesian(([1, 2, 3], [4, 5], [6, 7]))
Exception raised:
Traceback (most recent call last):
File "/usr/lib/python3.3/doctest.py", line 1287, in __run
compileflags, 1), test.globs)
File "<doctest sklearn.utils.extmath.cartesian[0]>", line 1, in <module>
cartesian(([1, 2, 3], [4, 5], [6, 7]))
NameError: name 'cartesian' is not defined
======================================================================
FAIL: Doctest: sklearn.utils.extmath.pinvh
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python3.3/doctest.py", line 2154, in runTest
raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for sklearn.utils.extmath.pinvh
File "/home/vagrant/venvs/venv3/lib/python3.3/site-packages/sklearn/utils/extmath.py", line 327, in pinvh
----------------------------------------------------------------------
File "/home/vagrant/venvs/venv3/lib/python3.3/site-packages/sklearn/utils/extmath.py", line 361, in sklearn.utils.extmath.pinvh
Failed example:
B = pinvh(a)
Exception raised:
Traceback (most recent call last):
File "/usr/lib/python3.3/doctest.py", line 1287, in __run
compileflags, 1), test.globs)
File "<doctest sklearn.utils.extmath.pinvh[3]>", line 1, in <module>
B = pinvh(a)
NameError: name 'pinvh' is not defined
----------------------------------------------------------------------
File "/home/vagrant/venvs/venv3/lib/python3.3/site-packages/sklearn/utils/extmath.py", line 362, in sklearn.utils.extmath.pinvh
Failed example:
allclose(a, dot(a, dot(B, a)))
Exception raised:
Traceback (most recent call last):
File "/usr/lib/python3.3/doctest.py", line 1287, in __run
compileflags, 1), test.globs)
File "<doctest sklearn.utils.extmath.pinvh[4]>", line 1, in <module>
allclose(a, dot(a, dot(B, a)))
NameError: name 'B' is not defined
----------------------------------------------------------------------
File "/home/vagrant/venvs/venv3/lib/python3.3/site-packages/sklearn/utils/extmath.py", line 364, in sklearn.utils.extmath.pinvh
Failed example:
allclose(B, dot(B, dot(a, B)))
Exception raised:
Traceback (most recent call last):
File "/usr/lib/python3.3/doctest.py", line 1287, in __run
compileflags, 1), test.globs)
File "<doctest sklearn.utils.extmath.pinvh[5]>", line 1, in <module>
allclose(B, dot(B, dot(a, B)))
NameError: name 'B' is not defined
======================================================================
FAIL: Doctest: sklearn.utils.multiclass.is_sequence_of_sequences
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python3.3/doctest.py", line 2154, in runTest
raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for sklearn.utils.multiclass.is_sequence_of_sequences
File "/home/vagrant/venvs/venv3/lib/python3.3/site-packages/sklearn/utils/multiclass.py", line 151, in is_sequence_of_sequences
----------------------------------------------------------------------
File "/home/vagrant/venvs/venv3/lib/python3.3/site-packages/sklearn/utils/multiclass.py", line 165, in sklearn.utils.multiclass.is_sequence_of_sequences
Failed example:
is_sequence_of_sequences([0, 1, 0, 1])
Exception raised:
Traceback (most recent call last):
File "/usr/lib/python3.3/doctest.py", line 1287, in __run
compileflags, 1), test.globs)
File "<doctest sklearn.utils.multiclass.is_sequence_of_sequences[2]>", line 1, in <module>
is_sequence_of_sequences([0, 1, 0, 1])
NameError: name 'is_sequence_of_sequences' is not defined
----------------------------------------------------------------------
File "/home/vagrant/venvs/venv3/lib/python3.3/site-packages/sklearn/utils/multiclass.py", line 167, in sklearn.utils.multiclass.is_sequence_of_sequences
Failed example:
is_sequence_of_sequences([[1], [0, 2], []])
Exception raised:
Traceback (most recent call last):
File "/usr/lib/python3.3/doctest.py", line 1287, in __run
compileflags, 1), test.globs)
File "<doctest sklearn.utils.multiclass.is_sequence_of_sequences[3]>", line 1, in <module>
is_sequence_of_sequences([[1], [0, 2], []])
NameError: name 'is_sequence_of_sequences' is not defined
----------------------------------------------------------------------
File "/home/vagrant/venvs/venv3/lib/python3.3/site-packages/sklearn/utils/multiclass.py", line 169, in sklearn.utils.multiclass.is_sequence_of_sequences
Failed example:
is_sequence_of_sequences(np.array([[1], [0, 2], []], dtype=object))
Exception raised:
Traceback (most recent call last):
File "/usr/lib/python3.3/doctest.py", line 1287, in __run
compileflags, 1), test.globs)
File "<doctest sklearn.utils.multiclass.is_sequence_of_sequences[4]>", line 1, in <module>
is_sequence_of_sequences(np.array([[1], [0, 2], []], dtype=object))
NameError: name 'is_sequence_of_sequences' is not defined
----------------------------------------------------------------------
File "/home/vagrant/venvs/venv3/lib/python3.3/site-packages/sklearn/utils/multiclass.py", line 171, in sklearn.utils.multiclass.is_sequence_of_sequences
Failed example:
is_sequence_of_sequences([(1,), (0, 2), ()])
Exception raised:
Traceback (most recent call last):
File "/usr/lib/python3.3/doctest.py", line 1287, in __run
compileflags, 1), test.globs)
File "<doctest sklearn.utils.multiclass.is_sequence_of_sequences[5]>", line 1, in <module>
is_sequence_of_sequences([(1,), (0, 2), ()])
NameError: name 'is_sequence_of_sequences' is not defined
----------------------------------------------------------------------
File "/home/vagrant/venvs/venv3/lib/python3.3/site-packages/sklearn/utils/multiclass.py", line 173, in sklearn.utils.multiclass.is_sequence_of_sequences
Failed example:
is_sequence_of_sequences(np.array([[1, 0], [0, 0]]))
Exception raised:
Traceback (most recent call last):
File "/usr/lib/python3.3/doctest.py", line 1287, in __run
compileflags, 1), test.globs)
File "<doctest sklearn.utils.multiclass.is_sequence_of_sequences[6]>", line 1, in <module>
is_sequence_of_sequences(np.array([[1, 0], [0, 0]]))
NameError: name 'is_sequence_of_sequences' is not defined
----------------------------------------------------------------------
File "/home/vagrant/venvs/venv3/lib/python3.3/site-packages/sklearn/utils/multiclass.py", line 175, in sklearn.utils.multiclass.is_sequence_of_sequences
Failed example:
is_sequence_of_sequences(np.array([[1], [0], [0]]))
Exception raised:
Traceback (most recent call last):
File "/usr/lib/python3.3/doctest.py", line 1287, in __run
compileflags, 1), test.globs)
File "<doctest sklearn.utils.multiclass.is_sequence_of_sequences[7]>", line 1, in <module>
is_sequence_of_sequences(np.array([[1], [0], [0]]))
NameError: name 'is_sequence_of_sequences' is not defined
----------------------------------------------------------------------
File "/home/vagrant/venvs/venv3/lib/python3.3/site-packages/sklearn/utils/multiclass.py", line 177, in sklearn.utils.multiclass.is_sequence_of_sequences
Failed example:
is_sequence_of_sequences(np.array([[1, 0, 0]]))
Exception raised:
Traceback (most recent call last):
File "/usr/lib/python3.3/doctest.py", line 1287, in __run
compileflags, 1), test.globs)
File "<doctest sklearn.utils.multiclass.is_sequence_of_sequences[8]>", line 1, in <module>
is_sequence_of_sequences(np.array([[1, 0, 0]]))
NameError: name 'is_sequence_of_sequences' is not defined
======================================================================
FAIL: Doctest: sklearn.utils.multiclass.type_of_target
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python3.3/doctest.py", line 2154, in runTest
raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for sklearn.utils.multiclass.type_of_target
File "/home/vagrant/venvs/venv3/lib/python3.3/site-packages/sklearn/utils/multiclass.py", line 222, in type_of_target
----------------------------------------------------------------------
File "/home/vagrant/venvs/venv3/lib/python3.3/site-packages/sklearn/utils/multiclass.py", line 255, in sklearn.utils.multiclass.type_of_target
Failed example:
type_of_target([0.1, 0.6])
Exception raised:
Traceback (most recent call last):
File "/usr/lib/python3.3/doctest.py", line 1287, in __run
compileflags, 1), test.globs)
File "<doctest sklearn.utils.multiclass.type_of_target[1]>", line 1, in <module>
type_of_target([0.1, 0.6])
NameError: name 'type_of_target' is not defined
----------------------------------------------------------------------
File "/home/vagrant/venvs/venv3/lib/python3.3/site-packages/sklearn/utils/multiclass.py", line 257, in sklearn.utils.multiclass.type_of_target
Failed example:
type_of_target([1, -1, -1, 1])
Exception raised:
Traceback (most recent call last):
File "/usr/lib/python3.3/doctest.py", line 1287, in __run
compileflags, 1), test.globs)
File "<doctest sklearn.utils.multiclass.type_of_target[2]>", line 1, in <module>
type_of_target([1, -1, -1, 1])
NameError: name 'type_of_target' is not defined
----------------------------------------------------------------------
File "/home/vagrant/venvs/venv3/lib/python3.3/site-packages/sklearn/utils/multiclass.py", line 259, in sklearn.utils.multiclass.type_of_target
Failed example:
type_of_target(['a', 'b', 'a'])
Exception raised:
Traceback (most recent call last):
File "/usr/lib/python3.3/doctest.py", line 1287, in __run
compileflags, 1), test.globs)
File "<doctest sklearn.utils.multiclass.type_of_target[3]>", line 1, in <module>
type_of_target(['a', 'b', 'a'])
NameError: name 'type_of_target' is not defined
----------------------------------------------------------------------
File "/home/vagrant/venvs/venv3/lib/python3.3/site-packages/sklearn/utils/multiclass.py", line 261, in sklearn.utils.multiclass.type_of_target
Failed example:
type_of_target([1, 0, 2])
Exception raised:
Traceback (most recent call last):
File "/usr/lib/python3.3/doctest.py", line 1287, in __run
compileflags, 1), test.globs)
File "<doctest sklearn.utils.multiclass.type_of_target[4]>", line 1, in <module>
type_of_target([1, 0, 2])
NameError: name 'type_of_target' is not defined
----------------------------------------------------------------------
File "/home/vagrant/venvs/venv3/lib/python3.3/site-packages/sklearn/utils/multiclass.py", line 263, in sklearn.utils.multiclass.type_of_target
Failed example:
type_of_target(['a', 'b', 'c'])
Exception raised:
Traceback (most recent call last):
File "/usr/lib/python3.3/doctest.py", line 1287, in __run
compileflags, 1), test.globs)
File "<doctest sklearn.utils.multiclass.type_of_target[5]>", line 1, in <module>
type_of_target(['a', 'b', 'c'])
NameError: name 'type_of_target' is not defined
----------------------------------------------------------------------
File "/home/vagrant/venvs/venv3/lib/python3.3/site-packages/sklearn/utils/multiclass.py", line 265, in sklearn.utils.multiclass.type_of_target
Failed example:
type_of_target(np.array([[1, 2], [3, 1]]))
Exception raised:
Traceback (most recent call last):
File "/usr/lib/python3.3/doctest.py", line 1287, in __run
compileflags, 1), test.globs)
File "<doctest sklearn.utils.multiclass.type_of_target[6]>", line 1, in <module>
type_of_target(np.array([[1, 2], [3, 1]]))
NameError: name 'type_of_target' is not defined
----------------------------------------------------------------------
File "/home/vagrant/venvs/venv3/lib/python3.3/site-packages/sklearn/utils/multiclass.py", line 267, in sklearn.utils.multiclass.type_of_target
Failed example:
type_of_target(np.array([[1.5, 2.0], [3.0, 1.6]]))
Exception raised:
Traceback (most recent call last):
File "/usr/lib/python3.3/doctest.py", line 1287, in __run
compileflags, 1), test.globs)
File "<doctest sklearn.utils.multiclass.type_of_target[7]>", line 1, in <module>
type_of_target(np.array([[1.5, 2.0], [3.0, 1.6]]))
NameError: name 'type_of_target' is not defined
----------------------------------------------------------------------
File "/home/vagrant/venvs/venv3/lib/python3.3/site-packages/sklearn/utils/multiclass.py", line 269, in sklearn.utils.multiclass.type_of_target
Failed example:
type_of_target([['a', 'b'], ['c'], []])
Exception raised:
Traceback (most recent call last):
File "/usr/lib/python3.3/doctest.py", line 1287, in __run
compileflags, 1), test.globs)
File "<doctest sklearn.utils.multiclass.type_of_target[8]>", line 1, in <module>
type_of_target([['a', 'b'], ['c'], []])
NameError: name 'type_of_target' is not defined
----------------------------------------------------------------------
File "/home/vagrant/venvs/venv3/lib/python3.3/site-packages/sklearn/utils/multiclass.py", line 271, in sklearn.utils.multiclass.type_of_target
Failed example:
type_of_target([[]])
Exception raised:
Traceback (most recent call last):
File "/usr/lib/python3.3/doctest.py", line 1287, in __run
compileflags, 1), test.globs)
File "<doctest sklearn.utils.multiclass.type_of_target[9]>", line 1, in <module>
type_of_target([[]])
NameError: name 'type_of_target' is not defined
----------------------------------------------------------------------
File "/home/vagrant/venvs/venv3/lib/python3.3/site-packages/sklearn/utils/multiclass.py", line 273, in sklearn.utils.multiclass.type_of_target
Failed example:
type_of_target(np.array([[0, 1], [1, 1]]))
Exception raised:
Traceback (most recent call last):
File "/usr/lib/python3.3/doctest.py", line 1287, in __run
compileflags, 1), test.globs)
File "<doctest sklearn.utils.multiclass.type_of_target[10]>", line 1, in <module>
type_of_target(np.array([[0, 1], [1, 1]]))
NameError: name 'type_of_target' is not defined
----------------------------------------------------------------------
Ran 1847 tests in 84.359s
FAILED (SKIP=15, failures=8)
<nose.result.TextTestResult run=1847 errors=0 failures=8>
#!/usr/bin/bash
# Run me with:
# curl https://gist.github.com/ogrisel/6102848/raw/test_procedure.sh | bash
# Fail on first error
set -e
# Prepare a tarball from the release tag
git clone https://github.com/scikit-learn/scikit-learn.git scikit-learn-0.14.X
cd scikit-learn-0.14.X
git checkout 0.14.X
python setup.py sdist
cd .. # important leave the source folder before running the tests
# Install the package in a venv
virtualenv --system-site-packages scikit-learn-0.14.X-venv
source scikit-learn-0.14.X-venv/bin/activate
pip install scikit-learn-0.14.X/dist/scikit-learn-0.14a?.tar.gz
# Launch the tests from the installed pacakge
python -c "import sklearn; print(sklearn.__path__[0])"
python -c "import sklearn; sklearn.test()"
# Teardown the test environment
#deactivate
#rm -rf scikit-learn-0.14.X-venv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment