net.sf.myra.datamining.data
Class ContinuousAttribute

java.lang.Object
  extended by net.sf.myra.datamining.data.Attribute
      extended by net.sf.myra.datamining.data.ContinuousAttribute
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<Attribute>

public class ContinuousAttribute
extends Attribute

This class represents a continuous attribute.

Author:
Fernando Esteban Barril Otero
See Also:
Serialized Form

Constructor Summary
ContinuousAttribute(java.lang.String name)
          Creates a new ContinuousAttribute instance.
 
Method Summary
 ContinuousAttribute clone()
           
 java.lang.Double[] domain()
          Returns the domain values of this attribute.
 void domain(Dataset dataset)
          Populates the domain values of this attribute.
 double entropy(java.util.List<Instance> instances)
          Returns the (expected) entropy of this attribute.
 IntervalBuilder.Interval getInitial()
          Returns the interval previously calculated.
 boolean isMissing(double value)
          Checks if the specified value corresponds to a missing value.
 double mean(java.util.List<Instance> instances)
          Returns the mean value of this attribute.
 void setInitial(IntervalBuilder.Interval initial)
           
 java.lang.String toString()
           
 void validate(java.lang.String value)
          Checks of the current value belongs to the attribute's domain.
 
Methods inherited from class net.sf.myra.datamining.data.Attribute
compareTo, equals, equals, getName, hashCode, isTarget, setName
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ContinuousAttribute

public ContinuousAttribute(java.lang.String name)
Creates a new ContinuousAttribute instance.

Parameters:
name - the attribute name.
Method Detail

getInitial

public IntervalBuilder.Interval getInitial()
Returns the interval previously calculated.

Returns:
the interval previously calculated.

setInitial

public void setInitial(IntervalBuilder.Interval initial)
Parameters:
initial - the initial to set

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

validate

public void validate(java.lang.String value)
Description copied from class: Attribute
Checks of the current value belongs to the attribute's domain.

Specified by:
validate in class Attribute
Parameters:
value - to value to check.

isMissing

public boolean isMissing(double value)
Description copied from class: Attribute
Checks if the specified value corresponds to a missing value.

Specified by:
isMissing in class Attribute
Parameters:
value - the value to check.
Returns:
true if the specified value corresponds to a missing value; false otherwise.

entropy

public double entropy(java.util.List<Instance> instances)
Returns the (expected) entropy of this attribute. Note that this method will call setInitial(IntervalBuilder.Interval) with the calculated interval.

Parameters:
instances - the instances used to compute the entropy.
Returns:
the (expected) entropy.

mean

public double mean(java.util.List<Instance> instances)
Returns the mean value of this attribute.

Parameters:
instances - the instances used to compute the mean.
Returns:
the mean value of this attribute.

domain

public java.lang.Double[] domain()
Returns the domain values of this attribute.

Returns:
the domain values of this attribute.

domain

public void domain(Dataset dataset)
Populates the domain values of this attribute.

Parameters:
dataset - the current dataset.

clone

public ContinuousAttribute clone()
Overrides:
clone in class Attribute


Copyright © 2013. All Rights Reserved.