org.aksw.simba.benchmark.clustring

## Class QueryClustering

- java.lang.Object
- - org.aksw.simba.benchmark.clustring.QueryClustering

-     public class QueryClustering
      extends java.lang.Object

  Call getPrototypicalQueries will return a set of size nrExemplars that contains the ids of the most representative points queries for the given set of points
  Author:
    ngonga

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `(package private) java.util.Map<java.lang.String,java.lang.Double>` | `distanceCache`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `QueryClustering()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.Double[]` | `getAverage(java.util.Map<java.lang.String,java.lang.Double[]> vectors)` Computes average vector for a given set of vectors
    `double` | `getDistance(java.lang.Double[] a, java.lang.Double[] b)` Compute the distance between two queries
    `double` | `getDistanceFromCache(java.util.Map<java.lang.String,java.lang.Double[]> vectors, java.lang.String ex, java.lang.String v)` Get dostamce from cache
    `java.util.Set<java.lang.String>` | `getExemplars(java.util.Map<java.lang.String,java.lang.Double[]> vectors, int nrExemplars)` Get examplars for the set of queries
    `java.util.Set<java.lang.String>` | `getPrototypicalQueries(java.util.Map<java.lang.String,java.lang.Double[]> vectors, int nrExemplars)` Return a set of size nrExemplars that contains the ids of the most representative points queries for the given set of points
    `void` | `loadExemplarsVectors(java.util.Map<java.lang.String,java.lang.Double[]> vectors, java.util.Set<java.lang.String> exemplars)` Load centers to be used for plotting voronoi diagram
    `static void` | `main(java.lang.String[] args)`
    `static void` | `test()`

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

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

- - ### Field Detail

    - #### distanceCache

          java.util.Map<java.lang.String,java.lang.Double> distanceCache

  - ### Constructor Detail

    - #### QueryClustering

          public QueryClustering()

  - ### Method Detail

    - #### getPrototypicalQueries

          public java.util.Set<java.lang.String> getPrototypicalQueries(java.util.Map<java.lang.String,java.lang.Double[]> vectors,
                                                                        int nrExemplars)

      Return a set of size nrExemplars that contains the ids of the most representative points queries for the given set of points
      Parameters:
        `vectors` -
        `nrExemplars` -
      Returns:

    - #### loadExemplarsVectors

          public void loadExemplarsVectors(java.util.Map<java.lang.String,java.lang.Double[]> vectors,
                                           java.util.Set<java.lang.String> exemplars)

      Load centers to be used for plotting voronoi diagram
      Parameters:
        `vectors` - Map of all vectors
        `exemplars` - set of exemplars

    - #### getExemplars

          public java.util.Set<java.lang.String> getExemplars(java.util.Map<java.lang.String,java.lang.Double[]> vectors,
                                                              int nrExemplars)

      Get examplars for the set of queries
      Parameters:
        `vectors` - Vectors of queries
        `nrExemplars` - Number of required Examplers
      Returns:
        examplars Examplers

    - #### getAverage

          public java.lang.Double[] getAverage(java.util.Map<java.lang.String,java.lang.Double[]> vectors)

      Computes average vector for a given set of vectors
      Parameters:
        `vectors` - Set of vectors
      Returns:
        Average

    - #### getDistanceFromCache

          public double getDistanceFromCache(java.util.Map<java.lang.String,java.lang.Double[]> vectors,
                                             java.lang.String ex,
                                             java.lang.String v)

      Get dostamce from cache
      Parameters:
        `vectors` - Vectors
        `ex` - exampler
        `v` - vector
      Returns:
        distinace

    - #### getDistance

          public double getDistance(java.lang.Double[] a,
                                    java.lang.Double[] b)

      Compute the distance between two queries
      Parameters:
        `a` - First query
        `b` - Second query
      Returns:
        Distance

    - #### test

          public static void test()

    - #### main

          public static void main(java.lang.String[] args)