Skip to content

Commit d0666e4

Browse files
author
fabianegli
committed
rebased to current master
2 parents 1f7c367 + b01c8c4 commit d0666e4

177 files changed

Lines changed: 3035 additions & 1539 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ scikit_learn.egg-info/
2323
.coverage
2424
coverage
2525
*.py,cover
26-
.tags
26+
.tags*
2727
tags
2828
covtype.data.gz
2929
20news-18828/

.mailmap

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
Alexandre Gramfort <alexandre.gramfort@inria.fr> <alexandre.gramfort@gmail.com>
22
Alexandre Gramfort <alexandre.gramfort@inria.fr> <alexandre.gramfort@m4x.org>
33
Alexandre Gramfort <alexandre.gramfort@inria.fr> <gramfort@localhost.(none)>
4+
Alexandre Saint <snt.alex@gmail.com>
45
Andreas Mueller <amueller@ais.uni-bonn.de>
56
Andreas Mueller <amueller@ais.uni-bonn.de> <Andreas Mueller@MSRC-3645211.europe.corp.microsoft.com>
67
Andreas Mueller <amueller@ais.uni-bonn.de> <amueller@ais.uni-bonn.de>
@@ -42,12 +43,16 @@ Federico Vaggi <vaggi.federico@gmail.com> <vaggi.federico@GMAIL.COM>
4243
Gael Varoquaux <gael.varoquaux@inria.fr>
4344
Gael Varoquaux <gael.varoquaux@inria.fr> <gael.varoquaux@normalesup.org>
4445
Gael Varoquaux <gael.varoquaux@inria.fr> <varoquau@normalesup.org>
46+
Giorgio Patrini <giorgio.patrini@nicta.com.au>
47+
Giorgio Patrini <giorgio.patrini@nicta.com.au> <giorgiop@users.noreply.github.com>
4548
Gilles Louppe <g.louppe@gmail.com> <g.louppe@ulg.ac.be>
4649
Hamzeh Alsalhi <93hamsal@gmail.com>
4750
Harikrishnan S <hihari777@gmail.com>
4851
Hendrik Heuer <hendrikheuer@gmail.com>
4952
Henry Lin <hlin117@gmail.com>
5053
Hrishikesh Huilgolkar <hrishikesh911@gmail.com> <hrishikesh@QE-IND-WKS007.(none)>
54+
Hugo Bowne-Anderson <hugobowne@gmail.com>
55+
Imaculate <imaculatemosha@yahoo.com>
5156
Immanuel Bayer <mane.desk@gmail.com>
5257
Jacob Schreiber <jmschreiber91@gmail.com>
5358
Jacob Schreiber <jmschreiber91@gmail.com> <jmschr@cs.washington.edu>
@@ -79,6 +84,7 @@ Sergio Medina <sergio.medina@inria.fr> <smedina@work4labs.com>
7984
Nelle Varoquaux <nelle.varoquaux@gmail.com>
8085
Nelle Varoquaux <nelle.varoquaux@gmail.com> <nelle@phgroup.com>
8186
Nelle Varoquaux <nelle.varoquaux@gmail.com> <nelle@varoquaux@gmail.com>
87+
Nicolas Goix <goix.nicolas@gmail.com>
8288
Nicolas Pinto <pinto@alum.mit.edu> <pinto@mit.edu>
8389
Noel Dawe <Noel.Dawe@cern.ch> <noel.dawe@gmail.com>
8490
Noel Dawe <Noel.Dawe@cern.ch> <noel.dAwe@cern.ch>
@@ -87,11 +93,14 @@ Olivier Grisel <olivier.grisel@ensta.org> <olivier.grisel@ensta.org>
8793
Olivier Hervieu <olivier.hervieu@gmail.com> <olivier.hervieu@tinyclues.com>
8894
Paul Butler <paulgb@gmail.com>
8995
Peter Prettenhofer <peter.prettenhofer@gmail.com>
96+
Raghav R V <rvraghav93@gmail.com>
9097
Robert Layton <robertlayton@gmail.com>
9198
Roman Sinayev <roman.sinayev@gmail.com>
9299
Roman Sinayev <roman.sinayev@gmail.com> <roman@y570.(none)>
93100
Ronald Phlypo <Ronald.Phlypo@inria.fr>
94101
Satrajit Ghosh <satra@mit.edu> <satrajit.ghosh@gmail.com>
102+
Sebastian Raschka <se.raschka@me.com>
103+
Sebastian Raschka <mail@sebastianraschka.com> <se.raschka@me.com>
95104
Shiqiao Du <lucidfrontier.45@gmail.com>
96105
Shiqiao Du <lucidfrontier.45@gmail.com> <s.du@freebit.net>
97106
Thomas Unterthiner <thomas.unterthiner@gmx.net>

