public class TermVectorSimilarityNetworkCreator extends AbstractCloneableSerializable
| Modifier and Type | Field and Description |
|---|---|
static double |
DEFAULT_EFFECTIVE_ZERO
The default effective zero value is 0.0.
|
protected double |
effectiveZero
The value to treat as zero.
|
protected MatrixFactory<? extends Matrix> |
matrixFactory
The matrix factory to create the matrix that backs the similarity
network.
|
protected SimilarityFunction<? super Vector,? super Vector> |
similarityFunction
The similarity function between term vectors used to determine the
similarity between two terms.
|
| Constructor and Description |
|---|
TermVectorSimilarityNetworkCreator()
Creates a new
TermVectorSimilarityNetworkCreator. |
TermVectorSimilarityNetworkCreator(SimilarityFunction<? super Vector,? super Vector> similarityFunction)
Creates a new
TermVectorSimilarityNetworkCreator. |
TermVectorSimilarityNetworkCreator(SimilarityFunction<? super Vector,? super Vector> similarityFunction,
double effectiveZero)
Creates a new
TermVectorSimilarityNetworkCreator. |
TermVectorSimilarityNetworkCreator(SimilarityFunction<? super Vector,? super Vector> similarityFunction,
double effectiveZero,
MatrixFactory<? extends Matrix> matrixFactory)
Creates a new
TermVectorSimilarityNetworkCreator. |
| Modifier and Type | Method and Description |
|---|---|
MatrixBasedTermSimilarityNetwork |
create(java.util.Collection<? extends Vectorizable> documents,
TermIndex termIndex)
Creates a new similarity network between the terms in the given
documents.
|
double |
getEffectiveZero()
Gets the value to treat as zero.
|
MatrixFactory<? extends Matrix> |
getMatrixFactory()
Gets the matrix factory to create the matrix that backs the similarity
network.
|
SimilarityFunction<? super Vector,? super Vector> |
getSimilarityFunction()
Gets the similarity function between term vectors used to determine the
similarity between two terms.
|
void |
setEffectiveZero(double effectiveZero)
Sets the value to treat as zero.
|
void |
setMatrixFactory(MatrixFactory<? extends Matrix> matrixFactory)
Sets the matrix factory to create the matrix that backs the similarity
network.
|
void |
setSimilarityFunction(SimilarityFunction<? super Vector,? super Vector> similarityFunction)
Sets the similarity function between term vectors used to determine the
similarity between two terms.
|
clonepublic static final double DEFAULT_EFFECTIVE_ZERO
protected SimilarityFunction<? super Vector,? super Vector> similarityFunction
protected double effectiveZero
protected MatrixFactory<? extends Matrix> matrixFactory
public TermVectorSimilarityNetworkCreator()
TermVectorSimilarityNetworkCreator.public TermVectorSimilarityNetworkCreator(SimilarityFunction<? super Vector,? super Vector> similarityFunction)
TermVectorSimilarityNetworkCreator.similarityFunction - The similarity function between term vectors used to determine the
term similarity.public TermVectorSimilarityNetworkCreator(SimilarityFunction<? super Vector,? super Vector> similarityFunction, double effectiveZero)
TermVectorSimilarityNetworkCreator.similarityFunction - The similarity function between term vectors used to determine the
term similarity.effectiveZero - The effective value to treat as zero. Used to increase the
sparseness of a similarity network.public TermVectorSimilarityNetworkCreator(SimilarityFunction<? super Vector,? super Vector> similarityFunction, double effectiveZero, MatrixFactory<? extends Matrix> matrixFactory)
TermVectorSimilarityNetworkCreator.similarityFunction - The similarity function between term vectors used to determine the
term similarity.effectiveZero - The effective value to treat as zero. Used to increase the
sparseness of a similarity network.matrixFactory - The matrix factory used to create the similarity matrix.public MatrixBasedTermSimilarityNetwork create(java.util.Collection<? extends Vectorizable> documents, TermIndex termIndex)
documents - The term vectors for each document to calculate the similarity
network from.termIndex - The index of terms that was used to create the term vectors for
each document.public SimilarityFunction<? super Vector,? super Vector> getSimilarityFunction()
public void setSimilarityFunction(SimilarityFunction<? super Vector,? super Vector> similarityFunction)
similarityFunction - The similarity function.public double getEffectiveZero()
public void setEffectiveZero(double effectiveZero)
effectiveZero - The threshold to treat absolute values below as zero.public MatrixFactory<? extends Matrix> getMatrixFactory()
public void setMatrixFactory(MatrixFactory<? extends Matrix> matrixFactory)
matrixFactory - The matrix factory.