Package generic.lsh.vector

# Class WeightedLSHCosineVectorFactory

java.lang.Object
generic.lsh.vector.LSHVectorFactory
generic.lsh.vector.WeightedLSHCosineVectorFactory

public class WeightedLSHCosineVectorFactory extends LSHVectorFactory

- ## Field Summary

  ### Fields inherited from class generic.lsh.vector.LSHVectorFactory

  `idfLookup, settings, weightFactory`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `WeightedLSHCosineVectorFactory()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `LSHVector`
  `buildVector(int[] feature)`
  Generate an LSHVector from a feature set, individual features are integer hashes.
  `LSHVector`
  `buildZeroVector()`
  Generate vector with all coefficients zero.
  `LSHVector`
  `restoreVectorFromSql(String sql)`
  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
  `LSHVector`
  `restoreVectorFromXml(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`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### WeightedLSHCosineVectorFactory

    public WeightedLSHCosineVectorFactory()

- ## Method Details

  - ### buildZeroVector

    public LSHVector buildZeroVector()
    Description copied from class: `LSHVectorFactory`
    Generate vector with all coefficients zero.
    Specified by:
      `buildZeroVector` in class `LSHVectorFactory`
    Returns:
      the zero vector

  - ### buildVector

    public LSHVector buildVector(int[] feature)
    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 class `LSHVectorFactory`
    Parameters:
      `feature` - is the sorted array of integer features
    Returns:
      the newly minted LSHVector

  - ### restoreVectorFromXml

    public LSHVector restoreVectorFromXml(XmlPullParser parser)
    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 class `LSHVectorFactory`
    Parameters:
      `parser` - is the XML parser
    Returns:
      the newly minted LSHVector

  - ### restoreVectorFromSql

    public LSHVector restoreVectorFromSql(String sql) throws IOException
    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 class `LSHVectorFactory`
    Parameters:
      `sql` - is the column data string returned by an SQL query
    Returns:
      the newly minted LSHVector
    Throws:
      `IOException`