.travis.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,10 @@ env:
3939
NUMPY_VERSION="1.6.2" SCIPY_VERSION="0.11.0" CYTHON_VERSION="0.21"
4040
CACHED_BUILD_DIR="$HOME/sklearn_build_oldest"
4141
# This environment tests the newest supported anaconda env
42+
# It also runs tests requiring Pandas.
4243
- DISTRIB="conda" PYTHON_VERSION="3.5" INSTALL_MKL="true"
43-
NUMPY_VERSION="1.10.4" SCIPY_VERSION="0.17.0" CYTHON_VERSION="0.23.4"
44-
CACHED_BUILD_DIR="$HOME/sklearn_build_latest"
44+
NUMPY_VERSION="1.10.4" SCIPY_VERSION="0.17.0" PANDAS_VERSION="0.18.0"
45+
CYTHON_VERSION="0.23.4" CACHED_BUILD_DIR="$HOME/sklearn_build_latest"
4546
# flake8 linting on diff wrt common ancestor with upstream/master
4647
- RUN_FLAKE8="true" SKIP_TESTS="true"
4748
DISTRIB="conda" PYTHON_VERSION="3.5" INSTALL_MKL="true"

README.rst

Lines changed: 72 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
.. -*- mode: rst -*-
2-
32
|Travis|_ |AppVeyor|_ |Coveralls|_ |CircleCI|_ |Python27|_ |Python35|_ |PyPi|_ |DOI|_
43

54
.. |Travis| image:: https://api.travis-ci.org/scikit-learn/scikit-learn.svg?branch=master
@@ -23,11 +22,9 @@
2322
.. |PyPi| image:: https://badge.fury.io/py/scikit-learn.svg
2423
.. _PyPi: https://badge.fury.io/py/scikit-learn
2524

26-
2725
.. |DOI| image:: https://zenodo.org/badge/21369/scikit-learn/scikit-learn.svg
2826
.. _DOI: https://zenodo.org/badge/latestdoi/21369/scikit-learn/scikit-learn
2927

30-
3128
scikit-learn
3229
============
3330

@@ -40,36 +37,19 @@ the `AUTHORS.rst <AUTHORS.rst>`_ file for a complete list of contributors.
4037

4138
It is currently maintained by a team of volunteers.
4239

43-
**Note** `scikit-learn` was previously referred to as `scikits.learn`.
44-
45-
46-
Important links
47-
===============
40+
Website: http://scikit-learn.org
4841

49-
- Official source code repo: https://github.com/scikit-learn/scikit-learn
50-
- HTML documentation (stable release): http://scikit-learn.org
51-
- HTML documentation (development version): http://scikit-learn.org/dev/
52-
- Download releases: http://sourceforge.net/projects/scikit-learn/files/
53-
- Issue tracker: https://github.com/scikit-learn/scikit-learn/issues
54-
- Mailing list: https://lists.sourceforge.net/lists/listinfo/scikit-learn-general
55-
- IRC channel: ``#scikit-learn`` at ``irc.freenode.net``
42+
Installation
43+
------------
5644

5745
Dependencies
58-
============
59-
60-
scikit-learn is tested to work under Python 2.6, Python 2.7, and Python 3.5.
61-
(using the same codebase thanks to an embedded copy of
62-
`six <http://pythonhosted.org/six/>`_). It should also work with Python 3.3 and 3.4.
63-
64-
The required dependencies to build the software are NumPy >= 1.6.1,
65-
SciPy >= 0.9 and a working C/C++ compiler. For the development version,
66-
you will also require Cython >=0.23.
46+
~~~~~~~~~~~~
6747

