public class Discretize
extends java.lang.Object
Constructor and Description |
---|
Discretize() |
Modifier and Type | Method and Description |
---|---|
static double |
classInfEntropy(double[] cutPoints,
weka.core.Instances inst)
Compute the class information entropy for the given partition
|
static weka.core.Instance |
copyInst(weka.core.Instance inst)
Returns a copy of the given instance
|
static double[] |
cutPoints(int attr,
weka.core.Instances data,
boolean boundary,
int stop,
double decPlaces,
double thresholdPara)
Computes the cutting Points for the given data set according to Fayyad & Irani extended to a set of pairwise preferences/instances
|
static weka.core.Instances |
discretize(int attr,
double[] cutPoints,
weka.core.Instances data)
Discretizes the values of attribute attr according to the given cutting points
|
static weka.core.Instances |
discretizeAll(weka.core.Instances train,
weka.core.Instances test,
boolean boundary,
int stop,
double decPlaces,
double thresholdPara)
Learns the cutting Points and discretizes the values of all attribute
|
static weka.core.Instances |
discretizeCl(int attr,
double[] cutPoints,
weka.core.Instances data)
Discretizes the values of attribute attr according to the given cutting points (no set of pairwise preferences!)
|
static weka.core.Instance |
discretizeI(int attr,
double[] cutPoints,
weka.core.Instance inst)
Discretize the value of attribute attr according to the given cutting points within an instance
|
static weka.core.Instances |
discretizeL(int attr,
weka.core.Instances data,
boolean boundary,
int stop,
double decPlaces,
double thresholdPara)
Learns the cutting Points and discretizes the values of attribute attr according to the cutting points
|
static weka.core.Instances |
discretizeTest(int attr,
weka.core.Instances train,
weka.core.Instances test,
boolean boundary,
int stop,
double decPlaces,
double thresholdPara)
Learns the cutting Points and discretizes the values of attribute attr according to the cutting points applies them to the test-data set
|
static double[] |
entropy(double[] cutPoints,
weka.core.Instances inst)
Compute the class entropy given the cutting points for every resulting set
|
static double[][] |
intervalComb(double[] points)
Compute every possible (in this context) combination of two intervals generated by a given set of points
|
static double |
lb(double x)
Returns the logarithm with base 2
|
static void |
main(java.lang.String[] args) |
static double |
optCuttingPoint(weka.core.Instances inst,
weka.core.Instances points,
double[] cutPoints,
double thresholdPara)
Evaluate the set of possible cutting Points given and return the best one in terms of entropy (minimal) given the set of cut points
|
static weka.core.Instances |
potCutPoints(weka.core.Instances inst,
boolean boundary,
double detailDeep)
Returns the possible (boundary) cutting points for the given data set
|
static weka.core.Instances |
toPositiv(weka.core.Instances inst)
Transforms all values for all attributes to positive
|
public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
public static weka.core.Instances discretizeAll(weka.core.Instances train, weka.core.Instances test, boolean boundary, int stop, double decPlaces, double thresholdPara) throws java.lang.Exception
attr
- The attribute for which the values shall be discretizeddata
- The data to be discretized (set of pairwise instances!)decPlaces
- The number two cutting points shall at least differ inthresholdPara
- The parameter for the threshold conservativenessjava.lang.Exception
public static weka.core.Instances discretizeTest(int attr, weka.core.Instances train, weka.core.Instances test, boolean boundary, int stop, double decPlaces, double thresholdPara) throws java.lang.Exception
attr
- The attribute for which the values shall be discretizeddata
- The data to be discretized (for attribute attr) (set of pairwise instances!)decPlaces
- The number two cutting points shall at least differ inthresholdPara
- The parameter for the threshold conservativenessjava.lang.Exception
public static weka.core.Instances discretizeL(int attr, weka.core.Instances data, boolean boundary, int stop, double decPlaces, double thresholdPara) throws java.lang.Exception
attr
- The attribute for which the values shall be discretizeddata
- The data to be discretized (for attribute attr) (set of pairwise instances!)decPlaces
- The number two cutting points shall at least differ inthresholdPara
- The parameter for the threshold conservativenessjava.lang.Exception
public static weka.core.Instances discretize(int attr, double[] cutPoints, weka.core.Instances data) throws java.lang.Exception
attr
- The attribute for which the values shall be discretizedcutPoints
- The cutting points for the discretizationdata
- The data to be discretized (for attribute attr) (set of pairwise instances!)java.lang.Exception
public static weka.core.Instances discretizeCl(int attr, double[] cutPoints, weka.core.Instances data) throws java.lang.Exception
attr
- The attribute for which the values shall be discretizedcutPoints
- The cutting points for the discretizationdata
- The data to be discretized (for attribute attr)java.lang.Exception
public static weka.core.Instance discretizeI(int attr, double[] cutPoints, weka.core.Instance inst) throws java.lang.Exception
attr
- The attribute for which the values shall be discretizedcutPoints
- The cutting points for the discretizationinst
- The instance to be discretized (for attribute attr)java.lang.Exception
public static double[] cutPoints(int attr, weka.core.Instances data, boolean boundary, int stop, double decPlaces, double thresholdPara)
attr
- The attrbiute for considerationdata
- The set of pairwise instancesdecPlaces
- The number of decPlaces two cutting Points should differthresholdPara
- The parameter for the threshold conservativenesspublic static double optCuttingPoint(weka.core.Instances inst, weka.core.Instances points, double[] cutPoints, double thresholdPara)
inst
- The pairwise set of attribute values to be evaluatedpoints
- The set of possible cutting pointscutPoints
- The set of cutting points already identifiedthresholdPara
- The parameter for the threshold conservativenesspublic static double classInfEntropy(double[] cutPoints, weka.core.Instances inst)
cutPoints
- The cutting pointsinst
- The instancespublic static double[] entropy(double[] cutPoints, weka.core.Instances inst)
cutPoints
- The cutting pointsinst
- The instancespublic static double[][] intervalComb(double[] points)
points
- The points for the interval borderspublic static weka.core.Instances toPositiv(weka.core.Instances inst)
inst
- The instances to be editedpublic static weka.core.Instances potCutPoints(weka.core.Instances inst, boolean boundary, double detailDeep)
inst
- The pairwise set of attribute value to be evaluatedboundary
- Returns only boundary cutting points if truedetailDeep
- Sets out a level for the granularity of potential cut points (absolute difference)public static weka.core.Instance copyInst(weka.core.Instance inst)
inst
- The instance to be copiedpublic static double lb(double x)
x
- The argument for the computation