jrb-libsvm 0.1.2-java

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/java/COPYRIGHT ADDED
@@ -0,0 +1,31 @@
1
+
2
+ Copyright (c) 2000-2012 Chih-Chung Chang and Chih-Jen Lin
3
+ All rights reserved.
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions
7
+ are met:
8
+
9
+ 1. Redistributions of source code must retain the above copyright
10
+ notice, this list of conditions and the following disclaimer.
11
+
12
+ 2. Redistributions in binary form must reproduce the above copyright
13
+ notice, this list of conditions and the following disclaimer in the
14
+ documentation and/or other materials provided with the distribution.
15
+
16
+ 3. Neither name of copyright holders nor the names of its contributors
17
+ may be used to endorse or promote products derived from this software
18
+ without specific prior written permission.
19
+
20
+
21
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22
+ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
25
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
26
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
27
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
28
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
31
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,23 @@
1
+ //
2
+ // Model
3
+ //
4
+ package libsvm;
5
+ public class Model implements java.io.Serializable
6
+ {
7
+ public Parameter param; // parameter
8
+ public int nr_class; // number of classes, = 2 in regression/one class svm
9
+ public int l; // total #SV
10
+ public Node[][] SV; // SVs (SV[l])
11
+ public double[][] sv_coef; // coefficients for SVs in decision functions (sv_coef[k-1][l])
12
+ public double[] rho; // constants in decision functions (rho[k*(k-1)/2])
13
+ public double[] w_2; // hyperplane squared norms for each binary SVM (PCL, taken from Gabor Melis)
14
+ public double[] probA; // pariwise probability information
15
+ public double[] probB;
16
+ public int[] sv_indices; // sv_indices[0,...,nSV-1] are values in [1,...,num_traning_data] to indicate SVs in the training set
17
+
18
+ // for classification only
19
+
20
+ public int[] label; // label of each class (label[k])
21
+ public int[] nSV; // number of SVs for each class (nSV[k])
22
+ // nSV[0] + nSV[1] + ... + nSV[k-1] = l
23
+ };
@@ -0,0 +1,6 @@
1
+ package libsvm;
2
+ public class Node implements java.io.Serializable
3
+ {
4
+ public int index;
5
+ public double value;
6
+ }
@@ -0,0 +1,47 @@
1
+ package libsvm;
2
+ public class Parameter implements Cloneable,java.io.Serializable
3
+ {
4
+ /* svm_type */
5
+ public static final int C_SVC = 0;
6
+ public static final int NU_SVC = 1;
7
+ public static final int ONE_CLASS = 2;
8
+ public static final int EPSILON_SVR = 3;
9
+ public static final int NU_SVR = 4;
10
+
11
+ /* kernel_type */
12
+ public static final int LINEAR = 0;
13
+ public static final int POLY = 1;
14
+ public static final int RBF = 2;
15
+ public static final int SIGMOID = 3;
16
+ public static final int PRECOMPUTED = 4;
17
+
18
+ public int svm_type;
19
+ public int kernel_type;
20
+ public int degree; // for poly
21
+ public double gamma; // for poly/rbf/sigmoid
22
+ public double coef0; // for poly/sigmoid
23
+
24
+ // these are for training only
25
+ public double cache_size; // in MB
26
+ public double eps; // stopping criteria
27
+ public double C; // for C_SVC, EPSILON_SVR and NU_SVR
28
+ public int nr_weight; // for C_SVC
29
+ public int[] weight_label; // for C_SVC
30
+ public double[] weight; // for C_SVC
31
+ public double nu; // for NU_SVC, ONE_CLASS, and NU_SVR
32
+ public double p; // for EPSILON_SVR
33
+ public int shrinking; // use the shrinking heuristics
34
+ public int probability; // do probability estimates
35
+
36
+ public Object clone()
37
+ {
38
+ try
39
+ {
40
+ return super.clone();
41
+ } catch (CloneNotSupportedException e)
42
+ {
43
+ return null;
44
+ }
45
+ }
46
+
47
+ }
@@ -0,0 +1,5 @@
1
+ package libsvm;
2
+ public interface PrintInterface
3
+ {
4
+ public void print(String s);
5
+ }
@@ -0,0 +1,7 @@
1
+ package libsvm;
2
+ public class Problem implements java.io.Serializable
3
+ {
4
+ public int l;
5
+ public double[] y;
6
+ public Node[][] x;
7
+ }