jsat.datatransform
Class FastICA
- java.lang.Object
-
- jsat.datatransform.FastICA
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, DataTransform, InvertibleTransform
public class FastICA extends java.lang.Object implements InvertibleTransform
Provides an implementation of the FastICA algorithm for Independent Component Analysis (ICA). ICA is similar to PCA and Whitening, but assumes that the data is generated from a mixture of some C base components where mixing occurs instantaneously (i.e. produced from some matrix transform of the true components). ICA attempts to find the C components from the raw observations.
See:- Hyvärinen, A. (1999). Fast and robust fixed-point algorithms for independent component analysis. IEEE Transactions on Neural Networks / a Publication of the IEEE Neural Networks Council, 10(3), 626–34. doi:10.1109/72.761722
- Hyvärinen, a.,&Oja, E. (2000). Independent component analysis: algorithms and applications. Neural Networks, 13(4-5), 411–430. doi:10.1016/S0893-6080(00)00026-5
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static classFastICA.DefaultNegEntropyFuncA set of default negative entropy functions as specified in the original FastICA paperstatic interfaceFastICA.NegEntropyFuncThe FastICA algorithm requires a function f(x) to be used iteratively in the algorithm, but only makes use of the first and second derivatives of the algorithm.
-
Constructor Summary
Constructors Constructor and Description FastICA()Creates a new FastICA transform that will attempt to fit 10 components.FastICA(DataSet data, int C)Creates a new FastICA transformFastICA(DataSet data, int C, FastICA.NegEntropyFunc G, boolean preWhitened)Creates a new FastICA transformFastICA(FastICA toCopy)Copy constructorFastICA(int C)Creates a new FastICA transformFastICA(int C, FastICA.NegEntropyFunc G, boolean preWhitened)Creates a new FastICA transform
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description FastICAclone()voidfit(DataSet data)Fits this transform to the given dataset.intgetC()FastICA.NegEntropyFuncgetNegEntropyFunction()DataPointinverse(DataPoint dp)Applies the inverse or "reverse" transform to approximately undo the effect ofDataTransform.transform(jsat.classifiers.DataPoint)to recover an approximation of the original data point.booleanisPreWhitened()voidsetC(int C)Sets the number of base components to learnvoidsetNegEntropyFunction(FastICA.NegEntropyFunc G)Sets the Negative Entropy function used to infer the base components.voidsetPreWhitened(boolean preWhitened)Controls where or not the implementation assumes the input data is already whitened.DataPointtransform(DataPoint dp)Returns a new data point that is a transformation of the original data point.
-
-
-
Constructor Detail
-
FastICA
public FastICA()
Creates a new FastICA transform that will attempt to fit 10 components. This is likely not optimal for any particular dataset
-
FastICA
public FastICA(int C)
Creates a new FastICA transform- Parameters:
C- the number of base components to assume and try to discover
-
FastICA
public FastICA(DataSet data, int C)
Creates a new FastICA transform- Parameters:
data- the data set to transformC- the number of base components to assume and try to discover
-
FastICA
public FastICA(int C, FastICA.NegEntropyFunc G, boolean preWhitened)Creates a new FastICA transform- Parameters:
data- the data set to transformC- the number of base components to assume and try to discoverG- the Negative Entropy function to usepreWhitened-trueto assume the data has already been whitened before being given to the transform,falseand the FastICA implementation will perform its own whitening.
-
FastICA
public FastICA(DataSet data, int C, FastICA.NegEntropyFunc G, boolean preWhitened)
Creates a new FastICA transform- Parameters:
data- the data set to transformC- the number of base components to assume and try to discoverG- the Negative Entropy function to usepreWhitened-trueto assume the data has already been whitened before being given to the transform,falseand the FastICA implementation will perform its own whitening.
-
FastICA
public FastICA(FastICA toCopy)
Copy constructor- Parameters:
toCopy- the object to copy
-
-
Method Detail
-
fit
public void fit(DataSet data)
Description copied from interface:DataTransformFits this transform to the given dataset. Some transforms can only be learned from classification or regression datasets. If an incompatible dataset type is given, aFailedToFitExceptionexception may be thrown.- Specified by:
fitin interfaceDataTransform- Parameters:
data- the dataset to fir this transform to
-
setC
public void setC(int C)
Sets the number of base components to learn- Parameters:
C- the number of base components to assume and try to discover
-
getC
public int getC()
- Returns:
- the number of base components to assume and try to discover
-
setNegEntropyFunction
public void setNegEntropyFunction(FastICA.NegEntropyFunc G)
Sets the Negative Entropy function used to infer the base components.- Parameters:
G- the Negative Entropy function to use
-
getNegEntropyFunction
public FastICA.NegEntropyFunc getNegEntropyFunction()
- Returns:
- the Negative Entropy function to use
-
setPreWhitened
public void setPreWhitened(boolean preWhitened)
Controls where or not the implementation assumes the input data is already whitened. Whitening is a requirement for the algorithm to work as intended.- Parameters:
preWhitened-trueto assume the data has already been whitened,falsefor this object to do its own whitening
-
isPreWhitened
public boolean isPreWhitened()
- Returns:
trueif this object will assume the data has already been whitened,falsefor this object to do its own whitening
-
transform
public DataPoint transform(DataPoint dp)
Description copied from interface:DataTransformReturns a new data point that is a transformation of the original data point. This new data point is a different object, but may contain the same references as the original data point. It is not guaranteed that you can mutate the transformed point without having a side effect on the original point.- Specified by:
transformin interfaceDataTransform- Parameters:
dp- the data point to apply a transformation to- Returns:
- a transformed data point
-
inverse
public DataPoint inverse(DataPoint dp)
Description copied from interface:InvertibleTransformApplies the inverse or "reverse" transform to approximately undo the effect ofDataTransform.transform(jsat.classifiers.DataPoint)to recover an approximation of the original data point.- Specified by:
inversein interfaceInvertibleTransform- Parameters:
dp- the transformed data point- Returns:
- the original data point, or a reasonable approximation
-
clone
public FastICA clone()
- Specified by:
clonein interfaceDataTransform- Specified by:
clonein interfaceInvertibleTransform- Overrides:
clonein classjava.lang.Object
-
-
DataMelt 3.0 © DataMelt by jWork.ORG