public class PrincipalComponents extends UnsupervisedAttributeEvaluator implements AttributeTransformer, OptionHandler
-D Don't normalize input data.
-R Retain enough PC attributes to account for this proportion of variance in the original data. (default = 0.95)
-O Transform through the PC space and back to the original space.
-A Maximum number of attributes to include in transformed attribute names. (-1 = include all)
Constructor and Description |
---|
PrincipalComponents() |
Modifier and Type | Method and Description |
---|---|
void |
buildEvaluator(Instances data)
Initializes principal components and performs the analysis
|
java.lang.String |
centerDataTipText()
Returns the tip text for this property
|
Instance |
convertInstance(Instance instance)
Transform an instance in original (unormalized) format.
|
double |
evaluateAttribute(int att)
Evaluates the merit of a transformed attribute.
|
Capabilities |
getCapabilities()
Returns the capabilities of this evaluator.
|
boolean |
getCenterData()
Get whether to center (rather than standardize)
the data.
|
int |
getMaximumAttributeNames()
Gets maximum number of attributes to include in
transformed attribute names.
|
java.lang.String[] |
getOptions()
Gets the current settings of PrincipalComponents
|
java.lang.String |
getRevision()
Returns the revision string.
|
boolean |
getTransformBackToOriginal()
Gets whether the data is to be transformed back to the original
space.
|
double |
getVarianceCovered()
Gets the proportion of total variance to account for when
retaining principal components
|
java.lang.String |
globalInfo()
Returns a string describing this attribute transformer
|
java.util.Enumeration |
listOptions()
Returns an enumeration describing the available options.
|
static void |
main(java.lang.String[] argv)
Main method for testing this class
|
java.lang.String |
maximumAttributeNamesTipText()
Returns the tip text for this property
|
void |
setCenterData(boolean center)
Set whether to center (rather than standardize)
the data.
|
void |
setMaximumAttributeNames(int m)
Sets maximum number of attributes to include in
transformed attribute names.
|
void |
setOptions(java.lang.String[] options)
Parses a given list of options.
|
void |
setTransformBackToOriginal(boolean b)
Sets whether the data should be transformed back to the original
space
|
void |
setVarianceCovered(double vc)
Sets the amount of variance to account for when retaining
principal components
|
java.lang.String |
toString()
Returns a description of this attribute transformer
|
java.lang.String |
transformBackToOriginalTipText()
Returns the tip text for this property
|
Instances |
transformedData(Instances data)
Gets the transformed training data.
|
Instances |
transformedHeader()
Returns just the header for the transformed data (ie.
|
java.lang.String |
varianceCoveredTipText()
Returns the tip text for this property
|
clean, forName, makeCopies, postProcess
public java.lang.String globalInfo()
public java.util.Enumeration listOptions()
listOptions
in interface OptionHandler
public void setOptions(java.lang.String[] options) throws java.lang.Exception
-D Don't normalize input data.
-R Retain enough PC attributes to account for this proportion of variance in the original data. (default = 0.95)
-O Transform through the PC space and back to the original space.
-A Maximum number of attributes to include in transformed attribute names. (-1 = include all)
setOptions
in interface OptionHandler
options
- the list of options as an array of stringsjava.lang.Exception
- if an option is not supportedpublic java.lang.String centerDataTipText()
public void setCenterData(boolean center)
center
- true if the data is to be
centered rather than standardizedpublic boolean getCenterData()
public java.lang.String varianceCoveredTipText()
public void setVarianceCovered(double vc)
vc
- the proportion of total variance to account forpublic double getVarianceCovered()
public java.lang.String maximumAttributeNamesTipText()
public void setMaximumAttributeNames(int m)
m
- the maximum number of attributespublic int getMaximumAttributeNames()
public java.lang.String transformBackToOriginalTipText()
public void setTransformBackToOriginal(boolean b)
b
- true if the data should be transformed back to the
original spacepublic boolean getTransformBackToOriginal()
public java.lang.String[] getOptions()
getOptions
in interface OptionHandler
public Capabilities getCapabilities()
getCapabilities
in interface CapabilitiesHandler
getCapabilities
in class ASEvaluation
Capabilities
public void buildEvaluator(Instances data) throws java.lang.Exception
buildEvaluator
in class ASEvaluation
data
- the instances to analyse/transformjava.lang.Exception
- if analysis failspublic Instances transformedHeader() throws java.lang.Exception
transformedHeader
in interface AttributeTransformer
java.lang.Exception
- if the header of the transformed data can't
be determined.public Instances transformedData(Instances data) throws java.lang.Exception
transformedData
in interface AttributeTransformer
java.lang.Exception
- if transformed data can't be returnedpublic double evaluateAttribute(int att) throws java.lang.Exception
evaluateAttribute
in interface AttributeEvaluator
att
- the attribute to be evaluatedjava.lang.Exception
- if attribute can't be evaluatedpublic java.lang.String toString()
toString
in class java.lang.Object
public Instance convertInstance(Instance instance) throws java.lang.Exception
convertInstance
in interface AttributeTransformer
instance
- an instance in the original (unormalized) formatjava.lang.Exception
- if instance cant be transformedpublic java.lang.String getRevision()
getRevision
in interface RevisionHandler
getRevision
in class ASEvaluation
public static void main(java.lang.String[] argv)
argv
- should contain the command line arguments to the
evaluator/transformer (see AttributeSelection)