org.aksw.simba.benchmark

## Class Similarity

- java.lang.Object
- - org.aksw.simba.benchmark.Similarity

-     public class Similarity
      extends java.lang.Object

  Calculate the Similarity between the benchmark and log queries
  Author:
    Saleem

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Similarity()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static java.util.List<java.lang.Double[]>` | `getDimensionWiseBenchmarkVectors(java.util.Map<java.lang.String,java.lang.Double[]> normalizedVectors, java.util.Set<java.lang.String> benchmarkQueriesIds)` Get the dimension-wise vectors of the the normalized selected benchmark queries
    `static java.util.List<java.lang.Double[]>` | `getDimensionWiseLogVectors(java.util.Map<java.lang.String,java.lang.Double[]> normalizedVectors)` Get the dimension-wise vectors of the the normalized Log vectors
    `static double` | `getError(java.lang.Double[] logVector, java.lang.Double[] benchmarkVector)` Get either S.D or Mean Errors
    `static double` | `getMean(java.lang.Double[] vector)` Get the mean of the vector values
    `static java.lang.Double[]` | `getMeanVector(java.util.List<java.lang.Double[]> vectors)` Get vector of Means
    `static java.lang.Double` | `getSimilarityScore(java.util.Map<java.lang.String,java.lang.Double[]> normalizedVectors, java.util.Set<java.lang.String> benchmarkQueriesIds)` Get similarity score between log and benchmark queries
    `static double` | `getStandardDeviation(java.lang.Double[] vector)` Calculate standard deviation of given vector
    `static java.lang.Double[]` | `getStandardDeviationVector(java.util.List<java.lang.Double[]> vectors)` Get vector of S.Ds
    `static void` | `main(java.lang.String[] args)`

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

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

- - ### Constructor Detail

    - #### Similarity

          public Similarity()

  - ### Method Detail

    - #### main

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

    - #### getSimilarityScore

          public static java.lang.Double getSimilarityScore(java.util.Map<java.lang.String,java.lang.Double[]> normalizedVectors,
                                                            java.util.Set<java.lang.String> benchmarkQueriesIds)

      Get similarity score between log and benchmark queries
      Parameters:
        `normalizedVectors` - Normalized vectors of log queries
        `benchmarkQueriesIds` - query Ids of benchmark queries
      Returns:
        similarity score

    - #### getError

          public static double getError(java.lang.Double[] logVector,
                                        java.lang.Double[] benchmarkVector)

      Get either S.D or Mean Errors
      Parameters:
        `logVector` - Log vectors of mean or S.D
        `benchmarkVector` - benchmark vectors of mean or S.D
      Returns:
        error value

    - #### getStandardDeviationVector

          public static java.lang.Double[] getStandardDeviationVector(java.util.List<java.lang.Double[]> vectors)

      Get vector of S.Ds
      Parameters:
        `vectors` - List of Vectors
      Returns:
        vector of S.Ds

    - #### getMeanVector

          public static java.lang.Double[] getMeanVector(java.util.List<java.lang.Double[]> vectors)

      Get vector of Means
      Parameters:
        `vectors` - List of Vectors
      Returns:
        vector of means

    - #### getDimensionWiseBenchmarkVectors

          public static java.util.List<java.lang.Double[]> getDimensionWiseBenchmarkVectors(java.util.Map<java.lang.String,java.lang.Double[]> normalizedVectors,
                                                                                            java.util.Set<java.lang.String> benchmarkQueriesIds)

      Get the dimension-wise vectors of the the normalized selected benchmark queries
      Parameters:
        `normalizedVectors` - Map of query ids to corresponding normalized vectors
        `queriesIds` - Selected Benchmakr queries ids
      Returns:
        List of dimension wise vectors

    - #### getDimensionWiseLogVectors

          public static java.util.List<java.lang.Double[]> getDimensionWiseLogVectors(java.util.Map<java.lang.String,java.lang.Double[]> normalizedVectors)

      Get the dimension-wise vectors of the the normalized Log vectors
      Parameters:
        `normalizedVectors` - Map of query ids to corresponding normalized vectors
      Returns:
        List of dimension wise vectors

    - #### getStandardDeviation

          public static double getStandardDeviation(java.lang.Double[] vector)

      Calculate standard deviation of given vector
      Parameters:
        `vector` - Vector
      Returns:
        Standard Deviation

    - #### getMean

          public static double getMean(java.lang.Double[] vector)

      Get the mean of the vector values
      Parameters:
        `vector` - Vector
      Returns:
        Mean