Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## infomat.vectorspace.similarity
Class SparseDotSimilarity

    java.lang.Object
      infomat.vectorspace.similarity.ISimilarity
          infomat.vectorspace.similarity.SparseISimilarity
              infomat.vectorspace.similarity.SparseDotSimilarity

All Implemented Interfaces:
  NeedsIMatrix, NeedsIMatrixDimension, HasProperties

    public class SparseDotSimilarity

extends SparseISimilarity
implements NeedsIMatrix, NeedsIMatrixDimension

DotSimilarity. The dot product. If the "Normalize" property is set to "true" it will be the cosine measure. However, this is achieved faster by normalizing during weighting. In the latter case the group centroids are not normalized, which in fact might be good.

Field Summary
`private IMatrix` | `matrix`
`private java.lang.Boolean` | `normalize`
`private boolean` | `row`

Fields inherited from class infomat.vectorspace.similarity.ISimilarity
`properties`

Constructor Summary
`SparseDotSimilarity()`
`SparseDotSimilarity(IMatrix matrix, boolean row)`
`SparseDotSimilarity(IMatrix matrix, boolean row, Properties properties)`

Method Summary
`Properties` | `getDefaultProperties()`
`IVector<IVectorIndex>` | `getGroupRepresentation(IObjectGroup iog)`
`IMatrix` | `getIMatrix()` Returns the actual IMatrix.
`boolean` | `getIMatrixDimension()` Returns a boolean that indicates wether the algorithm should consider rows or columns of a matrix.
`java.lang.String` | `getName()`
`Properties` | `getProperties()`
`java.lang.Object` | `getPropertyValue(java.lang.String name)`
`java.util.Vector` | `getPropertyVector()`
`IVector<IVectorIndex>` | `getRepresentation(IObject io)` Returns the representation in the form of a IVector.
`void` | `setIMatrix(IMatrix matrix)` Sets the IMatrix.
`void` | `setIMatrixDimension(boolean row)` Sets a boolean that indicates wether the algorithm should consider rows or columns of a matrix.
`void` | `setProperties(Properties properties)`
`void` | `setProperty(java.lang.String name, java.lang.Object value)`
`float` | `sim(IObjectGroup iog1, IObjectGroup iog2)` Calculates the similarity between two IObjectGroup:s.
`float` | `sim(IObject io1, IObject io2)` Calculates the similarity between two IObject:s.
`float` | `sim(IObject io, IObjectGroup iog)` Calculates the similarity between IObject and a IObjectGroup.
`
`<U extends IVectorIndex,V extends IVectorIndex> float`
` | `sim(IVector<U> vec1, IVector<V> vec2)` Calculates the similarity between two representations.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### matrix

    private IMatrix matrix

### row

    private boolean row

### normalize

    private java.lang.Boolean normalize

Constructor Detail

### SparseDotSimilarity

    public SparseDotSimilarity()

### SparseDotSimilarity

    public SparseDotSimilarity(IMatrix matrix,
                               boolean row)

### SparseDotSimilarity

    public SparseDotSimilarity(IMatrix matrix,
                               boolean row,
                               Properties properties)

Method Detail

### getDefaultProperties

    public Properties getDefaultProperties()

  Specified by:
    `getDefaultProperties` in interface `HasProperties`

### getName

    public java.lang.String getName()

  Specified by:
    `getName` in class `ISimilarity`

### getPropertyVector

    public java.util.Vector getPropertyVector()

### getPropertyValue

    public java.lang.Object getPropertyValue(java.lang.String name)

  Specified by:
    `getPropertyValue` in interface `HasProperties`

### setProperty

    public void setProperty(java.lang.String name,
                            java.lang.Object value)
                     throws PropertyNotFoundException

  Specified by:
    `setProperty` in interface `HasProperties`
  Throws:
    `PropertyNotFoundException`

### getProperties

    public Properties getProperties()

  Specified by:
    `getProperties` in interface `HasProperties`

### setProperties

    public void setProperties(Properties properties)

  Specified by:
    `setProperties` in interface `HasProperties`

### sim

    public float sim(IObject io1,
                     IObject io2)

  Calculates the similarity between two IObject:s. Extracts the representation from the matrix.

  Specified by:
    `sim` in class `ISimilarity`

### sim

    public float sim(IObject io,
                     IObjectGroup iog)

  Calculates the similarity between IObject and a IObjectGroup. Extracts the representation from the matrix. Uses the group representation for IObjectGroup:s of all kinds. This takes more time to extract. Therefore it might be better to use the #getGroupRepresentation-method instead...

  Specified by:
    `sim` in class `ISimilarity`

### sim

    public float sim(IObjectGroup iog1,
                     IObjectGroup iog2)

  Calculates the similarity between two IObjectGroup:s. Extracts the representation from the matrix. Uses the group representation for IObjectGroup:s of all kinds. This takes more time to extract. Therefore it might be better to use the #getGroupRepresentation-method instead...

  Specified by:
    `sim` in class `ISimilarity`

### sim

    public <U extends IVectorIndex,V extends IVectorIndex> float sim(IVector<U> vec1,
                                                                     IVector<V> vec2)

  Calculates the similarity between two representations.
  Checks whether the second representation is smaller than first. A small decrease in time is achieved by giving the representation that one believes is smaller as first parameter. (Do not check it also. That increaes time spent.)

  Specified by:
    `sim` in class `SparseISimilarity`

### getRepresentation

    public IVector<IVectorIndex> getRepresentation(IObject io)

  Returns the representation in the form of a IVector.

  Specified by:
    `getRepresentation` in class `SparseISimilarity`

### getGroupRepresentation

    public IVector<IVectorIndex> getGroupRepresentation(IObjectGroup iog)

  Specified by:
    `getGroupRepresentation` in class `SparseISimilarity`

### setIMatrix

    public void setIMatrix(IMatrix matrix)

  Description copied from interface: `NeedsIMatrix`
  Sets the IMatrix.

  Specified by:
    `setIMatrix` in interface `NeedsIMatrix`

### getIMatrix

    public IMatrix getIMatrix()

  Description copied from interface: `NeedsIMatrix`
  Returns the actual IMatrix. (Not a copy.)

  Specified by:
    `getIMatrix` in interface `NeedsIMatrix`

### setIMatrixDimension

    public void setIMatrixDimension(boolean row)

  Description copied from interface: `NeedsIMatrixDimension`
  Sets a boolean that indicates wether the algorithm should consider rows or columns of a matrix. true - rows, false - columns

  Specified by:
    `setIMatrixDimension` in interface `NeedsIMatrixDimension`

### getIMatrixDimension

    public boolean getIMatrixDimension()

  Description copied from interface: `NeedsIMatrixDimension`
  Returns a boolean that indicates wether the algorithm should consider rows or columns of a matrix. true - rows, false - columns

  Specified by:
    `getIMatrixDimension` in interface `NeedsIMatrixDimension`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD