public class LatentSemanticAnalysis extends UnsupervisedAttributeEvaluator implements AttributeTransformer, OptionHandler
-N Normalize input data.
-R Rank approximation used in LSA. May be actual number of LSA attributes to include (if greater than 1) or a proportion of total singular values to account for (if between 0 and 1). A value less than or equal to zero means use all latent variables. (default = 0.95)
-A Maximum number of attributes to include in transformed attribute names. (-1 = include all)
| Constructor and Description |
|---|
LatentSemanticAnalysis() |
| Modifier and Type | Method and Description |
|---|---|
void |
buildEvaluator(Instances data)
Initializes the singular values/vectors and performs the analysis
|
Instance |
convertInstance(Instance instance)
Transform an instance in original (unnormalized) format
|
double |
evaluateAttribute(int att)
Evaluates the merit of a transformed attribute.
|
Capabilities |
getCapabilities()
Returns the capabilities of this evaluator.
|
int |
getMaximumAttributeNames()
Gets maximum number of attributes to include in
transformed attribute names.
|
boolean |
getNormalize()
Gets whether or not input data is to be normalized
|
String[] |
getOptions()
Gets the current settings of LatentSemanticAnalysis
|
double |
getRank()
Gets the desired matrix rank (or coverage proportion) for feature-space reduction
|
String |
getRevision()
Returns the revision string.
|
String |
globalInfo()
Returns a string describing this attribute transformer
|
Enumeration |
listOptions()
Returns an enumeration describing the available options.
|
static void |
main(String[] argv)
Main method for testing this class
|
String |
maximumAttributeNamesTipText()
Returns the tip text for this property
|
String |
normalizeTipText()
Returns the tip text for this property
|
String |
rankTipText()
Returns the tip text for this property
|
void |
setMaximumAttributeNames(int newMaxAttributes)
Sets maximum number of attributes to include in
transformed attribute names.
|
void |
setNormalize(boolean newNormalize)
Set whether input data will be normalized.
|
void |
setOptions(String[] options)
Parses a given list of options.
|
void |
setRank(double newRank)
Sets the desired matrix rank (or coverage proportion) for feature-space reduction
|
String |
toString()
Returns a description of this attribute transformer
|
Instances |
transformedData(Instances data)
Transform the supplied data set (assumed to be the same format
as the training data)
|
Instances |
transformedHeader()
Returns just the header for the transformed data (ie.
|
clean, forName, makeCopies, postProcesspublic String globalInfo()
public Enumeration listOptions()
listOptions in interface OptionHandlerpublic void setOptions(String[] options) throws Exception
-N Normalize input data.
-R Rank approximation used in LSA. May be actual number of LSA attributes to include (if greater than 1) or a proportion of total singular values to account for (if between 0 and 1). A value less than or equal to zero means use all latent variables. (default = 0.95)
-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 stringsException - if an option is not supportedpublic String normalizeTipText()
public void setNormalize(boolean newNormalize)
newNormalize - true if input data is to be normalizedpublic boolean getNormalize()
public String rankTipText()
public void setRank(double newRank)
newRank - the desired rank (or coverage) for feature-space reductionpublic double getRank()
public String maximumAttributeNamesTipText()
public void setMaximumAttributeNames(int newMaxAttributes)
newMaxAttributes - the maximum number of attributespublic int getMaximumAttributeNames()
public String[] getOptions()
getOptions in interface OptionHandlerpublic Capabilities getCapabilities()
getCapabilities in interface CapabilitiesHandlergetCapabilities in class ASEvaluationCapabilitiespublic void buildEvaluator(Instances data) throws Exception
buildEvaluator in class ASEvaluationdata - the instances to analyse/transformException - if analysis failspublic Instances transformedHeader() throws Exception
transformedHeader in interface AttributeTransformerException - if the header of the transformed data can't
be determined.public Instances transformedData(Instances data) throws Exception
transformedData in interface AttributeTransformerException - if transformed data can't be returnedpublic double evaluateAttribute(int att)
throws Exception
evaluateAttribute in interface AttributeEvaluatoratt - the attribute to be evaluatedException - if attribute can't be evaluatedpublic Instance convertInstance(Instance instance) throws Exception
convertInstance in interface AttributeTransformerinstance - an instance in the original (unnormalized) formatException - if instance can't be transformedpublic String toString()
public String getRevision()
getRevision in interface RevisionHandlergetRevision in class ASEvaluationpublic static void main(String[] argv)
argv - should contain the command line arguments to the
evaluator/transformer (see AttributeSelection)Copyright © 2021 University of Waikato, Hamilton, NZ. All rights reserved.