68-
For running the examples Matplotlib >= 1.1.1 is required and for running the
69-
tests you need nose >= 1.1.2.
48+
Scikit-learn requires::
7049

71-
This configuration matches the Ubuntu Precise 12.04 LTS release from April
72-
2012.
50+
- Python (>= 2.6 or >= 3.3),
51+
- NumPy (>= 1.6.1),
52+
- SciPy (>= 0.9).
7353

7454
scikit-learn also uses CBLAS, the C interface to the Basic Linear Algebra
7555
Subprograms library. scikit-learn comes with a reference implementation, but
@@ -78,50 +58,52 @@ CBLAS exists in many implementations; see `Linear algebra libraries
7858
<http://scikit-learn.org/stable/modules/computational_performance.html#linear-algebra-libraries>`_
7959
for known issues.
8060

61+
User installation
62+
~~~~~~~~~~~~~~~~~
8163

82-
Install
83-
=======
64+
If you already have a working installation of numpy and scipy,
65+
the easiest way to install scikit-learn is using ``pip`` ::
8466

85-
This package uses distutils, which is the default way of installing
86-
python modules. To install in your home directory, use::
67+
pip install -U scikit-learn
8768

88-
python setup.py install --user
69+
or ``conda``::
8970

90-
To install for all users on Unix/Linux::
71+
conda install scikit-learn
9172

92-
python setup.py build
93-
sudo python setup.py install
73+
The documentation includes more detailed `installation instructions <http://scikit-learn.org/stable/install.html>`_.
9474

95-
For more detailed installation instructions,
96-
see the web page http://scikit-learn.org/stable/install.html
9775

9876
Development
99-
===========
77+
-----------
10078

101-
Code
102-
----
79+
We welcome new contributors of all experience levels. The scikit-learn
80+
community goals are to be helpful, welcoming, and effective. The
81+
`Contributor's Guide <http://scikit-learn.org/stable/developers/index.html>`_
82+
has detailed information about contributing code, documentation, tests, and
83+
more. We've included some basic information in this README.
10384

104-
GIT
105-
~~~
85+
Important links
86+
~~~~~~~~~~~~~~~
87+
88+
- Official source code repo: https://github.com/scikit-learn/scikit-learn
89+
- Download releases: http://sourceforge.net/projects/scikit-learn/files/
90+
- Issue tracker: https://github.com/scikit-learn/scikit-learn/issues
91+
92+
Source code
93+
~~~~~~~~~~~
10694

10795
You can check the latest sources with the command::
10896

10997
git clone https://github.com/scikit-learn/scikit-learn.git
11098

111-
112-
Contributing
113-
~~~~~~~~~~~~
99+
Setting up a development environment
100+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
114101

115102
Quick tutorial on how to go about setting up your environment to
116103
contribute to scikit-learn: https://github.com/scikit-learn/scikit-learn/blob/master/CONTRIBUTING.md
117104

118-
Before opening a Pull Request, have a look at the
119-
full Contributing page to make sure your code complies
120-
with our guidelines: http://scikit-learn.org/stable/developers/index.html
121-
122-
123105
Testing
124-
-------
106+
~~~~~~~
125107

126108
After installation, you can launch the test suite from outside the
127109
source directory (you will need to have the ``nose`` package installed)::
@@ -139,3 +121,41 @@ for more information.
139121

140122
Random number generation can be controlled during testing by setting
141123
the ``SKLEARN_SEED`` environment variable.
124+
125+
Submitting a Pull Request
126+
~~~~~~~~~~~~~~~~~~~~~~~~~
127+
128+
Before opening a Pull Request, have a look at the
129+
full Contributing page to make sure your code complies
130+
with our guidelines: http://scikit-learn.org/stable/developers/index.html
131+
132+
133+
Project history
134+
---------------
135+
136+
The project was started in 2007 by David Cournapeau as a Google Summer
137+
of Code project, and since then many volunteers have contributed. See
138+
the AUTHORS.rst file for a complete list of contributors.
139+
140+
The project is currently maintained by a team of volunteers.
141+
142+
**Note** `scikit-learn` was previously referred to as `scikits.learn`.
143+
144+
145+
Help and Support
146+
----------------
147+
148+
Documentation
149+
~~~~~~~~~~~~~
150+
151+
- HTML documentation (stable release): http://scikit-learn.org
152+
- HTML documentation (development version): http://scikit-learn.org/dev/
153+
- FAQ: http://scikit-learn.org/stable/faq.html
154+
155+
Communication
156+
~~~~~~~~~~~~~
157+
158+
- Mailing list: https://mail.python.org/mailman/listinfo/scikit-learn
159+
- IRC channel: ``#scikit-learn`` at ``irc.freenode.net``
160+
- Stack Overflow: http://stackoverflow.com/questions/tagged/scikit-learn
161+
- Website: http://scikit-learn.org

