类 PrincipalComponents
java.lang.Object
weka.attributeSelection.ASEvaluation
weka.attributeSelection.UnsupervisedAttributeEvaluator
weka.attributeSelection.PrincipalComponents
- 所有已实现的接口:
Serializable
,AttributeEvaluator
,AttributeTransformer
,CapabilitiesHandler
,OptionHandler
,RevisionHandler
public class PrincipalComponents
extends UnsupervisedAttributeEvaluator
implements AttributeTransformer, OptionHandler
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)
- 版本:
- $Revision: 6690 $
- 作者:
- Mark Hall (mhall@cs.waikato.ac.nz), Gabi Schmidberger (gabi@cs.waikato.ac.nz)
- 另请参阅:
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明void
buildEvaluator
(Instances data) Initializes principal components and performs the analysisReturns the tip text for this propertyconvertInstance
(Instance instance) Transform an instance in original (unormalized) format.double
evaluateAttribute
(int att) Evaluates the merit of a transformed attribute.Returns the capabilities of this evaluator.boolean
Get whether to center (rather than standardize) the data.int
Gets maximum number of attributes to include in transformed attribute names.String[]
Gets the current settings of PrincipalComponentsReturns the revision string.boolean
Gets whether the data is to be transformed back to the original space.double
Gets the proportion of total variance to account for when retaining principal componentsReturns a string describing this attribute transformerReturns an enumeration describing the available options.static void
Main method for testing this classReturns the tip text for this propertyvoid
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
(String[] options) Parses a given list of options.void
setTransformBackToOriginal
(boolean b) Sets whether the data should be transformed back to the original spacevoid
setVarianceCovered
(double vc) Sets the amount of variance to account for when retaining principal componentstoString()
Returns a description of this attribute transformerReturns the tip text for this propertytransformedData
(Instances data) Gets the transformed training data.Returns just the header for the transformed data (ie.Returns the tip text for this property从类继承的方法 weka.attributeSelection.ASEvaluation
clean, forName, makeCopies, postProcess
-
构造器详细资料
-
PrincipalComponents
public PrincipalComponents()
-
-
方法详细资料
-
globalInfo
Returns a string describing this attribute transformer- 返回:
- a description of the evaluator suitable for displaying in the explorer/experimenter gui
-
listOptions
Returns an enumeration describing the available options.- 指定者:
listOptions
在接口中OptionHandler
- 返回:
- an enumeration of all the available options.
-
setOptions
Parses a given list of options. 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)
- 指定者:
setOptions
在接口中OptionHandler
- 参数:
options
- the list of options as an array of strings- 抛出:
Exception
- if an option is not supported
-
centerDataTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setCenterData
public void setCenterData(boolean center) Set whether to center (rather than standardize) the data. If set to true then PCA is computed from the covariance rather than correlation matrix.- 参数:
center
- true if the data is to be centered rather than standardized
-
getCenterData
public boolean getCenterData()Get whether to center (rather than standardize) the data. If true then PCA is computed from the covariance rather than correlation matrix.- 返回:
- true if the data is to be centered rather than standardized.
-
varianceCoveredTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setVarianceCovered
public void setVarianceCovered(double vc) Sets the amount of variance to account for when retaining principal components- 参数:
vc
- the proportion of total variance to account for
-
getVarianceCovered
public double getVarianceCovered()Gets the proportion of total variance to account for when retaining principal components- 返回:
- the proportion of variance to account for
-
maximumAttributeNamesTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setMaximumAttributeNames
public void setMaximumAttributeNames(int m) Sets maximum number of attributes to include in transformed attribute names.- 参数:
m
- the maximum number of attributes
-
getMaximumAttributeNames
public int getMaximumAttributeNames()Gets maximum number of attributes to include in transformed attribute names.- 返回:
- the maximum number of attributes
-
transformBackToOriginalTipText
Returns the tip text for this property- 返回:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setTransformBackToOriginal
public void setTransformBackToOriginal(boolean b) Sets whether the data should be transformed back to the original space- 参数:
b
- true if the data should be transformed back to the original space
-
getTransformBackToOriginal
public boolean getTransformBackToOriginal()Gets whether the data is to be transformed back to the original space.- 返回:
- true if the data is to be transformed back to the original space
-
getOptions
Gets the current settings of PrincipalComponents- 指定者:
getOptions
在接口中OptionHandler
- 返回:
- an array of strings suitable for passing to setOptions()
-
getCapabilities
Returns the capabilities of this evaluator.- 指定者:
getCapabilities
在接口中CapabilitiesHandler
- 覆盖:
getCapabilities
在类中ASEvaluation
- 返回:
- the capabilities of this evaluator
- 另请参阅:
-
buildEvaluator
Initializes principal components and performs the analysis- 指定者:
buildEvaluator
在类中ASEvaluation
- 参数:
data
- the instances to analyse/transform- 抛出:
Exception
- if analysis fails
-
transformedHeader
Returns just the header for the transformed data (ie. an empty set of instances. This is so that AttributeSelection can determine the structure of the transformed data without actually having to get all the transformed data through transformedData().- 指定者:
transformedHeader
在接口中AttributeTransformer
- 返回:
- the header of the transformed data.
- 抛出:
Exception
- if the header of the transformed data can't be determined.
-
transformedData
Gets the transformed training data.- 指定者:
transformedData
在接口中AttributeTransformer
- 返回:
- the transformed training data
- 抛出:
Exception
- if transformed data can't be returned
-
evaluateAttribute
Evaluates the merit of a transformed attribute. This is defined to be 1 minus the cumulative variance explained. Merit can't be meaningfully evaluated if the data is to be transformed back to the original space.- 指定者:
evaluateAttribute
在接口中AttributeEvaluator
- 参数:
att
- the attribute to be evaluated- 返回:
- the merit of a transformed attribute
- 抛出:
Exception
- if attribute can't be evaluated
-
toString
Returns a description of this attribute transformer -
convertInstance
Transform an instance in original (unormalized) format. Convert back to the original space if requested.- 指定者:
convertInstance
在接口中AttributeTransformer
- 参数:
instance
- an instance in the original (unormalized) format- 返回:
- a transformed instance
- 抛出:
Exception
- if instance cant be transformed
-
getRevision
Returns the revision string.- 指定者:
getRevision
在接口中RevisionHandler
- 覆盖:
getRevision
在类中ASEvaluation
- 返回:
- the revision
-
main
Main method for testing this class- 参数:
argv
- should contain the command line arguments to the evaluator/transformer (see AttributeSelection)
-