de.hpi.fgis.dude.similarityfunction.contentbased.calculationstrategy
Class AverageArrayArrayStrategy
java.lang.Object
de.hpi.fgis.dude.similarityfunction.contentbased.calculationstrategy.AverageArrayArrayStrategy
- All Implemented Interfaces:
- CalculationStrategy<JsonArray,JsonArray>
public class AverageArrayArrayStrategy
- extends Object
- implements CalculationStrategy<JsonArray,JsonArray>
Calculates the average similarity of the arrays' elements (e.g. the first element of array #1 is compared with the first element of array #2, the
second elements are compared with each other etc.). The similarities are added to each other and the over-all sum is divided by the size of the
larger array.
- Author:
- Matthias Pohl
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AverageArrayArrayStrategy
public AverageArrayArrayStrategy()
calculateSimilarity
public double calculateSimilarity(ContentBasedSimilarityFunction<?> similarityFunction,
JsonArray arr1,
JsonArray arr2)
- Description copied from interface:
CalculationStrategy
- Calculates the similarity of the passed values.
- Specified by:
calculateSimilarity
in interface CalculationStrategy<JsonArray,JsonArray>
- Parameters:
similarityFunction
- The SimilarityFunction
that is used for atomic values within this strategy.arr1
- The first value.arr2
- The second value.
- Returns:
- Returns the similarity of the passed values.
Copyright © 2011 Hasso Plattner Institute - Chair of Information Systems. All Rights Reserved.