public interface AffinityMatrixCreator
n
x m
matrix, the
affinity matrix is an n
x n
matrix specifying which of the
rows are connected; viewed as a graph, the affinity matrix specifies which
rows have edges between them and what the weights of those edges are.
This class provides multiple options for specifying how the affinity matrix should be computed both in terms of the number of neighbors and the weights of the edges to those neighbors.
Due to the full density of the affinity matrix, the matrix is always written to disk, rather than stored in memory. This class also provides support for computing the affinity matrix off-core, i.e. without needing to load the matrix entirely into memory. If the off-core method is specified, the returned matrix will also be on disk.
This class is thread safe.
LocalityPreservingProjection
Modifier and Type | Method and Description |
---|---|
MatrixFile |
calculate(Matrix input)
Computes the affinity matrix for the input matrix according to the
specified similarity metrics, returning the result as a file on disk.
|
MatrixFile |
calculate(MatrixFile input)
Computes the affinity matrix for the input matrix according to the
specified similarity metrics, returning the result as a file on disk.
|
MatrixFile |
calculate(MatrixFile input,
boolean useColumns)
Computes the affinity matrix for the input matrix according to the
specified similarity metrics, optionally treating the columns as data
points, and returning the result as a file on disk.
|
void |
setFunctions(SimilarityFunction edgeSim,
SimilarityFunction kernelSim)
Sets the
SimilarityFunction s to be used for selecting edges and
then weighting edges. |
void |
setParams(double... params)
Sets any numeric parameters, such as thresholds, for this
AffinityMatrixCreator . |
void setParams(double... params)
AffinityMatrixCreator
. Each AffinityMatrixCreator
should
specify how many parameters it expects and in what order.void setFunctions(SimilarityFunction edgeSim, SimilarityFunction kernelSim)
SimilarityFunction
s to be used for selecting edges and
then weighting edges. edgeSim
will be computed over every
possible edge. The returned scores will be used to filter out valid
edges in the graph. kernelSim
will be used to compute the final
edge weight between two valid edges in the graph, this is also called a
kernel function.edgeSim
- The SimilarityFunction
used to filter edges. This
metric is assumed to be symmetric.kernelSim
- The SimilarityFunction
used to weight valid
edges. This metric may or may not be symmetric.MatrixFile calculate(Matrix input)
MatrixFile
as input.input
- The Matrix
that contains data points that are to
be formed into an affinity matrix.MatrixFile.read()
.MatrixFile calculate(MatrixFile input)
input
- The MatrixFile
that contains data points that are to
be formed into an affinity matrix.MatrixFile.read()
.MatrixFile calculate(MatrixFile input, boolean useColumns)
SVDLIBC_SPARSE_BINARY
format which is stored in
column-major order.input
- The MatrixFile
that contains data points that are to
be formed into an affinity matrix.useColumns
- true
if the affinity matrix should be
calculated for the columns of the input matrix, not the
rows.MatrixFile.read()
.Copyright © 2012. All Rights Reserved.