Chih-Jen Lin [Fri, 21 Feb 2020 22:37:36 +0000 (06:37 +0800)]
change SHVER from 3 to 4 due to the function name change or new functions
- TRON::trcg -> changed to TRON::trcpg (version 2.20)
- find_parameters_C -> changed to find_parameters (version 2.30)
- possibly a new solver for one-class SVM
fix a bug in README building windows binaries
update the directory in README to fit visual studio latest version
modify the explanation in matlab/README installation
johncreed [Mon, 18 Mar 2019 09:12:47 +0000 (17:12 +0800)]
L2R_L2LOSS_SVR warm start parameter search supported
-add function find_parameters for parameter search
-modify function find_parameter_C as subroutine of find_parameters
-add function calc_max_p for maximal p parameter for L2R_L2LOSS_SVR
-modify function calc_start_C for L2R_L2LOSS_SVR
-modify function train to support initial solution for L2R_L2LOSS_SVR
-change L2R_L2LOSS_SVR default -e to (0.0001)
-change parameter stopping condition from num_unchanged_w == 3 to 5
-modify python/MATLAB interface and train.c update
-REDME update
Chih-Jen Lin [Tue, 18 Dec 2018 12:41:46 +0000 (20:41 +0800)]
in solve_l1r_l2_svc, loss_old is initialized in a for loop over num_linesearch
by
if(num_linesearch == 0)
Some compiler think it's not initialized.. Hence this change add loss_old = 0 when it's declared.
Chih-Jen Lin [Tue, 18 Dec 2018 02:59:12 +0000 (10:59 +0800)]
a _cstr function to encode string to utf-8. Use it for file names in
loading and saving model. The _cstr implementations are different for
python 2.x and 3.x
This changes follows from the modification in libsvm
Chih-Jen Lin [Wed, 24 Oct 2018 10:52:49 +0000 (18:52 +0800)]
in README use an example to explain that -C returns only the best
parameter rather than a model. Users must use the selected parameter
to train a model.
Chih-Jen Lin [Thu, 26 Jul 2018 15:11:23 +0000 (23:11 +0800)]
Include LIBSVM's svm-scale.c in the package.
Add two functions (csr_find_scale_param, csr_scale) for data scaling in python interface.
Remove utility functions (svm_read_problem, evaluations) in liblinearutil.py and directly use them from LIBSVM's commonutil.py. Functions for scaling are also put in commonutil.py.
In svm_read_problem we removed zeros while reading data. Changed to keep them for consistency with LIBSVM (for which zeros must be kept for pre-computed kernels)
Chih-Jen Lin [Sat, 30 Jun 2018 00:04:32 +0000 (08:04 +0800)]
Print more digit of predicted labels (%.17g) as more accurate target values may be needed for regression. This change follows from the recent changes in LIBSVM.
b92paul [Thu, 8 Mar 2018 07:02:51 +0000 (15:02 +0800)]
Fixed bug and optimize code in TRON::tron
Variable "iter" and "w" won't change in the
while loop of function TRON::tron when the
direction does not lead to sufficient
function-value decrease, so using expression
"iter == 1" as a flag to initialize variables
will cause problems in the first step.
We introduce a new variable "delta_adjusted" to
fix the bug.
The function call "fun_obj->get_diagH(M)" and the
calculation of "(1-alpha_pcg) I + alpha_pcg M"
can be saved if "iter" and "w" remains the same.
We move some lines of code to save the
calculation.
b92paul [Tue, 17 Oct 2017 10:51:40 +0000 (18:51 +0800)]
Add mixed diagonal preconditioner to TRON method
We use (1-alpha)*I + alpha*diag(H_k) with
alpha=0.01 as a preconditioner to run PCG in TRON
method.
Following lines are the changes:
- Change TRON::trcg to TRON::trpcg with
additional argument M for PCG iterations
- Add l2r_l2_svc_fun::get_diagH and
l2r_l2_svc_fun::get_diagH to get diagonal
component of Hessian
- Add static function uTMv for weighted dot
for vector u and v with weight M
For detailed analysis, please check
http://www.csie.ntu.edu.tw/~cjlin/papers/tron_pcg/precondition.pdf
Chih-Jen Lin [Sat, 8 Apr 2017 06:47:35 +0000 (14:47 +0800)]
in load_model() of linear.cpp, parameters for training only won't be assigned after reading the model. However, we initialize arrays as NULL for safety. This follows the earlier change in libsvm
b92paul [Tue, 21 Mar 2017 06:08:53 +0000 (14:08 +0800)]
Remove unused fscanf in load_model in linear.cpp
Since FSCANF() function will check if the program
successfully read a double each time in for loop
(line 2887 in linear.cpp), the lines from 2888 to
2891 in linear.cpp are redundant and may cause
error in new version of VS compiler (14.0).
b92paul [Tue, 21 Feb 2017 08:52:58 +0000 (16:52 +0800)]
Add new region updating rule in TRON method
The new rule will change delta to delta*sigma3 when
actred >= eta2*prered and step reach trust region boundary in CG
iterations.
Following lines are the changes:
- Add new argument reach_boundary in TRON::trcg method to return whether
step from CG iterations reached boundary or not.
- Add new enlarge rule using the result reach_boundary returned from
TRON::trcg in TRON::tron method.
Chih-Jen Lin [Thu, 22 Oct 2015 08:32:24 +0000 (16:32 +0800)]
in "Building Windows Binaries" of README stress that binaries are
already available and they need to do it only if they want to
"re-build" the binaries.
In Hv function, we combine the Xv and XTv operations to
significantly improve the performance.
For detailed analysis, please check Fig. 3 in
http://www.csie.ntu.edu.tw/~cjlin/papers/multicore_liblinear_icdm.pdf
In addition, we replace some repeated linear operations with functions
in the new class, sparse_operator, to improve the readability.
boyu [Tue, 7 Jul 2015 16:16:29 +0000 (00:16 +0800)]
Fix bug and memory leaks in 2.0
- For SVR, model_->w was not initialized.
Now it is initialized in train().
- For parameter search, subprob of CV and its x, y are not freed
at the end of find_parameter_C().
- There were problems in checking prev_w for stopping condition.
It wrongly allocated memory for num_unchange_w < 0.
Flow control is modified.
- Reposition w_new in tron to reduce peak memory usage.
- Now print nr_fold when parameter search starts.
boyu [Sun, 28 Jun 2015 20:56:32 +0000 (04:56 +0800)]
warm start parameter search supported
-add functions for parameter search
-add init_sol in struct parameter
-modify function train to support initial solution for L2R_LR and L2R_L2LOSS_SVC
-interface and train.c update: option -C is added
b02902056 [Wed, 6 May 2015 12:05:24 +0000 (20:05 +0800)]
Using include "linear.h" instead of include "../linear.h"
Commented by Carnë Draug <carandraug+dev@gmail.com>:
The Matlab Makefile already has .. on the -I option for the compiler
so this was not required. This was only required for the make.m Matlab
and Octave script, so it was modified to include .. on the search path.
This change is required to build the mex files using a libsvm library
different than the one in this distribution. Maybe a system-wide
install of libsvm, or just another version for testing.
See the pull request for details: https://github.com/cjlin1/libsvm/pull/29