build_tools/circle/push_doc.sh

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,30 @@ fi
1212

1313
DOC_REPO="scikit-learn.github.io"
1414

15-
MSG="Pushing the docs for revision for branch: $CIRCLE_BRANCH, commit $CIRCLE_SHA1"
15+
if [ "$CIRCLE_BRANCH" = "master" ]
16+
then
17+
dir=dev
18+
else
19+
# Strip off .X
20+
dir="${CIRCLE_BRANCH::-2}"
21+
fi
22+
23+
MSG="Pushing the docs to $dir/ for branch: $CIRCLE_BRANCH, commit $CIRCLE_SHA1"
1624

1725
cd $HOME
1826
if [ ! -d $DOC_REPO ];
1927
then git clone "git@github.com:scikit-learn/"$DOC_REPO".git";
2028
fi
2129
cd $DOC_REPO
22-
git checkout master
23-
git reset --hard origin/master
24-
git rm -rf dev/ && rm -rf dev/
25-
cp -R $HOME/scikit-learn/doc/_build/html/stable dev
30+
git checkout $CIRCLE_BRANCH
31+
git reset --hard origin/$CIRCLE_BRANCH
32+
git rm -rf $dir/ && rm -rf $dir/
33+
cp -R $HOME/scikit-learn/doc/_build/html/stable $dir
2634
git config --global user.email "olivier.grisel+sklearn-ci@gmail.com"
2735
git config --global user.name $USERNAME
2836
git config --global push.default matching
29-
git add -f dev/
30-
git commit -m "$MSG" dev
37+
git add -f $dir/
38+
git commit -m "$MSG" $dir
3139
git push
3240

3341
echo $MSG

build_tools/travis/flake8_diff.sh

Lines changed: 41 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ set -o pipefail
2020
PROJECT=scikit-learn/scikit-learn
2121
PROJECT_URL=https://github.com/$PROJECT.git
2222

23-
echo "Remotes:"
24-
git remote --verbose
25-
2623
# Find the remote with the project name (upstream in most cases)
2724
REMOTE=$(git remote -v | grep $PROJECT | cut -f1 | head -1 || echo '')
2825

@@ -35,6 +32,19 @@ if [[ -z "$REMOTE" ]]; then
3532
git remote add $REMOTE $PROJECT_URL
3633
fi
3734

35+
echo "Remotes:"
36+
echo '--------------------------------------------------------------------------------'
37+
git remote --verbose
38+
39+
# Travis does the git clone with a limited depth (50 at the time of
40+
# writing). This may not be enough to find the common ancestor with
41+
# $REMOTE/master so we unshallow the git checkout
42+
if [[ -a .git/shallow ]]; then
43+
echo -e '\nTrying to unshallow the repo:'
44+
echo '--------------------------------------------------------------------------------'
45+
git fetch --unshallow
46+
fi
47+
3848
if [[ "$TRAVIS" == "true" ]]; then
3949
if [[ "$TRAVIS_PULL_REQUEST" == "false" ]]
4050
then
@@ -46,50 +56,54 @@ if [[ "$TRAVIS" == "true" ]]; then
4656
exit 0
4757
fi
4858
COMMIT_RANGE=$TRAVIS_COMMIT_RANGE
49-
else
50-
# Travis does the git clone with a limited depth (50 at the time of
51-
# writing). This may not be enough to find the common ancestor with
52-
# $REMOTE/master so we unshallow the git checkout
53-
git fetch --unshallow || echo "Unshallowing the git checkout failed"
5459
fi
5560
else
5661
# We want to fetch the code as it is in the PR branch and not
5762
# the result of the merge into master. This way line numbers
5863
# reported by Travis will match with the local code.
59-
BRANCH_NAME=travis_pr_$TRAVIS_PULL_REQUEST
60-
git fetch $REMOTE pull/$TRAVIS_PULL_REQUEST/head:$BRANCH_NAME
61-
git checkout $BRANCH_NAME
64+
LOCAL_BRANCH_REF=travis_pr_$TRAVIS_PULL_REQUEST
65+
# In Travis the PR target is always origin
66+
git fetch origin pull/$TRAVIS_PULL_REQUEST/head:refs/$LOCAL_BRANCH_REF
6267
fi
6368
fi
6469

