Package generic.lsh.vector
Class WeightedLSHCosineVectorFactory
java.lang.Object
generic.lsh.vector.LSHVectorFactory
generic.lsh.vector.WeightedLSHCosineVectorFactory
-
Field Summary
Fields inherited from class generic.lsh.vector.LSHVectorFactory
idfLookup, settings, weightFactory
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuildVector
(int[] feature) Generate an LSHVector from a feature set, individual features are integer hashes.Generate vector with all coefficients zero.Generate an LSHVector based on string returned from SQL query Factory generates weights based on term frequency info in the string and its internal IDF knowledgerestoreVectorFromXml
(XmlPullParser parser) Generate an LSHVector based on XML tag seen by pull parser.Methods inherited from class generic.lsh.vector.LSHVectorFactory
calculateSignificance, getSelfSignificance, getSettings, getSignificanceAddend, getSignificanceScale, isLoaded, readWeights, set
-
Constructor Details
-
WeightedLSHCosineVectorFactory
public WeightedLSHCosineVectorFactory()
-
-
Method Details
-
buildZeroVector
Description copied from class:LSHVectorFactory
Generate vector with all coefficients zero.- Specified by:
buildZeroVector
in classLSHVectorFactory
- Returns:
- the zero vector
-
buildVector
Description copied from class:LSHVectorFactory
Generate an LSHVector from a feature set, individual features are integer hashes. The integers MUST already be sorted. The same integer can occur more than once in the array (term frequency (TF) > 1). The factory decides internally how to create weights based on term frequency and any knowledge of Inverse Document Frequency (IDF)- Specified by:
buildVector
in classLSHVectorFactory
- Parameters:
feature
- is the sorted array of integer features- Returns:
- the newly minted LSHVector
-
restoreVectorFromXml
Description copied from class:LSHVectorFactory
Generate an LSHVector based on XML tag seen by pull parser. Factory generates weights based on term frequency info in the XML tag and its internal IDF knowledge- Specified by:
restoreVectorFromXml
in classLSHVectorFactory
- Parameters:
parser
- is the XML parser- Returns:
- the newly minted LSHVector
-
restoreVectorFromSql
Description copied from class:LSHVectorFactory
Generate an LSHVector based on string returned from SQL query Factory generates weights based on term frequency info in the string and its internal IDF knowledge- Specified by:
restoreVectorFromSql
in classLSHVectorFactory
- Parameters:
sql
- is the column data string returned by an SQL query- Returns:
- the newly minted LSHVector
- Throws:
IOException
-