public class Tools
extends java.lang.Object
Constructor and Description |
---|
Tools() |
Modifier and Type | Method and Description |
---|---|
static int |
cardinality(int number,
int index)
Returns the cardinality for the given set (disorderly drawing without lay back)
|
static int[] |
childAttributes(int[][][] ruleTree,
int stage,
int position,
int deep)
Returns the different child attributes for a given node at position and stage (Attention: only for case groupint = 1 applicable)
|
static int[][] |
combinations(int number,
int index)
Returns the set of all possible combinations for the given amount of attributes and max grouping size
|
static boolean |
compare(int[] attributes,
int[] arrayOne,
int[] arrayTwo,
weka.core.Instance instanceC)
Compares the two given array values to the given instance
|
static double[] |
distAttrDoubleVals(weka.core.Instances data,
int attr)
Returns the distinct values (double) for the given attribute in the set of pairwise preferences
|
static int[][] |
distAttrVals(weka.core.Instances data,
int[] attr)
Returns the distinct values for the given attributes in the set of pairwise preferences
|
static int[] |
makeUnique(int[] a)
Removes duplicate entries and dummies ("99") in the given array
|
static int |
match(int[] attributes,
int[] arrayOne,
weka.core.Instance instanceC)
Compares the given array values to the given instance
|
static int[][] |
restrCombinations(int number,
int index,
int[] attributes)
Returns the set of all possible combinations for the given amount of the given attributes and max grouping size
|
static boolean |
sameVals(int[] attributes,
weka.core.Instance instanceC)
Compares the pairwise preference w.r.t. to the attributes given
|
static weka.core.Instances |
transformData(weka.core.Instances input)
Transform a classification data set into a set of pairwise preferences as needed
|
public static weka.core.Instances transformData(weka.core.Instances input) throws java.lang.Exception
file_Location
- the location of the file which is to be transformedjava.lang.Exception
public static boolean sameVals(int[] attributes, weka.core.Instance instanceC)
attributes
- The respective attributesinstanceC
- The instance to be compared w.r.t. to attributespublic static boolean compare(int[] attributes, int[] arrayOne, int[] arrayTwo, weka.core.Instance instanceC)
attributes
- The respective attributesarrayOne
- The first array to be comparedarrayTwo
- The second array to be comparedinstanceC
- The instance to be compared with the arrayspublic static int match(int[] attributes, int[] arrayOne, weka.core.Instance instanceC)
attributes
- The respective attributesarrayOne
- The first array to be comparedinstanceC
- The instance to be compared with the arrayspublic static int[] childAttributes(int[][][] ruleTree, int stage, int position, int deep)
stage
- The stage of the parent nodeposition
- The position in the stage node of parent nodedeep
- The stages to be consideredpublic static int[] makeUnique(int[] a)
a
- The array to be editedpublic static int cardinality(int number, int index)
number
- The amount of "drawings"index
- The number of objects to be consideredpublic static int[][] restrCombinations(int number, int index, int[] attributes)
number
- The maximal "grouping size" (=maximal amount of attributes per set)index
- The index of the last attribute to be considered (assumption: A1, A2,... AIndex)attributes
- The attribute indices to be consideredpublic static int[][] combinations(int number, int index)
number
- The maximal "grouping size" (=maximal amount of attributes per set)index
- The index of the last attribute to be considered (assumption: A1, A2,... AIndex)public static int[][] distAttrVals(weka.core.Instances data, int[] attr)
data
- The data for exploration (set of pairwise preferences)attr
- The attributes for explorationpublic static double[] distAttrDoubleVals(weka.core.Instances data, int attr)
data
- The data for exploration (set of pairwise preferences)attr
- The attributes for exploration