public class NystromMethodEnsemble extends ArrayList<NystromMethod> implements LinearizationFunction
modCount| Constructor and Description |
|---|
NystromMethodEnsemble() |
NystromMethodEnsemble(List<List<Example>> listOflandmarks,
Kernel kernel) |
| Modifier and Type | Method and Description |
|---|---|
DenseVector |
getDenseVectorByEnsembleAndJuxtaposition(Example example)
Given an example, this method produces a
DenseVector that is
the concatenation of the vectors obtained by each projection functions
used in the Ensemble. |
DenseVector |
getDenseVectorByEnsembleAndJuxtaposition(Example example,
List<Float> weights)
Given an example, this method produces a
DenseVector that is
the concatenation of the vectors obtained by each projection functions
used in the Ensemble. |
int |
getEmbeddingSize() |
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.
|
Vector |
getLinearRepresentation(Example example)
Given an input
Example, this method generates a linear
Representation>, i.e. |
float[] |
getRanks() |
Example |
linearizeByEnsembleAndJuxtaposition(Example example,
String newRepresentationName)
Given an example, this method produces a new
Example
|
static NystromMethodEnsemble |
load(String inputFilePath)
Load an Ensemble of Nystrom projectors saved on file.
|
void |
save(String outputFilePath)
Save an Ensemble of Nystrom projectors on file.
|
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeRange, retainAll, set, size, subList, toArray, toArray, trimToSizeequals, hashCodecontainsAll, toStringfinalize, getClass, notify, notifyAll, wait, wait, waitcontainsAll, equals, hashCodepublic NystromMethodEnsemble(List<List<Example>> listOflandmarks, Kernel kernel) throws InstantiationException
listOflandmarks - The set of landmarks to build the projection functions based
on the Nystrom Methodkernel - The kernel functionInstantiationExceptionpublic NystromMethodEnsemble()
public static NystromMethodEnsemble load(String inputFilePath) throws FileNotFoundException, IOException
inputFilePath - The input file pathFileNotFoundExceptionIOExceptionpublic void save(String outputFilePath) throws FileNotFoundException, IOException
outputFilePath - The output file nameFileNotFoundExceptionIOExceptionpublic Example linearizeByEnsembleAndJuxtaposition(Example example, String newRepresentationName) throws InstantiationException
Example
containing a single representation, i.e. a dense vector that is
the concatenation of the vectors obtained by each projection
function used in the Ensemble. The labels are copied from
the input example.example - the input examplenewRepresentationName - the identifier of the new dense vectorExample containing a single representation,
i.e. a dense vector that is the concatenation of the vectors
obtained by each projection function used in the EnsembleInstantiationExceptionpublic DenseVector getDenseVectorByEnsembleAndJuxtaposition(Example example) throws InstantiationException
DenseVector that is
the concatenation of the vectors obtained by each projection functions
used in the Ensemble.example - the input exampleInstantiationExceptionpublic DenseVector getDenseVectorByEnsembleAndJuxtaposition(Example example, List<Float> weights) throws InstantiationException
DenseVector that is
the concatenation of the vectors obtained by each projection functions
used in the Ensemble. Each vector used in the concatenation is multiplied
by a corresponding weightexample - The input exampleweights - the weights applied to each vector before the concatenationInstantiationExceptionpublic float[] getRanks()
public Vector getLinearRepresentation(Example example)
LinearizationFunctionExample, this method generates a linear
Representation>, i.e. a Vector.getLinearRepresentation in interface LinearizationFunctionexample - The input example.public Example getLinearizedExample(Example example, String representationName)
LinearizationFunctiongetLinearizedExample in interface LinearizationFunctionexample - The input example.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 int getEmbeddingSize()
getEmbeddingSize in interface LinearizationFunctionCopyright © 2018 Semantic Analytics Group @ Uniroma2. All rights reserved.