diff options
author | 2012-11-30 00:25:42 +0000 | |
---|---|---|
committer | 2012-11-30 00:25:42 +0000 | |
commit | dd3f4a736a8149c015ec088857d05f5e3b3c8e6d (patch) | |
tree | 9d7297c6a04adbb816e378072f5354a7218e5825 /sci-libs/scikits_learn | |
parent | 3.6.2 version bump. This fixes bug #442190. (diff) | |
download | gentoo-2-dd3f4a736a8149c015ec088857d05f5e3b3c8e6d.tar.gz gentoo-2-dd3f4a736a8149c015ec088857d05f5e3b3c8e6d.tar.bz2 gentoo-2-dd3f4a736a8149c015ec088857d05f5e3b3c8e6d.zip |
Version bump
(Portage version: 2.2.01.21313-prefix/cvs/Linux x86_64, signed Manifest commit with key 0x13CB1360)
Diffstat (limited to 'sci-libs/scikits_learn')
-rw-r--r-- | sci-libs/scikits_learn/ChangeLog | 9 | ||||
-rw-r--r-- | sci-libs/scikits_learn/files/0.12.1-linalg.patch | 29 | ||||
-rw-r--r-- | sci-libs/scikits_learn/scikits_learn-0.12.1.ebuild | 79 |
3 files changed, 115 insertions, 2 deletions
diff --git a/sci-libs/scikits_learn/ChangeLog b/sci-libs/scikits_learn/ChangeLog index 3a0aa4d8183d..a7a388c326e7 100644 --- a/sci-libs/scikits_learn/ChangeLog +++ b/sci-libs/scikits_learn/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for sci-libs/scikits_learn # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sci-libs/scikits_learn/ChangeLog,v 1.13 2012/06/21 19:17:13 bicatali Exp $ +# $Header: /var/cvsroot/gentoo-x86/sci-libs/scikits_learn/ChangeLog,v 1.14 2012/11/30 00:25:42 bicatali Exp $ + +*scikits_learn-0.12.1 (30 Nov 2012) + + 30 Nov 2012; Sébastien Fabbro <bicatali@gentoo.org> + +files/0.12.1-linalg.patch, +scikits_learn-0.12.1.ebuild: + Version bump 21 Jun 2012; Sébastien Fabbro <bicatali@gentoo.org> -scikits_learn-0.10-r1.ebuild, scikits_learn-0.11.ebuild: @@ -101,4 +107,3 @@ 26 Mar 2010; Sébastien Fabbro <bicatali@gentoo.org> +scikits_learn-0.2.ebuild, +metadata.xml: Initial import - diff --git a/sci-libs/scikits_learn/files/0.12.1-linalg.patch b/sci-libs/scikits_learn/files/0.12.1-linalg.patch new file mode 100644 index 000000000000..ca113ffe6416 --- /dev/null +++ b/sci-libs/scikits_learn/files/0.12.1-linalg.patch @@ -0,0 +1,29 @@ +--- a/sklearn/linear_model/least_angle.py ++++ b/sklearn/linear_model/least_angle.py +@@ -236,8 +236,8 @@ def lars_path(X, y, Xy=None, Gram=None, + L_.flat[::n_active + 1] += (2 ** i) * eps + least_squares, info = solve_cholesky(L_, + sign_active[:n_active], lower=True) +- AA = 1. / np.sqrt(np.sum(least_squares +- * sign_active[:n_active])) ++ tmp = max(np.sum(least_squares * sign_active[:n_active]), eps) ++ AA = 1. / np.sqrt(tmp) + i += 1 + least_squares *= AA + +--- a/sklearn/linear_model/tests/test_least_angle.py ++++ b/sklearn/linear_model/tests/test_least_angle.py +@@ -101,6 +101,13 @@ def test_collinearity(): + assert_true(not np.isnan(coef_path_).any()) + residual = np.dot(X, coef_path_[:, -1]) - y + assert_less((residual ** 2).sum(), 1.) # just make sure it's bounded ++ ++ n_samples = 10 ++ X = np.random.rand(n_samples, 5) ++ y = np.zeros(n_samples) ++ _, _, coef_path_ = linear_model.lars_path(X, y, Gram='auto', copy_X=False, ++ copy_Gram=False, alpha_min=0., method='lasso', verbose=0, max_iter=500) ++ assert_array_almost_equal(coef_path_, np.zeros_like(coef_path_)) + + + def test_no_path(): diff --git a/sci-libs/scikits_learn/scikits_learn-0.12.1.ebuild b/sci-libs/scikits_learn/scikits_learn-0.12.1.ebuild new file mode 100644 index 000000000000..0e2c3fac912c --- /dev/null +++ b/sci-libs/scikits_learn/scikits_learn-0.12.1.ebuild @@ -0,0 +1,79 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sci-libs/scikits_learn/scikits_learn-0.12.1.ebuild,v 1.1 2012/11/30 00:25:42 bicatali Exp $ + +EAPI=4 + +PYTHON_DEPEND="2" +SUPPORT_PYTHON_ABIS="1" +RESTRICT_PYTHON_ABIS="2.7-pypy-*" + +inherit distutils multilib flag-o-matic + +MYPN="${PN/scikits_/scikit-}" + +DESCRIPTION="Python modules for machine learning and data mining" +HOMEPAGE="http://scikit-learn.org" +SRC_URI="mirror://sourceforge/${MYPN}/${MYPN}-${PV}.tar.gz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux" +IUSE="doc examples" + +RDEPEND=" + sci-libs/scikits + sci-libs/scipy + dev-python/matplotlib" +DEPEND=" + dev-python/cython + dev-python/setuptools + sci-libs/scipy + doc? ( dev-python/sphinx dev-python/matplotlib )" + +S="${WORKDIR}/${MYPN}-${PV}" + +src_prepare() { + epatch "${FILESDIR}"/0.12.1-linalg.patch + + # bug #397605 + [[ ${CHOST} == *-darwin* ]] \ + && append-ldflags -bundle "-undefined dynamic_lookup" \ + || append-ldflags -shared + + # scikits-learn now uses the horrible numpy.distutils automagic + export SCIPY_FCONFIG="config_fc --noopt --noarch" +} + +src_compile() { + distutils_src_compile ${SCIPY_FCONFIG} + if use doc; then + cd "${S}/doc" + local d=$(ls -d "${S}"/build-$(PYTHON -f --ABI)/lib*) + ln -s "${S}"/sklearn/datasets/{data,descr,images} \ + "${d}"/sklearn/datasets + VARTEXFONTS="${T}"/fonts \ + MPLCONFIGDIR="${S}/build-$(PYTHON -f --ABI)" \ + PYTHONPATH="${d}" \ + emake html + rm -r "${d}"/sklearn/datasets/{data,desr,images} + fi +} + +src_test() { + # doc builds and runs tests + use doc && return + testing() { + "$(PYTHON)" setup.py build_ext --inplace ${SCIPY_FCONFIG} || die + PYTHONPATH=. nosetests sklearn --exe || die + } + python_execute_function testing +} + +src_install() { + find "${S}" -name \*LICENSE.txt -delete + distutils_src_install ${SCIPY_FCONFIG} + insinto /usr/share/doc/${PF} + use doc && dohtml -r doc/_build/html + use examples && doins -r examples +} |