net.sf.myra.datamining.data
Class IntervalBuilder

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

public abstract class IntervalBuilder
extends java.lang.Object

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

Nested Class Summary
protected static class IntervalBuilder.CutPoint
          Struct-like class that represents a cut point.
static class IntervalBuilder.Interval
          This class represents a continuous interval.
 
Field Summary
static java.lang.String BUILDER
          The property key under which the interval builder class name is stored.
static java.lang.String DEFAULT_BUILDER
          Default interval builder (entropy).
protected  Metadata metadata
          The dataset metadata.
static java.lang.String MINIMUM
          The property key under which the minimum number of exemples per interval is stored.
protected  double minimumLimit
          The minimum number of instance per interval.
 
Constructor Summary
IntervalBuilder(Metadata metadata)
          Default constructor.
 
Method Summary
abstract  int count(java.util.List<Instance> instances, ContinuousAttribute attribute)
          Returns the number of candidate threshold values.
abstract  IntervalBuilder.Interval[] create(java.util.List<Instance> instances, ContinuousAttribute attribute)
          Returns the discrete intervals for the specified continuous attribute.
abstract  IntervalBuilder.Interval createSingle(java.util.List<Instance> instances, ContinuousAttribute attribute)
          Returns an interval for the specified continuous attribute tailored for the specified instances.
abstract  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.
static IntervalBuilder getInstance(Metadata metadata)
          Returns the default interval builder instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BUILDER

public static final java.lang.String BUILDER
The property key under which the interval builder class name is stored.

See Also:
Constant Field Values

MINIMUM

public static final java.lang.String MINIMUM
The property key under which the minimum number of exemples per interval is stored.

See Also:
Constant Field Values

DEFAULT_BUILDER

public static final java.lang.String DEFAULT_BUILDER
Default interval builder (entropy).


metadata

protected Metadata metadata
The dataset metadata.


minimumLimit

protected final double minimumLimit
The minimum number of instance per interval.

Constructor Detail

IntervalBuilder

public IntervalBuilder(Metadata metadata)
Default constructor.

Parameters:
metadata - the dataset metadata.
Method Detail

getInstance

public static IntervalBuilder getInstance(Metadata metadata)
Returns the default interval builder instance.

Returns:
the default interval builder instance.

createSingle

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

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 abstract 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. 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.

Parameters:
instances - the list of instances.
attribute - the continuous attribute.
label - the class label.
Returns:
a discrete interval for the specified continuous attribute tailored for the specified instances and class value.

create

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

Parameters:
instances - the list of instances.
attribute - the continuous attribute.
Returns:
the discrete intervals for the specified continuous attribute.

count

public abstract int count(java.util.List<Instance> instances,
                          ContinuousAttribute attribute)
Returns the number of candidate threshold values.

Parameters:
instances - the list of instances.
attribute - the continuous attribute.
Returns:
the number of candidate threshold values.


Copyright © 2013. All Rights Reserved.