public class Khiops extends Discretizer
classOfInstances, cutPoints, iClassIndex, realAttributes, realValues
Constructor and Description |
---|
Khiops()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
double |
chi2RowValues(java.util.Vector disc,
int[] values)
Creates the initial chi square value of the initial discretization scheme.
|
java.util.Vector |
createCP(java.util.Vector intervals)
Construct an array of cutpoints from the set of intervals.
|
protected java.util.Vector |
discretizeAttribute(int attribute,
int[] values,
int begin,
int end)
This abstract method creates the cut points of the attribute given using
its values for each instances given.
|
double |
mergeCostVariation(java.util.ArrayList<java.lang.Double> na,
int indexna,
double naChi2,
java.util.ArrayList<java.lang.Double> nb,
int indexnb,
double nbChi2,
int[] values)
Computes the cost derived form merging two adjacent intervals na and nb
|
double |
mergedRowChi2Value(java.util.ArrayList<java.lang.Double> mergedInterval,
int index,
int[] values)
This method calculates the contribution to the global chi square value
of a new interval (produced by merging two adjacent ones).
|
applyDiscretization, buildCutPoints, discretize, getCutPoint, getNumIntervals, sortValues
protected java.util.Vector discretizeAttribute(int attribute, int[] values, int begin, int end)
Discretizer
discretizeAttribute
in class Discretizer
attribute
- given attribute to discretize.values
- given attribute values in the dataset.begin
- First position of the section to discretize.end
- Last position of the section to discretize.public double mergeCostVariation(java.util.ArrayList<java.lang.Double> na, int indexna, double naChi2, java.util.ArrayList<java.lang.Double> nb, int indexnb, double nbChi2, int[] values)
na
- Interval to the left to mergeindexna
- Index of the first element of na in the whole list of real valuesnaChi2
- number of intervalsnb
- Right interval to mergeindexnb
- Index of the first element of nb in the whole list of real valuesnbChi2
- Current number of intervals (the total intervals prior to the merging)values
- Array in which position i there is the number of instance which explanatory (real) value has rank i after sortingpublic double chi2RowValues(java.util.Vector disc, int[] values)
disc
- the initial discretization scheme (one interval for each different value)values
- the global array of values (sorted)public double mergedRowChi2Value(java.util.ArrayList<java.lang.Double> mergedInterval, int index, int[] values)
mergedInterval
- the new intervalindex
- the index of the first element (left-most one) value in the global array of valuesvalues
- the global array of valuespublic java.util.Vector createCP(java.util.Vector intervals)
intervals
- Vector which contains the intervals in ArrayList format