Commit Graph

90 Commits

Author SHA1 Message Date
Yu Feng d73822f84f
DOC Add notes about the location of function body. (#20095) 2021-05-16 09:49:42 -04: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
jim0421 d5de894284
ENH scipy blas for svm kernel function (#16530) 2020-05-23 21:12:34 -04:00
smarie 7736062aae
DOC Libsvm liblinear rand fix - minor doc and header fixes (#16979) 2020-04-21 22:06:07 +10: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
Brian Wignall 0e10b3a3cb DOC Fix typos, via a Levenshtein-style corrector (#15923) 2019-12-19 16:26:02 -08:00
Thomas J Fan 2151b79a91 FIX Releases memory in liblinear (#15687) 2019-11-21 11:54:50 +01:00
Guillaume Lemaitre 2b60d32977 MAINT sync/add support sample_weight with liblinear (#15038) 2019-10-25 08:38:19 -04:00
alexshacked d6d1d63fa6 FIX Negative or null sample_weights in SVM (#14286) 2019-09-25 09:21:00 +10:00
Alex Henrie b7b0ba6a3c MAINT Simplify liblinear helpers set_problem and csr_set_probl… (#14533) 2019-08-01 09:23:23 +02:00
Alex Henrie 583e18fc46 PERF Support converting 32-bit matrices directly to liblinear format (#14296) 2019-07-31 13:13:28 +02:00
Alex Henrie 73b4898e51 MAINT Pass liblinear X dimensions around as plain ints (#14276) 2019-07-08 12:01:20 -05:00
Alex Henrie 0f7e470f6f PERF Only call malloc twice in liblinear to_sparse helpers (#14170) 2019-07-05 10:46:00 +02:00
Alex Henrie cf2e60bc1b MAINT Simplify arguments to csr_set_problem and csr_to_sparse (#14135) 2019-06-20 18:49:01 -07:00
Alex Henrie 8632775c23 FIX Fix memory leak in liblinear helper csr_to_sparse error path (#14118) 2019-06-20 10:43:54 +10:00
Alex Henrie 7ce8b21cd1 PERF Don't allocate space for bias element if there isn't one (#14108) 2019-06-18 09:32:58 -07:00
Alex Henrie b7c4163690 FIX Fix off-by-one error in liblinear helper dense_to_sparse (#14103) 2019-06-17 14:54:13 +02:00
Alex Henrie 05b12cfcfd PERF Shrink arrays to size in liblinear helper dense_to_sparse (#14026) 2019-06-12 22:09:55 +02: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
TakingItCasual 1e052e9da9 Converting http to https (2)... (#12292) 2018-10-04 23:06:14 +02:00
Sergei Lebedev e2f99b0427 FIX memory leak in liblinear (#9024)
The leak resulted from two issues:
- not freeing the problem struct
- not freeing the number of iterations

The former was present in the initial version of ``liblinear_helper.c``
while latter appeared after c8c72fd96e
which introduced ``n_iter``.

Closes #8499
2017-06-07 17:35:34 +10:00
Loïc Estève 204472af0f FIX segmentation fault in libsvm (#6708)
The fix was taken from libsvm:
745fdb02bf
2016-05-25 22:16:02 -03:00
seales 0485ada58b General spelling fixes 2015-12-16 09:46:42 -08:00
MechCoder 9e422509fb HOTFIX for incorrect cast in liblinear.pyx 2015-10-23 12:23:33 -04:00
MechCoder 9d8d7e426c Replace GETC to SAMPLE_WEIGHT 2015-10-23 00:07:02 -04:00
MechCoder 80e22b3ddf Patch liblinear for sample_weights in LogisticRegression(and CV) 2015-10-23 00:00:31 -04:00
Andreas Mueller b1ddbf4695 Fixes to sparse decision_function, rebase fixes. 2015-03-26 11:44:39 -04:00
Rob Zinkov 0dc37f5f73 Adding sparse support for decision function
Adding test for decision_function on sparse matrices

Fixing typos

Fix Memory Leak

PEP8 fixes

COSMIT PEP8

Fixed class_weight_label problem

Fixed label problem in tests

renamed label_ to classes_

Fixed OneClass bug

Adding kernel tests for sparse matrices

Pass dense data to decision function

Don't check precomputed kernel

use safe_sparse_dot in test, regenerate cython

create a core-dump by testing the binary case... hurray?
2015-03-26 11:35:36 -04:00
Lars Buitinck 57ea0c091d Merge branch 'update-liblinear'
Synchronized with upstream by cherry-pick, up to their commit
2c69167789dfc23e8a8eeedae931166769a734f5.
2014-12-04 23:51:08 +01:00
Yu-Chin a6466155ae MAINT changes to (disabled) Liblinear code, from upstream
Was: f9c13dff5ad1b32e4a67eaed77c13365a86c68d7

In get_decfun_coef and get_decfun_bias, a zero value is returned in all invalid
cases. We decide not to return NaN because we are not sure if it can be
properly assigned in all platforms. (For example, ``double nan = 0.0/0.0;''
won't compile in Visual Studio.)

Conflicts:
	README
	sklearn/svm/src/liblinear/linear.cpp
2014-12-04 23:48:21 +01:00
Yu-Chin 9e1ea63f98 MAINT use size_t in Liblinear
Was: d2f18015169e9981f82fb520af9532e1dbccecf3

replace long int with size_t in linear.cpp and train.c

Conflicts:
	sklearn/svm/src/liblinear/linear.cpp
	train.c
2014-12-04 23:48:21 +01:00
Hsiang-Fu Yu 60860e4a89 MAINT some cleanup in Liblinear
Also adds some new code, which I disabled because we don't need it. --LB

add two functions get_decfun_coef and get_decfun_bias

Conflicts:
	README
	matlab/predict.c
	predict.c
	python/README
	python/liblinear.py
	python/liblinearutil.py
	sklearn/svm/src/liblinear/linear.cpp
	sklearn/svm/src/liblinear/linear.h
2014-12-04 23:48:21 +01:00
Yu-Chin f1916c8453 MAINT variable initialization in Liblinear
Was: 69462e18795e91d107327df83efab4ab60000869

initialize Gnorm1_init with -1

Conflicts:
	sklearn/svm/src/liblinear/linear.cpp
2014-12-04 23:48:21 +01:00
Yu-Chin f690b4a84f COSMIT tabs/spaces in Liblinear
Includes upstream fix for bug that we had already fixed in
22e1f69c2b.

Was: f944f28b1edc38345de5fd65c49ddde6f82496c4

Fix the mixing tab and space problem in tron.cpp.

Conflicts:
	sklearn/svm/src/liblinear/tron.cpp

Was: 1601eb1e25e2dec7330fa6945922ea63b6310f3a

fix a bug: use "delete[] C" instead of "delete C" in train_one

Conflicts:
	sklearn/svm/src/liblinear/linear.cpp
2014-12-04 23:46:15 +01:00
Tzu-Ming Kuo 7ede0df219 MAINT liblinear class label logic (disabled)
Pulled to make pulling in patches from upstream easier, but disabled with
an #if 0 block because I didn't know how this would interact with our own
modifications.  --LB

Was: a932c3fe99fe03a69197dcd0c89df1e6fa86cc24

Modify function group_classes in linear.cpp to ensure label[0] = 1 if class labels are +1 and -1

Conflicts:
	sklearn/svm/src/liblinear/linear.cpp
2014-12-04 23:31:06 +01:00
leepei 63c378f849 Let nr_fold = l when nr_fold > l in CV
Signed-off-by: Po-Wei Wang <xflash96@gmail.com>
2014-12-04 23:31:06 +01:00
leepei 14968044ec MAINT trailing whitespace in linear.cpp
Was: 3e8fc6880c691786d1871653fd4ec3ee121e6b08

Fix some indention

Conflicts:
	predict.c
	sklearn/svm/src/liblinear/linear.cpp
	train.c
2014-12-04 23:01:33 +01:00
Lars Buitinck ea1d134d56 MAINT get rid of undefined variable warning in Liblinear 2014-12-04 22:27:32 +01:00
Fabian Pedregosa 7e1a0eee08 ENH LinearSVR using liblinear code
Fixes gh-3877.
2014-12-03 20:44:04 +01:00
Olivier Grisel 4e2960df24 FIX call srand whenever random_seed >= 0 in libsvm
This bug was discovered by #3691 (failing test under windows).
2014-10-01 16:26:07 +02:00
x0l cd88472954 FIX error handling/memory deallocation in Liblinear wrapper
Fixes #3675.
2014-09-22 16:58:29 +02:00
MechCoder ad5773cfca TST: Added test to check ConvergenceWarning 2014-08-01 12:15:57 +02:00
MechCoder c8c72fd96e ENH: Return n_iter_ from liblinear and print convergence warnings 2014-08-01 12:15:57 +02:00
MechCoder 3edfa3cf17 Max iter param in Liblinear is now softcoded 2014-08-01 12:15:57 +02:00
Andreas Mueller 9c51bc9547 MAINT remove _label attribute from SVC.
Fixes #1573.
2014-04-03 17:28:08 +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
Lars Buitinck 884889a4cd MAINT get rid of compiler warnings from Liblinear 2014-02-16 18:06:56 +01:00
cjlin 45a8ed3b58 MAINT import LibSVM patch from upstream
int i; in svm_predict_values for openmp

Conflicts:
	sklearn/svm/src/libsvm/svm.cpp
2013-12-27 14:56:43 +01:00
cjlin 23f2328d46 add a comment for sigmoid_predict in svm.cpp 2013-12-27 14:56:42 +01:00
cjlin 48c9d659c2 MAINT import LibSVM 310
version number changed to 310

Conflicts:
	README
	java/libsvm/svm.m4
2013-12-27 14:56:42 +01:00