uk.ac.ed.inf.csb.taweka2010
Class AttributeFactory

java.lang.Object
  extended by uk.ac.ed.inf.csb.taweka2010.AttributeFactory

public class AttributeFactory
extends java.lang.Object

Attribute factory. Produces binary and nominal attributes. A binary attribute is a special nominal attribute with only 2 options: yes/no (present/absent) (zero/one). The attribute name often represents what is present or absent. Example: if the attribute name is a protein domain, the value yes/no represents whether the domain is present or absent in that protein sequence (instance). A nominal attribute is an attribute with a set list of possible string values.

Version:
20 Feb 2008
Author:
Luna De Ferrari luna.deferrari-at-ed.ac.uk

Field Summary
static java.lang.String ABSENT_OPTION
           
static java.lang.String PRESENT_OPTION
           
 
Constructor Summary
AttributeFactory()
           
 
Method Summary
static weka.core.Attribute generateBinaryAttribute(java.lang.String attributeName)
          Generate a binary attribute (yes/no, present/absent)
static weka.core.Attribute generateNominalAttribute(java.lang.String attributeName, java.util.Vector<java.lang.String> values)
          Generate a nominal attribute (with a list of possible values)
static weka.core.Attribute generateNominalAttributeWithDummy(java.lang.String attributeName, java.util.Set<java.lang.String> classValues)
          Generate a nominal attribute (with a list of possible values)
static weka.core.FastVector getBinaryAttributeValuesSet()
          the options for a yes/no, present/absent attribute (beware: "no" has to be the first option for the sparse arff format to work)
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ABSENT_OPTION

public static final java.lang.String ABSENT_OPTION
See Also:
Constant Field Values

PRESENT_OPTION

public static final java.lang.String PRESENT_OPTION
See Also:
Constant Field Values
Constructor Detail

AttributeFactory

public AttributeFactory()
Method Detail

getBinaryAttributeValuesSet

public static weka.core.FastVector getBinaryAttributeValuesSet()
the options for a yes/no, present/absent attribute (beware: "no" has to be the first option for the sparse arff format to work)

Returns:
the vector with the two options

generateBinaryAttribute

public static weka.core.Attribute generateBinaryAttribute(java.lang.String attributeName)
Generate a binary attribute (yes/no, present/absent)

Parameters:
attributeName - the attribute name
Returns:
the weka attribute

generateNominalAttributeWithDummy

public static weka.core.Attribute generateNominalAttributeWithDummy(java.lang.String attributeName,
                                                                    java.util.Set<java.lang.String> classValues)
Generate a nominal attribute (with a list of possible values)

Parameters:
attributeName - the attribute name
Returns:
the weka attribute

generateNominalAttribute

public static weka.core.Attribute generateNominalAttribute(java.lang.String attributeName,
                                                           java.util.Vector<java.lang.String> values)
Generate a nominal attribute (with a list of possible values)

Parameters:
attributeName - the attribute name
Returns:
the weka attribute