65-
66-
echo -e '\nLast 2 commits:'
67-
echo '--------------------------------------------------------------------------------'
68-
git log -2 --pretty=short
69-
7070
# If not using the commit range from Travis we need to find the common
71-
# ancestor between HEAD and $REMOTE/master
71+
# ancestor between $LOCAL_BRANCH_REF and $REMOTE/master
7272
if [[ -z "$COMMIT_RANGE" ]]; then
73+
if [[ -z "$LOCAL_BRANCH_REF" ]]; then
74+
LOCAL_BRANCH_REF=$(git rev-parse --abbrev-ref HEAD)
75+
fi
76+
echo -e "\nLast 2 commits in $LOCAL_BRANCH_REF:"
77+
echo '--------------------------------------------------------------------------------'
78+
git log -2 $LOCAL_BRANCH_REF
79+
7380
REMOTE_MASTER_REF="$REMOTE/master"
7481
# Make sure that $REMOTE_MASTER_REF is a valid reference
75-
git fetch $REMOTE master:refs/$REMOTE_MASTER_REF
82+
echo -e "\nFetching $REMOTE_MASTER_REF"
83+
echo '--------------------------------------------------------------------------------'
84+
git fetch $REMOTE master:refs/remotes/$REMOTE_MASTER_REF
85+
LOCAL_BRANCH_SHORT_HASH=$(git rev-parse --short $LOCAL_BRANCH_REF)
86+
REMOTE_MASTER_SHORT_HASH=$(git rev-parse --short $REMOTE_MASTER_REF)
7687

77-
COMMIT=$(git merge-base @ $REMOTE_MASTER_REF) || \
78-
echo "No common ancestor found for $(git show @ -q) and $(git show $REMOTE_MASTER_REF -q)"
79-
80-
if [[ -n "$TMP_REMOTE" ]]; then
81-
git remote remove $TMP_REMOTE
82-
fi
88+
COMMIT=$(git merge-base $LOCAL_BRANCH_REF $REMOTE_MASTER_REF) || \
89+
echo "No common ancestor found for $(git show $LOCAL_BRANCH_REF -q) and $(git show $REMOTE_MASTER_REF -q)"
8390

8491
if [ -z "$COMMIT" ]; then
8592
exit 1
8693
fi
8794

88-
echo -e "\nCommon ancestor between HEAD and $REMOTE_MASTER_REF is:"
95+
COMMIT_SHORT_HASH=$(git rev-parse --short $COMMIT)
96+
97+
echo -e "\nCommon ancestor between $LOCAL_BRANCH_REF ($LOCAL_BRANCH_SHORT_HASH)"\
98+
"and $REMOTE_MASTER_REF ($REMOTE_MASTER_SHORT_HASH) is $COMMIT_SHORT_HASH:"
8999
echo '--------------------------------------------------------------------------------'
90-
git show --no-patch $COMMIT
100+
git show --no-patch $COMMIT_SHORT_HASH
101+
102+
COMMIT_RANGE="$COMMIT_SHORT_HASH..$LOCAL_BRANCH_SHORT_HASH"
91103

92-
COMMIT_RANGE="$(git rev-parse --short $COMMIT)..$(git rev-parse --short @)"
104+
if [[ -n "$TMP_REMOTE" ]]; then
105+
git remote remove $TMP_REMOTE
106+
fi
93107

94108
else
95109
echo "Got the commit range from Travis: $COMMIT_RANGE"

0 commit comments

Comments
 (0)