net.sf.myra.datamining.data
Class AbstractDistanceBasedBuilder

java.lang.Object
  extended by net.sf.myra.datamining.data.IntervalBuilder
      extended by net.sf.myra.datamining.data.AbstractDistanceBasedBuilder
Direct Known Subclasses:
DistanceIntervalBuilder, MDLDistanceIntervalBuilder

public abstract class AbstractDistanceBasedBuilder
extends IntervalBuilder

Version:
$Revision: 2304 $ $Date:: 2010-08-06 23:58:15#$
Author:
Fernando Esteban Barril Otero

Nested Class Summary
protected static class AbstractDistanceBasedBuilder.Candidate
          Struct-like class to represent the label information of an instance.
 
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
AbstractDistanceBasedBuilder(Metadata metadata)
          Default constructor.
 
Method Summary
protected  int count(AbstractDistanceBasedBuilder.Candidate[] candidates, int index, int length)
          Returns the number of different class labels present in the specified distribution.
 int count(java.util.List<Instance> instances, ContinuousAttribute attribute)
          Returns the number of candidate threshold values.
protected abstract  IntervalBuilder.CutPoint[] create(AbstractDistanceBasedBuilder.Candidate[] candidates, 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 instances.
 IntervalBuilder.Interval createSingle(java.util.List<Instance> instances, ContinuousAttribute attribute, java.lang.String c)
          Returns a discrete interval for the specified continuous attribute tailored for the specified instances and class value.
 double variance(AbstractDistanceBasedBuilder.Candidate[] candidates, int index, int length)
          Returns the variance of the specified class values distribution.
 double variance(AbstractDistanceBasedBuilder.Candidate[] candidates, int index, int length, double[] mean)
          Returns the variance of the specified class values distribution.
 
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

AbstractDistanceBasedBuilder

public AbstractDistanceBasedBuilder(Metadata metadata)
Default constructor.

Parameters:
metadata - the dataset metadata.
Method Detail

create

public IntervalBuilder.Interval[] create(java.util.List<Instance> instances,
                                         ContinuousAttribute attribute)
Description copied from class: IntervalBuilder
Returns the discrete intervals for the specified continuous attribute.

Specified by:
create in class IntervalBuilder
Parameters:
instances - the list of instances.
attribute - the continuous attribute.
Returns:
the discrete intervals for the specified continuous attribute.

createSingle

public IntervalBuilder.Interval createSingle(java.util.List<Instance> instances,
                                             ContinuousAttribute attribute)
Description copied from class: IntervalBuilder
Returns an interval for the specified continuous attribute tailored for the specified instances.

Specified by:
createSingle in class IntervalBuilder
Parameters:
instances - the list of instances.
attribute - the continuous attribute.
Returns:
an interval for the specified continuous attribute tailored for the specified instance.

createSingle

public IntervalBuilder.Interval createSingle(java.util.List<Instance> instances,
                                             ContinuousAttribute attribute,
                                             java.lang.String c)
Description copied from class: IntervalBuilder
Returns a discrete interval for the specified continuous attribute tailored for the specified instances and class value. The instances are arranged into a binary distribution (i.e. instances that belong to the specified class and instances that do not belong to the specified class). Note that this operation may not be supporter by all interval builders.

Specified by:
createSingle in class IntervalBuilder
Parameters:
instances - the list of instances.
attribute - the continuous attribute.
c - the class label.
Returns:
a discrete interval for the specified continuous attribute tailored for the specified instances and class value.

count

public int count(java.util.List<Instance> instances,
                 ContinuousAttribute attribute)
Description copied from class: IntervalBuilder
Returns the number of candidate threshold values.

Specified by:
count in class IntervalBuilder
Parameters:
instances - the list of instances.
attribute - the continuous attribute.
Returns:
the number of candidate threshold values.

create

protected abstract IntervalBuilder.CutPoint[] create(AbstractDistanceBasedBuilder.Candidate[] candidates,
                                                     boolean filter)
Returns candidate cut point(s) given the data distribution.

Parameters:
candidates - the data distribution.
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.
Returns:
candidate cut point(s) given the data distribution.

count

protected int count(AbstractDistanceBasedBuilder.Candidate[] candidates,
                    int index,
                    int length)
Returns the number of different class labels present in the specified distribution.

Parameters:
candidates - the candidate points distributions.
index - the initial index.
length - the number of candidate points to consider.
Returns:
the number of different class labels present in the specified distribution.

variance

public double variance(AbstractDistanceBasedBuilder.Candidate[] candidates,
                       int index,
                       int length)
Returns the variance of the specified class values distribution.

Parameters:
candidates - the class values distribution.
index - the start index of the distribution.
length - the number of candidates to be includes in the evaluation.
Returns:
the variance of the specified class values distribution.

variance

public double variance(AbstractDistanceBasedBuilder.Candidate[] candidates,
                       int index,
                       int length,
                       double[] mean)
Returns the variance of the specified class values distribution.

Parameters:
candidates - the class values distribution.
index - the start index of the distribution.
length - the number of candidates to be includes in the evaluation.
Returns:
the variance of the specified class values distribution.


Copyright © 2013. All Rights Reserved.