|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectweka.attributeSelection.ASEvaluation
weka.attributeSelection.UnsupervisedAttributeEvaluator
weka.attributeSelection.PrincipalComponents
public class PrincipalComponents
Performs a principal components analysis and transformation of the data. Use in conjunction with a Ranker search. Dimensionality reduction is accomplished by choosing enough eigenvectors to account for some percentage of the variance in the original data---default 0.95 (95%). Attribute noise can be filtered by transforming to the PC space, eliminating some of the worst eigenvectors, and then transforming back to the original space.
Valid options are:-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 Summary | |
|---|---|
PrincipalComponents()
|
|
| Method Summary | |
|---|---|
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 |
| Methods inherited from class weka.attributeSelection.ASEvaluation |
|---|
forName, makeCopies, postProcess |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public PrincipalComponents()
| Method Detail |
|---|
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 OptionHandleroptions - the list of options as an array of strings
java.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 OptionHandlerpublic Capabilities getCapabilities()
getCapabilities in interface CapabilitiesHandlergetCapabilities in class ASEvaluationCapabilities
public void buildEvaluator(Instances data)
throws java.lang.Exception
buildEvaluator in class ASEvaluationdata - the instances to analyse/transform
java.lang.Exception - if analysis fails
public Instances transformedHeader()
throws java.lang.Exception
transformedHeader in interface AttributeTransformerjava.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 AttributeTransformerjava.lang.Exception - if transformed data can't be returned
public double evaluateAttribute(int att)
throws java.lang.Exception
evaluateAttribute in interface AttributeEvaluatoratt - the attribute to be evaluated
java.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 AttributeTransformerinstance - an instance in the original (unormalized) format
java.lang.Exception - if instance cant be transformedpublic java.lang.String getRevision()
getRevision in interface RevisionHandlergetRevision in class ASEvaluationpublic static void main(java.lang.String[] argv)
argv - should contain the command line arguments to the
evaluator/transformer (see AttributeSelection)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||