public class PrincipalComponents extends Filter implements OptionHandler, UnsupervisedFilter
-C Center (rather than standardize) the data and compute PCA using the covariance (rather than the correlation) matrix.
-R <num> Retain enough PC attributes to account for this proportion of variance in the original data. (default: 0.95)
-A <num> Maximum number of attributes to include in transformed attribute names. (-1 = include all, default: 5)
-M <num> Maximum number of PC attributes to retain. (-1 = include all, default: -1)
| Constructor and Description |
|---|
PrincipalComponents() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
batchFinished()
Signify that this batch of input to the filter is finished.
|
java.lang.String |
centerDataTipText()
Returns the tip text for this property
|
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.
|
int |
getMaximumAttributes()
Gets maximum number of PC attributes to retain.
|
java.lang.String[] |
getOptions()
Gets the current settings of the filter.
|
java.lang.String |
getRevision()
Returns the revision string.
|
double |
getVarianceCovered()
Gets the proportion of total variance to account for when retaining
principal components.
|
java.lang.String |
globalInfo()
Returns a string describing this filter.
|
boolean |
input(Instance instance)
Input an instance for filtering.
|
java.util.Enumeration<Option> |
listOptions()
Returns an enumeration describing the available options.
|
static void |
main(java.lang.String[] args)
Main method for running this filter.
|
java.lang.String |
maximumAttributeNamesTipText()
Returns the tip text for this property.
|
java.lang.String |
maximumAttributesTipText()
Returns the tip text for this property.
|
void |
setCenterData(boolean center)
Set whether to center (rather than standardize) the data.
|
boolean |
setInputFormat(Instances instanceInfo)
Sets the format of the input instances.
|
void |
setMaximumAttributeNames(int value)
Sets maximum number of attributes to include in transformed attribute
names.
|
void |
setMaximumAttributes(int value)
Sets maximum number of PC attributes to retain.
|
void |
setOptions(java.lang.String[] options)
Parses a list of options for this object.
|
void |
setVarianceCovered(double value)
Sets the amount of variance to account for when retaining principal
components.
|
java.lang.String |
varianceCoveredTipText()
Returns the tip text for this property.
|
batchFilterFile, debugTipText, doNotCheckCapabilitiesTipText, filterFile, getCapabilities, getCopyOfInputFormat, getDebug, getDoNotCheckCapabilities, getOutputFormat, isFirstBatchDone, isNewBatch, isOutputFormatDefined, makeCopies, makeCopy, mayRemoveInstanceAfterFirstBatchDone, numPendingOutput, output, outputPeek, postExecution, preExecution, run, runFilter, setDebug, setDoNotCheckCapabilities, toString, useFilter, wekaStaticWrapperequals, getClass, hashCode, notify, notifyAll, wait, wait, waitmakeCopypublic java.lang.String globalInfo()
public java.util.Enumeration<Option> listOptions()
listOptions in interface OptionHandlerlistOptions in class Filterpublic void setOptions(java.lang.String[] options)
throws java.lang.Exception
-C Center (rather than standardize) the data and compute PCA using the covariance (rather than the correlation) matrix.
-R <num> Retain enough PC attributes to account for this proportion of variance in the original data. (default: 0.95)
-A <num> Maximum number of attributes to include in transformed attribute names. (-1 = include all, default: 5)
-M <num> Maximum number of PC attributes to retain. (-1 = include all, default: -1)
setOptions in interface OptionHandlersetOptions in class Filteroptions - the list of options as an array of stringsjava.lang.Exception - if an option is not supportedpublic java.lang.String[] getOptions()
getOptions in interface OptionHandlergetOptions in class Filterpublic 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 value)
value - the proportion of total variance to account forpublic double getVarianceCovered()
public java.lang.String maximumAttributeNamesTipText()
public void setMaximumAttributeNames(int value)
value - the maximum number of attributespublic int getMaximumAttributeNames()
public java.lang.String maximumAttributesTipText()
public void setMaximumAttributes(int value)
value - the maximum number of attributespublic int getMaximumAttributes()
public Capabilities getCapabilities()
getCapabilities in interface CapabilitiesHandlergetCapabilities in class FilterCapabilitiespublic boolean setInputFormat(Instances instanceInfo) throws java.lang.Exception
setInputFormat in class FilterinstanceInfo - an Instances object containing the input instance
structure (any instances contained in the object are ignored -
only the structure is required).java.lang.Exception - if the input format can't be set successfullypublic boolean input(Instance instance) throws java.lang.Exception
public boolean batchFinished()
throws java.lang.Exception
batchFinished in class Filterjava.lang.NullPointerException - if no input structure has been defined,java.lang.Exception - if there was a problem finishing the batch.public java.lang.String getRevision()
getRevision in interface RevisionHandlergetRevision in class Filterpublic static void main(java.lang.String[] args)
args - should contain arguments to the filter: use -h for help