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, trimToSize
equals, hashCode
containsAll, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
containsAll, equals, hashCode
public 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 functionInstantiationException
public NystromMethodEnsemble()
public static NystromMethodEnsemble load(String inputFilePath) throws FileNotFoundException, IOException
inputFilePath
- The input file pathFileNotFoundException
IOException
public void save(String outputFilePath) throws FileNotFoundException, IOException
outputFilePath
- The output file nameFileNotFoundException
IOException
public 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 label
s 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 Ensemble
InstantiationException
public 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 exampleInstantiationException
public 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 concatenationInstantiationException
public float[] getRanks()
public Vector getLinearRepresentation(Example example)
LinearizationFunction
Example
, this method generates a linear
Representation>
, i.e. a Vector
.getLinearRepresentation
in interface LinearizationFunction
example
- The input example.public Example getLinearizedExample(Example example, String representationName)
LinearizationFunction
getLinearizedExample
in interface LinearizationFunction
example
- The input example.public SimpleDataset getLinearizedDataset(Dataset dataset, String representationName)
LinearizationFunction
dataset
, generating a corresponding linearized dataset. The produced examples
inherit the labels of the corresponding input examples.getLinearizedDataset
in interface LinearizationFunction
dataset
- The input datasetrepresentationName
- The name of the linear representation inside the new examplespublic int getEmbeddingSize()
getEmbeddingSize
in interface LinearizationFunction
Copyright © 2018 Semantic Analytics Group @ Uniroma2. All rights reserved.