Scalable, Portable and Distributed Gradient Boosting (GBDT, GBRT or GBM) Library, for Python, R, Java, Scala, C++ and more. Runs on single machine, Hadoop, Spark, Dask, Flink and DataFlow
The command to install xgboost if you are not installing from source
pip install xgboost --pre
scipy 0.18, numpy 1.11.2, scikit-learn 0.18
import xgboost as xgb
Throws attribute error for scipy
Here is what I get exactly when trying to import xgboost:
Python 2.7.9 (default, Jun 29 2016, 13:08:31)
Type "copyright", "credits" or "license" for more information.
IPython 5.1.0 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
In [1]: import xgboost as xgb
AttributeError Traceback (most recent call last)
in ()
----> 1 import xgboost as xgb
/home/candres/py2venv/local/lib/python2.7/site-packages/xgboost/__init__.py in ()
9 import os
10
---> 11 from .core import DMatrix, Booster
12 from .training import train, cv
13 from . import rabit # noqa
/home/candres/py2venv/local/lib/python2.7/site-packages/xgboost/core.py in ()
16 from .libpath import find_lib_path
17
---> 18 from .compat import STRING_TYPES, PY3, DataFrame, py_str, PANDAS_INSTALLED
19
20
/home/candres/py2venv/local/lib/python2.7/site-packages/xgboost/compat.py in ()
45 # sklearn
46 try:
---> 47 from sklearn.base import BaseEstimator
48 from sklearn.base import RegressorMixin, ClassifierMixin
49 from sklearn.preprocessing import LabelEncoder # noqa
/usr/lib/python2.7/dist-packages/sklearn/__init__.py in ()
55 else:
56 from . import __check_build
---> 57 from .base import clone
58 __check_build # avoid flakes unused variable error
59
/usr/lib/python2.7/dist-packages/sklearn/base.py in ()
10 from scipy import sparse
11 from .externals import six
---> 12 from .utils.fixes import signature
13 from .utils.deprecation import deprecated
14 from .exceptions import ChangedBehaviorWarning as _ChangedBehaviorWarning
/usr/lib/python2.7/dist-packages/sklearn/utils/__init__.py in ()
9
10 from .murmurhash import murmurhash3_32
---> 11 from .validation import (as_float_array,
12 assert_all_finite,
13 check_random_state, column_or_1d, check_array,
/usr/lib/python2.7/dist-packages/sklearn/utils/validation.py in ()
16
17 from ..externals import six
---> 18 from ..utils.fixes import signature
19 from .deprecation import deprecated
20 from ..exceptions import DataConversionWarning as _DataConversionWarning
/usr/lib/python2.7/dist-packages/sklearn/utils/fixes.py in ()
43
44 try:
---> 45 from scipy.special import expit # SciPy >= 0.10
46 with np.errstate(invalid='ignore', over='ignore'):
47 if np.isnan(expit(1000)): # SciPy < 0.14
/usr/lib/python2.7/dist-packages/scipy/special/__init__.py in ()
641 from .orthogonal import *
642 from .spfun_stats import multigammaln
--> 643 from ._ellip_harm import ellip_harm, ellip_harm_2, ellip_normal
644 from .lambertw import lambertw
645 from ._spherical_bessel import (spherical_jn, spherical_yn, spherical_in,
/usr/lib/python2.7/dist-packages/scipy/special/_ellip_harm.py in ()
5
6 from ._ufuncs import _ellip_harm
----> 7 from ._ellip_harm_2 import _ellipsoid, _ellipsoid_norm
8
9
scipy/special/_ellip_harm_2.pyx in init scipy.special._ellip_harm_2 (scipy/special/_ellip_harm_2.c:7330)()
/usr/lib/python2.7/dist-packages/scipy/integrate/__init__.py in ()
57 from .quadpack import *
58 from ._ode import *
---> 59 from ._bvp import solve_bvp
60
61 __all__ = [s for s in dir() if not s.startswith('_')]
/usr/lib/python2.7/dist-packages/scipy/integrate/_bvp.py in ()
8
9 from scipy.sparse import coo_matrix, csc_matrix
---> 10 from scipy.sparse.linalg import splu
11 from scipy.optimize import OptimizeResult
12
/usr/lib/python2.7/dist-packages/scipy/sparse/linalg/__init__.py in ()
110 from __future__ import division, print_function, absolute_import
111
--> 112 from .isolve import *
113 from .dsolve import *
114 from .interface import *
/usr/lib/python2.7/dist-packages/scipy/sparse/linalg/isolve/__init__.py in ()
4
5 #from info import __doc__
----> 6 from .iterative import *
7 from .minres import minres
8 from .lgmres import lgmres
/usr/lib/python2.7/dist-packages/scipy/sparse/linalg/isolve/iterative.py in ()
82 '``Ax`` and ``A^T x``.')
83 @non_reentrant()
---> 84 def bicg(A, b, x0=None, tol=1e-5, maxiter=None, xtype=None, M=None, callback=None):
85 A,M,x,b,postprocess = make_system(A,M,x0,b,xtype)
86
/usr/lib/python2.7/dist-packages/scipy/_lib/_threadsafety.pyc in decorator(func)
57 msg = "%s is not re-entrant" % func.__name__
58 lock = ReentrancyLock(msg)
---> 59 return lock.decorate(func)
60 return decorator
/usr/lib/python2.7/dist-packages/scipy/_lib/_threadsafety.pyc in decorate(self, func)
45 with self:
46 return func(*a, **kw)
---> 47 return scipy._lib.decorator.decorate(func, caller)
48
49
AttributeError: 'module' object has no attribute 'decorate'
Environment info
Operating System: Debian GNU/Linux 8.x (jessie)
Compiler: g++ 4.9.2
Package used (python/R/jvm/C++): Python
xgboost
version used: 0.6a2If you are using python package, please provide
The python version and distribution Python 2.7.9
The command to install
xgboost
if you are not installing from source pip install xgboost --prescipy 0.18, numpy 1.11.2, scikit-learn 0.18
import xgboost as xgb
Throws attribute error for scipy
Here is what I get exactly when trying to import xgboost:
Python 2.7.9 (default, Jun 29 2016, 13:08:31) Type "copyright", "credits" or "license" for more information.
IPython 5.1.0 -- An enhanced Interactive Python. ? -> Introduction and overview of IPython's features. %quickref -> Quick reference. help -> Python's own help system. object? -> Details about 'object', use 'object??' for extra details.
In [1]: import xgboost as xgb
AttributeError Traceback (most recent call last)