|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.myra.datamining.data.IntervalBuilder
net.sf.myra.datamining.data.AbstractEntropyBasedBuilder
public abstract class AbstractEntropyBasedBuilder
Nested Class Summary |
---|
Nested classes/interfaces inherited from class net.sf.myra.datamining.data.IntervalBuilder |
---|
IntervalBuilder.CutPoint, IntervalBuilder.Interval |
Field Summary |
---|
Fields inherited from class net.sf.myra.datamining.data.IntervalBuilder |
---|
BUILDER, DEFAULT_BUILDER, metadata, MINIMUM, minimumLimit |
Constructor Summary | |
---|---|
AbstractEntropyBasedBuilder(Metadata metadata)
Default constructor. |
Method Summary | |
---|---|
protected double |
average(double value1,
double value2)
|
int |
count(java.util.List<Instance> instances,
ContinuousAttribute attribute)
Returns the number of candidate threshold values. |
protected IntervalBuilder.CutPoint[] |
create(double[][] matrix,
int classes)
Returns candidate cut point(s) given the data distribution. |
protected abstract IntervalBuilder.CutPoint[] |
create(double[][] matrix,
int classes,
boolean filter)
Returns candidate cut point(s) given the data distribution. |
IntervalBuilder.Interval[] |
create(java.util.List<Instance> instances,
ContinuousAttribute attribute)
Returns the discrete intervals for the specified continuous attribute. |
IntervalBuilder.Interval |
createSingle(java.util.List<Instance> instances,
ContinuousAttribute attribute)
Returns an interval for the specified continuous attribute tailored for the specified instance. |
IntervalBuilder.Interval |
createSingle(java.util.List<Instance> instances,
ContinuousAttribute attribute,
java.lang.String label)
Returns a discrete interval for the specified continuous attribute tailored for the specified instances and class value. |
protected int |
diversity(double[][] matrix,
int index,
int length,
int c)
Returns the number of classes (diversity) in the specified range of examples. |
protected double |
entropy(double[][] matrix,
int index,
int length,
int k)
Returns the entropy of the specified range of examples. |
protected void |
sort(double[][] matrix)
Sorts (based on a bubble sort algorithm) the matrix of attribute value -> class value. |
protected double |
weightedLength(double[][] matrix,
int from,
int to)
|
Methods inherited from class net.sf.myra.datamining.data.IntervalBuilder |
---|
getInstance |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractEntropyBasedBuilder(Metadata metadata)
metadata
- the dataset metadata.Method Detail |
---|
public IntervalBuilder.Interval[] create(java.util.List<Instance> instances, ContinuousAttribute attribute)
IntervalBuilder
create
in class IntervalBuilder
instances
- the list of instances.attribute
- the continuous attribute.
public IntervalBuilder.Interval createSingle(java.util.List<Instance> instances, ContinuousAttribute attribute)
createSingle
in class IntervalBuilder
instances
- the list of instances.attribute
- the continuous attribute.
public IntervalBuilder.Interval createSingle(java.util.List<Instance> instances, ContinuousAttribute attribute, java.lang.String label)
createSingle
in class IntervalBuilder
instances
- the list of instances.attribute
- the continuous attribute.label
- the class value.
public int count(java.util.List<Instance> instances, ContinuousAttribute attribute)
IntervalBuilder
count
in class IntervalBuilder
instances
- the list of instances.attribute
- the continuous attribute.
protected void sort(double[][] matrix)
matrix
- the matrix to be sorted.protected double entropy(double[][] matrix, int index, int length, int k)
matrix
- the (values,class) distribution.index
- the start index.length
- the number of position to evaluate.k
- the total number of class values.
protected int diversity(double[][] matrix, int index, int length, int c)
matrix
- the (values,class) distribution.index
- the start index.length
- the number of position to evaluate.c
- the number of classes.
protected double weightedLength(double[][] matrix, int from, int to)
protected double average(double value1, double value2)
protected IntervalBuilder.CutPoint[] create(double[][] matrix, int classes)
matrix
- the (values,class) distribution.classes
- the total number of class values.
protected abstract IntervalBuilder.CutPoint[] create(double[][] matrix, int classes, boolean filter)
matrix
- the (values,class) distribution.classes
- the total number of class values.filter
- indicated if the cut points should be filtered. When
filtering cut points, it is guarenteed that this method will
return 1 or 2 values and when 2 values is returned, the interval
to be selected should be the one between the two values.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |