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 int |
iClassIndex
Class index in the dataset.
|
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,
int begin,
int end)
This abstract method creates the cut points of the attribute given using
its values for each instances given.
|
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.
|
protected void |
sortValues(int attribute,
int[] values,
int begin,
int end)
Sorts the instances values of the attribute given.
|
protected double[][] cutPoints
protected double[][] realValues
protected boolean[] realAttributes
protected int[] classOfInstances
protected int iClassIndex
public void buildCutPoints(InstanceSet is)
is
- given dataset.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, 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.