|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.attributeSelection.ASEvaluation
weka.attributeSelection.AttributeEvaluator
weka.attributeSelection.MatlabICA
Class for performing independent components analysis/transformation.
Valid options are:
-D
Don't normalize the input data.
-T
Transform through the IC space and back to the original space.
-N
num
Number of independant components
-A
approach
ICA Approach
-F
function
ICA function
Field Summary | |
static int |
APPROACH_DEFL
|
static int |
APPROACH_SYMM
|
static int |
FUNCTION_GAUSS
|
static int |
FUNCTION_POW3
|
static int |
FUNCTION_SKEW
|
static int |
FUNCTION_TANH
|
java.lang.String |
m_dataFilename
Name of the file where dataMatrix will be stored |
protected int |
m_ICAapproach
|
protected int |
m_ICAfunction
|
protected java.lang.String |
m_ICAMFile
Name of the Matlab program file that computes ICA |
protected double[][] |
m_independentComponents
Will hold the independent components |
java.lang.String |
m_independentComponentsFilename
Name of the file where independentComponents will be stored |
java.lang.String |
m_independentComponentsFilenameBase
|
protected double[][] |
m_inverseMixingMatrix
Will hold the inverse of the mixing matrix |
java.lang.String |
m_inverseMixingMatrixFilename
Name of the file where inverseMixingMatrix will be stored |
protected boolean |
m_loadEigenValuesFromFile
load eigenvalues of covariance matrix from file? |
protected boolean |
m_loadEigenVectorsFromFile
load eigenvectors of covariance matrix from file? |
protected double[][] |
m_mixingMatrix
Will hold the mixing matrix |
java.lang.String |
m_mixingMatrixFilename
Name of the file where mixingMatrix will be stored |
java.lang.String |
m_mixingMatrixFilenameBase
|
protected int |
m_NumIndependentComponents
number of Independent Components |
static Tag[] |
TAGS_APPROACH
|
static Tag[] |
TAGS_FUNCTION
|
Constructor Summary | |
MatlabICA()
|
Method Summary | |
void |
buildEvaluator(Instances data)
Initializes independent components and performs the analysis |
Instance |
convertInstance(Instance instance)
Transform an instance in original (unormalized) format. |
double |
evaluateAttribute(int att)
Evaluates the merit of a transformed attribute. |
ASEvaluation |
getEvaluator()
Gets the attribute evaluator used |
SelectedTag |
getICAapproach()
get ICA approach |
SelectedTag |
getICAfunction()
get ICA function |
boolean |
getLoadEigenValuesFromFile()
get m_loadEigenValuesFromFile |
boolean |
getLoadEigenVectorsFromFile()
get m_loadEigenVectorsFromFile |
static java.lang.String |
getLogTimestamp()
Get a timestamp string as a weak uniqueid |
boolean |
getNormalize()
Gets whether or not input data is to be normalized |
int |
getNumIndependentComponents()
get number of Independent Components |
java.lang.String[] |
getOptions()
Gets the current settings of MatlabICA |
boolean |
getTransformBackToOriginal()
Gets whether the data is to be transformed back to the original space. |
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 |
normalizeTipText()
Returns the tip text for this property |
void |
prepareMatlab(java.lang.String filename)
Create matlab m-file for ICA |
double[][] |
readColumnVectors(java.lang.String name)
Read column vectors from a text file |
static void |
runMatlab(java.lang.String inFile,
java.lang.String outFile)
Run matlab in command line with a given argument |
void |
setEvaluator(ASEvaluation evaluator)
Sets the attribute evaluator |
void |
setICAapproach(SelectedTag approach)
set ICA approach |
void |
setICAfunction(SelectedTag function)
set ICA function |
void |
setLoadEigenValuesFromFile(boolean choice)
set m_loadEigenValuesFromFile |
void |
setLoadEigenVectorsFromFile(boolean choice)
set m_loadEigenVectorsFromFile |
void |
setNormalize(boolean n)
Set whether input data will be normalized. |
void |
setNumIndependentComponents(int n)
set number of Independent Components |
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 |
java.lang.String |
toString()
Returns a description of this attribute transformer |
java.lang.String |
transformBackToOriginalTipText()
Returns the tip text for this property |
Instances |
transformedData()
Gets the transformed training data. |
Instances |
transformedHeader()
Returns just the header for the transformed data (ie. |
Methods inherited from class weka.attributeSelection.ASEvaluation |
forName, makeCopies, postProcess |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.lang.String m_ICAMFile
protected double[][] m_mixingMatrix
protected double[][] m_inverseMixingMatrix
protected double[][] m_independentComponents
public java.lang.String m_dataFilename
public java.lang.String m_mixingMatrixFilename
public java.lang.String m_mixingMatrixFilenameBase
public java.lang.String m_inverseMixingMatrixFilename
public java.lang.String m_independentComponentsFilename
public java.lang.String m_independentComponentsFilenameBase
protected boolean m_loadEigenValuesFromFile
protected boolean m_loadEigenVectorsFromFile
protected int m_NumIndependentComponents
public static final int APPROACH_SYMM
public static final int APPROACH_DEFL
public static final Tag[] TAGS_APPROACH
protected int m_ICAapproach
public static final int FUNCTION_TANH
public static final int FUNCTION_GAUSS
public static final int FUNCTION_POW3
public static final int FUNCTION_SKEW
public static final Tag[] TAGS_FUNCTION
protected int m_ICAfunction
Constructor Detail |
public MatlabICA()
Method Detail |
public void setLoadEigenValuesFromFile(boolean choice)
public boolean getLoadEigenValuesFromFile()
public void setLoadEigenVectorsFromFile(boolean choice)
public boolean getLoadEigenVectorsFromFile()
public void setNumIndependentComponents(int n)
public int getNumIndependentComponents()
public SelectedTag getICAapproach()
public void setICAapproach(SelectedTag approach)
public SelectedTag getICAfunction()
public void setICAfunction(SelectedTag function)
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 the input data.
-T
Transform through the IC space and back to the original space.
-N
num
Number of independant components
-A
approach
ICA Approach
-F
function
ICA function
setOptions
in interface OptionHandler
options
- the list of options as an array of strings
java.lang.Exception
- if an option is not supportedpublic void setEvaluator(ASEvaluation evaluator)
evaluator
- the evaluator with all options set.public ASEvaluation getEvaluator()
public java.lang.String normalizeTipText()
public void setNormalize(boolean n)
n
- true if input data is to be normalizedpublic boolean getNormalize()
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 void buildEvaluator(Instances data) throws java.lang.Exception
buildEvaluator
in class ASEvaluation
data
- the instances to analyse/transform
java.lang.Exception
- if analysis failspublic double[][] readColumnVectors(java.lang.String name) throws java.lang.Exception
name
- file name
double[][]
value
java.lang.Exception
- if an error occurspublic 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() 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 class AttributeEvaluator
att
- the attribute to be evaluated
java.lang.Exception
- if attribute can't be evaluatedpublic void prepareMatlab(java.lang.String filename)
filename
- file where matlab script is createdpublic static void runMatlab(java.lang.String inFile, java.lang.String outFile)
inFile
- file to be input to MatlaboutFile
- file where results are storedpublic java.lang.String toString()
public Instance convertInstance(Instance instance) throws java.lang.Exception
convertInstance
in interface AttributeTransformer
instance
- an instance in the original (unormalized) format
java.lang.Exception
- if instance cant be transformedpublic static java.lang.String getLogTimestamp()
public 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 |