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
Yu-Chin [Tue, 21 Oct 2014 19:32:51 +0000 (03:32 +0800)]
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.)
b99902019 [Fri, 17 Oct 2014 03:19:07 +0000 (11:19 +0800)]
To support nnz > 2^32, change the data type of the variables related to nnz.
Data types of some other variables are also changed to be consistent with the
data types returned by matlab functions.