Commit Graph

21 Commits

Author SHA1 Message Date
Thomas J. Fan 82df48934e
MNT Applies black formatting to most of the code base (#18948) 2021-06-17 14:21:09 -04:00
Juan Carlos Alfaro Jiménez c4c0fe2ce4
FIX Specify C++11 compiler for sklearn/svm/_newrand (#17767) 2020-06-30 08:08:12 +10:00
Justin Huber 430c2080e8
TST Python wrapper and tests for sklearn/svm/newrand/ (#17157)
* Implemented issue #16862

* Implemented issue #16862

* Ready for pull request

* Cleaned up redundancies

* Removed test_set_seed_wrap for now

* Update sklearn/svm/tests/test_bounds.py

Co-authored-by: smarie <sylvain.marie@schneider-electric.com>

* Review feedback changes

* Style fixes

* np.quantile -> np.percentile

* Update sklearn/svm/src/newrand/newrand.h

Merged suggestion

Co-authored-by: smarie <sylvain.marie@schneider-electric.com>

* Update sklearn/svm/tests/test_bounds.py

Merge suggestions

Co-authored-by: smarie <sylvain.marie@schneider-electric.com>

* linting fix

* linting fix

* linting fix

* Added deterministic test for mt19937 in svm/newrand.h

* Linting fix

* Review changes

* Update sklearn/svm/tests/test_bounds.py

Co-authored-by: smarie <sylvain.marie@schneider-electric.com>

* Update sklearn/svm/tests/test_bounds.py

Co-authored-by: Joel Nothman <joel.nothman@gmail.com>

* Update sklearn/svm/tests/test_bounds.py

Co-authored-by: Joel Nothman <joel.nothman@gmail.com>

* Update test_bounds.py

* Linting fixes

Co-authored-by: smarie <sylvain.marie@schneider-electric.com>
Co-authored-by: Joel Nothman <joel.nothman@gmail.com>
2020-06-28 18:22:04 +02:00
smarie eaf0a044fd
FIX Libsvm and liblinear rand() fix for convergence on windows targets (and improvement on all targets) (#13511)
* Fixed random number generation on windows. See https://github.com/cjlin1/liblinear/pull/28

* Added correct PR number

* Fixed random number generator for libsvm on windows targets

* Updated comments

* Suppressed C4293 warnings using explicit cast.

* Suppressed C4293 warnings using explicit cast.

* Following code review: `myrand` is now inline, and all integer size checks for random generation fix are now static.

* Dummy comment edit to re-trigger build

* Fixed include error

* Attempt to provide a better and faster result by using a mersene twister random number generator as suggested by https://codeforces.com/blog/entry/61587

* Attempt to integrate the extra compiler arg requesting for explicit C++11 support

* Attempt to integrate the extra compiler arg requesting for explicit C++11 support. liblinear extension.

* the `extra_compile_args` for C++11 was not working when used in `config.add_extension` so now pre-creating liblinear library first with the flag.

* Fixed liblinear extension build: there was a missing library dependency.

* Fixed liblinear library dependency for extension compilation.

* Fixed liblinear library compilation: added tron

* Now correctly setting the seed in libsvm

* Now correctly setting the seed in liblinear. This is done using a new interface function `set_seed`.

* Updated what's new accordingly

* Increased tolerance when comparing `_average_precision` with `_average_precision_slow`. Indeed `_average_precision` is based on predictions ordering and has errors in case of ties (e.g. several 0.5 prediction values)

* Minor improvement of this test method for readability (no change in output)

* Minor doc update as per review

* dropped commented line

* Reverted test readability improvement change

* Using double barticks

* Clarified all comments

* removed useless space

* Clarified all comments, and included a `set_seed` method as per code review.

* Updated what's new about changed models as suggested by review.

* Replaced random number generator: now using a `bounded_rand_int` using tweaked Lemire post-processor from http://www.pcg-random.org/posts/bounded-rands.html)

* Updated readme rst and moved it to 0.22

* Whats new moved from 0.222 to 0.23

* Updated docs

* Update doc/whats_new/v0.23.rst

Co-Authored-By: Chiara Marmo <cmarmo@users.noreply.github.com>

* Dummy change to re-trigger the CI build

* Update doc/whats_new/v0.21.rst

* Update doc/whats_new/v0.21.rst

* Update doc/whats_new/v0.21.rst

* Update doc/whats_new/v0.21.rst

* Update doc/whats_new/v0.21.rst

* Update doc/whats_new/v0.21.rst

* Update doc/whats_new/v0.21.rst

* Update doc/whats_new/v0.21.rst

* Update doc/whats_new/v0.21.rst

* Update doc/whats_new/v0.21.rst

* Update doc/whats_new/v0.22.rst

* As per code review: added LogisticRegression in the list of changes, and repeated the list of classes affected in changelog.

* New random number generator used in libsvm / liblinear is now in an independent header file `newrand/newrand.h`.

* Update sklearn/svm/src/liblinear/linear.cpp

* Fixed dates in headers and added a header to newrand.h

* Added a sentence in the changelog to explain the impact in user-friendly terms.

* Added link to PR in readme file and removed commented lines as per code review

Co-authored-by: Sylvain MARIE <sylvain.marie@se.com>
Co-authored-by: Chiara Marmo <cmarmo@users.noreply.github.com>
2020-04-06 17:40:13 +02:00
Nicolas Hug 5c5635feb7 MNT make files private in sklearn.svm (#15165) 2019-10-18 16:18:33 -04:00
jeremiedbb 1ffd2d3be9 [MRG] MNT Cblas to scipy cython blas in liblinear and remove bundled cblas (#13203) 2019-02-21 19:44:05 +01:00
Loïc Estève 6a2d8d5bbc [MRG+2] BUILD Rewrite setup.py files to handle cython dependencies (#7719)
* Rewriting of cythonization in setup.py

By using Cython.Build.cythonize and switching between .c and .pyx files
as appropriate cython dependencies are correctly taken into account.

* Use cythonize once on the root config rather than in each subpackage

* Fix for Windows

* Remove caching from Travis

Cython dependencies are taken care of by Cython.Build.cythonize and
based on file timestamps, so .C and .so files will always be rebuild
from scratch on each build in Travis.

* Specify .pyx in setup.files for cython generated extensions

More natural this way. Tweak the extensions to generate from .c and .cpp
files for a release.

* COSMIT Remove commented out code

* Check cython version is greater than 0.23

* COSMIT better names for functions

* flake8 fix (imported module not at top of file)

* Install cython 0.23 for Python 2.6

now that cython >= 0.23 requirement is enforced in setup.py

* Use module constant for minimum required cython version

* Fix Travis install.sh

No easy way to put comments inside multi-line command
2016-11-02 22:57:04 +11:00
Andreas Mueller c7db70ac9f removed unused variables and imports, add used imports where missing. 2014-06-08 21:44:01 +02:00
Lars Buitinck bb5f643d0c MAINT use CBLAS instead of Fortran API in Liblinear
This saves code and lets Liblinear benefit from fast BLAS implementations
(ATLAS, OpenBLAS, MKL).
2014-03-20 16:07:48 +01:00
Olivier Grisel c95842de00 Use extra_link_args for -lstdc++ 2013-07-28 11:28:10 +02:00
Olivier Grisel 7271d53ff4 Force stdc++ link for the windows build 2013-07-28 10:37:01 +02:00
Stefano Lattarini 67ece78da4 COSMIT various typofixes
As suggested by codespell <https://github.com/lucasdemarchi/codespell>

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
2013-04-11 21:22:14 +02:00
Lars Buitinck b69fb64515 BUG last references to svm.sparse 2013-01-22 02:27:10 +01:00
GaelVaroquaux ed6164d413 MISC: cosmit: use subpackage setup.py 2012-02-03 07:30:16 +01:00
Lars Buitinck bc6255e8e7 ENH merge sparse and dense SVMs, part 1
* enable sparse matrix support in formerly dense versions
* remove DenseBaseLibSVM
* move sparse.libsvm to libsvm_sparse
2012-01-27 17:41:22 +01:00
Andreas Mueller 5c2a8696e3 COSMIT removed unused imports 2012-01-23 21:13:55 +01:00
Jake Vanderplas 7f53024ae9 remove unused imports 2011-12-23 09:27:40 -08:00
Andreas Mueller ff3f814a1b COSMIT pep8 whitespace 2011-11-20 21:16:52 +01:00
Fabian Pedregosa ddf4b72109 Move project directory from scikits.learn to sklearn 2011-09-02 12:06:57 +02:00
Fabian Pedregosa 68f27e3790 Revert "Move project directory from scikits.learn to sklearn"
This reverts commit fd0d3b879d.
2011-09-02 12:03:18 +02:00
Fabian Pedregosa fd0d3b879d Move project directory from scikits.learn to sklearn 2011-09-02 11:38:24 +02:00