public class NystromMethod extends Object implements LinearizationFunction
Dataset of examples represented through
tree structures and a tree kernel function, this class allows deriving a
linearized dataset at a given dimensionality. | Modifier and Type | Field and Description |
|---|---|
static float |
ESPILON |
| Constructor and Description |
|---|
NystromMethod() |
NystromMethod(List<Example> landmarks,
Kernel kernel)
Constructor of NystromMethod.
|
NystromMethod(List<Example> landmarks,
Kernel kernel,
int expectedRank) |
| Modifier and Type | Method and Description |
|---|---|
protected double[] |
calculateVector(Example example)
It derives an array of doubles containing the linearized representation
|
int |
getEmbeddingSize() |
Kernel |
getKernel() |
List<Example> |
getLandmarks() |
SimpleDataset |
getLinearizedDataset(Dataset dataset,
String representationName)
This method linearizes all the examples in the input
dataset
, generating a corresponding linearized dataset. |
Example |
getLinearizedExample(Example example,
String representationName)
This method linearizes an input example, providing a new example
containing only a representation with a specific name, provided as input.
|
DenseVector |
getLinearRepresentation(Example example)
Given an input
Example, this method generates a linear
Representation>, i.e. |
List<Double> |
getProjectionMatrix() |
int |
getRank() |
static NystromMethod |
load(String inputFilePath)
Load a Nystrom-based projection function from a file
|
void |
save(String outputFilePath)
Save a Nystrom-based projection function in a file.
|
void |
setKernel(Kernel kernel) |
void |
setLandmarks(List<Example> landmarks) |
void |
setProjectionMatrix(List<Double> projectionMatrix) |
void |
setRank(int rank) |
public static final float ESPILON
public NystromMethod()
public NystromMethod(List<Example> landmarks, Kernel kernel) throws InstantiationException
landmarkslandmarks - The set of examples used as landmarkskernel - The kernel functionInstantiationExceptionpublic NystromMethod(List<Example> landmarks, Kernel kernel, int expectedRank) throws InstantiationException
landmarks - The set of examples used as landmarkskernel - The kernel functionexpectedRank - The expected rank of the space representing the linearized
examplesInstantiationExceptionpublic static NystromMethod load(String inputFilePath) throws FileNotFoundException, IOException
inputFilePath - the input fileFileNotFoundExceptionIOExceptionprotected double[] calculateVector(Example example)
example - the input examplepublic Kernel getKernel()
public SimpleDataset getLinearizedDataset(Dataset dataset, String representationName)
LinearizationFunctiondataset
, generating a corresponding linearized dataset. The produced examples
inherit the labels of the corresponding input examples.getLinearizedDataset in interface LinearizationFunctiondataset - The input datasetrepresentationName - The name of the linear representation inside the new examplespublic Example getLinearizedExample(Example example, String representationName)
LinearizationFunctiongetLinearizedExample in interface LinearizationFunctionexample - The input example.public DenseVector getLinearRepresentation(Example example)
LinearizationFunctionExample, this method generates a linear
Representation>, i.e. a Vector.getLinearRepresentation in interface LinearizationFunctionexample - The input example.public List<Double> getProjectionMatrix()
public int getRank()
public void save(String outputFilePath) throws FileNotFoundException, IOException
outputFilePath - the output file pathFileNotFoundExceptionIOExceptionpublic void setKernel(Kernel kernel)
kernel - The kernel functionpublic void setProjectionMatrix(List<Double> projectionMatrix)
projectionMatrix - The projection matrixpublic void setRank(int rank)
rank - The expected rankpublic int getEmbeddingSize()
getEmbeddingSize in interface LinearizationFunctionCopyright © 2018 Semantic Analytics Group @ Uniroma2. All rights reserved.