Package org.aksw.palmetto.evaluate.rank
Class Ranker
- java.lang.Object
-
- org.aksw.palmetto.evaluate.rank.Ranker
-
public class Ranker extends Object
A class to calculate a ranking for an array of given values.- Author:
- Michael Röder (michael.roeder@uni-paderborn.de)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRanker.AverageRankDeterminerstatic classRanker.MinRankDeterminerstatic interfaceRanker.SharedRankDeterminer
-
Field Summary
Fields Modifier and Type Field Description protected Ranker.SharedRankDeterminerdeterminer
-
Constructor Summary
Constructors Constructor Description Ranker()Ranker(Ranker.SharedRankDeterminer determiner)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private double[]createRanks(double[] sortedValues, int startPos, int endPos, IntUnaryOperator stepFunction)double[]rank(double[] values, boolean sortAscending)Ranks the values in the given array and replaces the values by their rank.
-
-
-
Field Detail
-
determiner
protected Ranker.SharedRankDeterminer determiner
-
-
Constructor Detail
-
Ranker
public Ranker()
-
Ranker
public Ranker(Ranker.SharedRankDeterminer determiner)
-
-
Method Detail
-
rank
public double[] rank(double[] values, boolean sortAscending)Ranks the values in the given array and replaces the values by their rank.- Parameters:
values- an array of the values for which the ranks should be calculated. Note that the values will be replaced by rankssortAscending- a flag indicating whether the values should be sorted in ascending (the lowest value is the best) or descending (the highest value is the best) order.- Returns:
- The given double array with the calculated ranks
-
createRanks
private double[] createRanks(double[] sortedValues, int startPos, int endPos, IntUnaryOperator stepFunction)
-
-