public abstract class Discretizer
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected int[] |
classOfInstances
The class of each instances.
|
protected double[][] |
cutPoints
Cut points for each attribute used to discretize them.
|
protected double[][] |
cutPointsTMP
Temporal Cut points.
|
protected double |
inconsistencyThreshold
Inconsistency Threshold.
|
protected boolean[] |
realAttributes
Boolean array identifying which attribute is continuous.
|
protected double[][] |
realValues
For each attribute, stores its values of every instances.
|
| Constructor and Description |
|---|
Discretizer() |
| Modifier and Type | Method and Description |
|---|---|
void |
applyDiscretization(java.lang.String in,
java.lang.String out)
Applies the discretization stored on the cut points.
|
void |
buildCutPoints(InstanceSet is)
Creates the cut points for each attribute with the given dataset.
|
int |
discretize(int attribute,
double value)
Discretizes the given value of the given attribute.
|
protected abstract java.util.Vector |
discretizeAttribute(int attribute,
int[] values,
java.util.Vector<Interval> intervals,
double levelSig)
This abstract method creates the cut points of the attribute given using
its values for each instances given.
|
protected abstract java.util.Vector |
discretizeAttributePreliminary(int attribute,
int[] values,
java.util.Vector<Interval> intervals)
This abstract method creates a preliminary cut points of the attribute given using
its values for each instances given without sigma level.
|
int |
discretizeTMP(int attribute,
double value)
Discretizes the given value of the given attribute with the temporal cut points.
|
double |
getCutPoint(int attribute,
int cp)
Returns the cp-th cut point of the given attribute.
|
int |
getNumIntervals(int attribute)
Returns the number of intervals in the given attribute.
|
double |
inconsistencyCheck(Instance[] instances)
Returns the inconsistency percentage of the given instances.
|
protected abstract java.util.Vector<Interval> |
obtainIntervals(int attribute,
int[] values,
int begin,
int end)
Returns the discretized intervals of the given attribute.
|
protected void |
sortValues(int attribute,
int[] values,
int begin,
int end)
Sorts the instances values of the attribute given.
|
protected double[][] cutPoints
protected double[][] cutPointsTMP
protected double[][] realValues
protected boolean[] realAttributes
protected int[] classOfInstances
protected double inconsistencyThreshold
public void buildCutPoints(InstanceSet is)
is - given dataset.public double inconsistencyCheck(Instance[] instances)
instances - given instances.public void applyDiscretization(java.lang.String in,
java.lang.String out)
in - original dataset filename.out - discretized dataset filename.protected void sortValues(int attribute,
int[] values,
int begin,
int end)
attribute - attribute to be sorted.values - sorted indeces.begin - First position of the section to sort.end - Last position of the section to sort.public int getNumIntervals(int attribute)
attribute - given attribute.public double getCutPoint(int attribute,
int cp)
attribute - given attribute.cp - given cut point index.protected abstract java.util.Vector discretizeAttribute(int attribute,
int[] values,
java.util.Vector<Interval> intervals,
double levelSig)
attribute - given attribute to discretize.values - given attribute values in the dataset.intervals - given intervals.levelSig - Sigma level.protected abstract java.util.Vector discretizeAttributePreliminary(int attribute,
int[] values,
java.util.Vector<Interval> intervals)
attribute - given attribute to discretize.values - given attribute values in the dataset.intervals - given intervals.protected abstract java.util.Vector<Interval> obtainIntervals(int attribute, int[] values, int begin, int end)
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 int discretize(int attribute,
double value)
attribute - given attribute.value - given value to discretize.public int discretizeTMP(int attribute,
double value)
attribute - given attribute.value - given value to discretize.