public class MinSimilarityAffinityMatrixCreator extends Object implements AffinityMatrixCreator
AffinityMatrixCreator adds an edge between two data points, i
and j, if the similarity between them is above a certain threshold. This
relationship is symmetric.| Constructor and Description |
|---|
MinSimilarityAffinityMatrixCreator() |
| 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
SimilarityFunctions to be used for selecting edges and
then weighting edges. |
void |
setParams(double... params)
Sets any numeric parameters, such as thresholds, for this
AffinityMatrixCreator. |
public void setParams(double... params)
AffinityMatrixCreatorAffinityMatrixCreator. Each AffinityMatrixCreator should
specify how many parameters it expects and in what order.setParams in interface AffinityMatrixCreatorpublic void setFunctions(SimilarityFunction edgeSim, SimilarityFunction kernelSim)
SimilarityFunctions 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.setFunctions in interface AffinityMatrixCreatoredgeSim - 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.public MatrixFile calculate(Matrix input)
MatrixFile as input.calculate in interface AffinityMatrixCreatorinput - The Matrix that contains data points that are to
be formed into an affinity matrix.MatrixFile.read().public MatrixFile calculate(MatrixFile input)
calculate in interface AffinityMatrixCreatorinput - The MatrixFile that contains data points that are to
be formed into an affinity matrix.MatrixFile.read().public MatrixFile calculate(MatrixFile input, boolean useColumns)
SVDLIBC_SPARSE_BINARY format which is stored in
column-major order.calculate in interface AffinityMatrixCreatorinput - 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.