public class F1Optimizer extends java.lang.Object implements IHeterogenousSimilarityMeasureComputer
| Constructor and Description |
|---|
F1Optimizer() |
| Modifier and Type | Method and Description |
|---|---|
void |
build(org.nd4j.linalg.api.ndarray.INDArray X,
org.nd4j.linalg.api.ndarray.INDArray W,
org.nd4j.linalg.api.ndarray.INDArray R)
Learns a matrix U that minimizes F1 (W is ignored here)
|
double |
computeSimilarity(org.nd4j.linalg.api.ndarray.INDArray x,
org.nd4j.linalg.api.ndarray.INDArray w)
Compute the 'quality of the match' of given feature values for a new problem
instance based on the training.
|
double |
getCost(org.nd4j.linalg.api.ndarray.INDArray U)
This evaluates F1
|
float |
getFirstDerivative(org.nd4j.linalg.api.ndarray.INDArray U,
int k,
int l)
This compute the derivative of F1 for the (k,l)-th element of the U matrix
|
org.nd4j.linalg.api.ndarray.INDArray |
getGradientAsMatrix(org.nd4j.linalg.api.ndarray.INDArray U)
This computes the gradient of F1 in matrix form
|
org.nd4j.linalg.api.ndarray.INDArray |
getU() |
org.nd4j.linalg.api.ndarray.INDArray |
getX() |
de.jungblut.math.DoubleVector |
matrix2vector(org.nd4j.linalg.api.ndarray.INDArray matrix)
collapses a matrix of the Nd4j framework into a double vector of Thomas Jungblut's framework
|
org.nd4j.linalg.api.ndarray.INDArray |
vector2matrix(de.jungblut.math.DoubleVector vector,
int m,
int n)
creates a matrix of the Nd4j framework from a vector of Thomas Jungblut's math framework
|
public void build(org.nd4j.linalg.api.ndarray.INDArray X,
org.nd4j.linalg.api.ndarray.INDArray W,
org.nd4j.linalg.api.ndarray.INDArray R)
build in interface IHeterogenousSimilarityMeasureComputerX - Feature values for instances of the first measure (One row =
features of one instance, e.g. meta features of a data set)W - Feature values for instances of the second measure (One row =
features of one instance, e.g. a characterization of a machine
learning pipeline)R - A matrix giving an indication of how good of a match a specific
instance of the first measure is to a specific instance of the
second measure, i.e. how well a pipeline performs on a data setpublic org.nd4j.linalg.api.ndarray.INDArray vector2matrix(de.jungblut.math.DoubleVector vector,
int m,
int n)
vector - m - n - public de.jungblut.math.DoubleVector matrix2vector(org.nd4j.linalg.api.ndarray.INDArray matrix)
matrix - public double getCost(org.nd4j.linalg.api.ndarray.INDArray U)
RRT - U - X - public org.nd4j.linalg.api.ndarray.INDArray getGradientAsMatrix(org.nd4j.linalg.api.ndarray.INDArray U)
R - U - X - public float getFirstDerivative(org.nd4j.linalg.api.ndarray.INDArray U,
int k,
int l)
RRT - U - X - k - l - public double computeSimilarity(org.nd4j.linalg.api.ndarray.INDArray x,
org.nd4j.linalg.api.ndarray.INDArray w)
IHeterogenousSimilarityMeasureComputercomputeSimilarity in interface IHeterogenousSimilarityMeasureComputerx - Feature values for the instance for the first measure (e.g. meta
data of a new data set)w - Feature values for the instance for the second measure (e.g. a
characterization of machine learning pipeline)public org.nd4j.linalg.api.ndarray.INDArray getX()
public org.nd4j.linalg.api.ndarray.INDArray getU()