Package elki.svm.qmatrix
Class SVR_Q
- java.lang.Object
-
- elki.svm.qmatrix.SVR_Q
-
- All Implemented Interfaces:
QMatrix
public class SVR_Q extends java.lang.Object implements QMatrix
Q matrix used for regression byEpsilonSVR
andNuSVR
.This uses two "copies" of the data, one for upper bounding and one for lower bounding of the data, yielding a virtual size of 2*l.
To save memory, we cache inside, to avoid duplication.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
get_Q(int i, int len, float[] out)
Get a column of the matrix.double[]
get_QD()
Get the diagonal values, as reference.void
initialize()
Initialize the Q Matrix.double
similarity(int i, int j)
(Slow) compute the similarity (not distance) of objects i and j.void
swap_index(int i, int j)
Reorganize the data by swapping two entries.
-
-
-
Field Detail
-
l
private final int l
-
sign
private final byte[] sign
-
index
private final int[] index
-
inner
private CachedQMatrix inner
-
QD
private final double[] QD
-
-
Constructor Detail
-
SVR_Q
public SVR_Q(DataSet x, double cache_size)
-
-
Method Detail
-
initialize
public void initialize()
Description copied from interface:QMatrix
Initialize the Q Matrix.- Specified by:
initialize
in interfaceQMatrix
-
get_QD
public double[] get_QD()
Description copied from interface:QMatrix
Get the diagonal values, as reference.
-
swap_index
public void swap_index(int i, int j)
Description copied from interface:QMatrix
Reorganize the data by swapping two entries.This also must modify the QD array!
- Specified by:
swap_index
in interfaceQMatrix
- Parameters:
i
- First entryj
- Second entry
-
get_Q
public void get_Q(int i, int len, float[] out)
Description copied from interface:QMatrix
Get a column of the matrix.
-
similarity
public double similarity(int i, int j)
Description copied from interface:QMatrix
(Slow) compute the similarity (not distance) of objects i and j.If you need many, use
QMatrix.get_Q(int, int, float[])
instead.- Specified by:
similarity
in interfaceQMatrix
- Parameters:
i
- First objectj
- Second object- Returns:
- Similarity
-
-