java - LIBMSVM svm_node format -
Hi, I am currently working on a project and started using the LIBSVM () library to train datasets for my Java application.
I have a question about svm_problem and svm_node
in the svm_problem we have the following code
package libsvm; Public class svm_problem applies java.io.Serializable {public int l; Public double [] y; Public svm_node [] [] x; } Is it correct to say that
-
Does all represent the size of the image?
-
In my case, the image is labeled I + 1 / -1
and now svm_node [] [] About my second question goes to X
package libsvm; Public class svm_node applies java.io.Serializable {public int index; Public double value; } From 1 to i each svm_node is located in every array where I have the number of my properties.
So for example I have an image value as follows <1 p> 1: 1.5 2: 2.5 3: 4.5
-1 1: 1 2: 2 3: 3
then my int l = 3
y
y [0] = 1
y [1] = -1 < / P>
X [0] [0] .index = 1
x [0] [0] .value = 1.5
x [0] [1]. Index = 2
X [0] [1] .value = 2.5
x [0] [2]. Index = 3
x [0] [2] .value = 4.5
x [1] [0]. Index = 1
x [1] [0] .value = 1
x [1] [1]. Index = 2
x [1] [1] .value = 2
x [1] [2] .index = 3
X [1] [2] .value = 3
Am I correct in my understanding?
You are locked.
svm_problem.l is the number of samples in the database, so in this situation it will be 2.
Since libsvm uses a rare sign, therefore, the line ends with the indicator of -1 for each example, for example:
x [0] [ 0]. Index = 1
x [0] [0] .value = 1.5
X [0] [1] .index = 2
x [0] [1] .value = 2.5
X [0] [2]. Index = 3
x [0] [2] .value = 4.5
x [0] [3]. Index = -1
Comments
Post a Comment