public class WeightsGenerator
extends java.lang.Object
Constructor | Description |
---|---|
WeightsGenerator() |
Sole constructor
|
Modifier and Type | Method | Description |
---|---|---|
java.util.Hashtable<Field,java.lang.Double> |
generateWeights(WeightsType weightsType,
Field[] classes,
int unionType,
boolean limitNumberOfUnions) |
Generates all weights for a given weights' type, ordered list of decision classes and union's type.
|
public java.util.Hashtable<Field,java.lang.Double> generateWeights(WeightsType weightsType, Field[] classes, int unionType, boolean limitNumberOfUnions)
weightsType
- type of weights used to generate final ranking of examplesclasses
- Ordered (from the worst to the best) array of all decision classes, which can be found in memory container.
Each decision class is present only once.
The order is such that each value in the array is worse than values to the right
being comparable to this value, and better than values to the left being comparable to this value. If two values
are incomparable, then their respective order is not constrained and may be any.
The first decision class (with zero index) has to be worse than any other class.
The last decision class has to be better than any other class.unionType
- determines Type of union for which weight will be returned. Can be Union.ASCENDING
OR Union.DESCENDING
.limitNumberOfUnions
- Tells if 0.0 weights should be added for those PairFields which have worse first element than the second one.
Applicable only if basicClass is an instance of PairField
.InvalidValueException
- when the length of the given list of decision classes is less than two