public class PCA extends Object implements DataTransform
ZeroMeanTransform
should
be applied to the data set first. If not done, the first
dimension of PCA may contain noise and become uninformative,
possibly throwing off the computation of the other PCsZeroMeanTransform
,
Serialized FormConstructor and Description |
---|
PCA()
Creates a new object for performing PCA that stops at 50 principal components.
|
PCA(DataSet dataSet)
Performs PCA analysis using the given data set, so that transformations may be performed on future data points.
|
PCA(DataSet dataSet,
int maxPCs)
Performs PCA analysis using the given data set, so that transformations may be performed on future data points.
|
PCA(DataSet dataSet,
int maxPCs,
double threshold)
Performs PCA analysis using the given data set, so that transformations may be performed on future data points.
|
PCA(int maxPCs)
Creates a new object for performing PCA
|
PCA(int maxPCs,
double threshold)
Creates a new object for performing PCA
|
Modifier and Type | Method and Description |
---|---|
DataTransform |
clone() |
void |
fit(DataSet dataSet)
Fits this transform to the given dataset.
|
int |
getMaxPCs() |
double |
getThreshold() |
void |
setMaxPCs(int maxPCs)
sets the maximum number of principal components to learn
|
void |
setThreshold(double threshold) |
DataPoint |
transform(DataPoint dp)
Returns a new data point that is a transformation of the original data
point.
|
public PCA()
public PCA(DataSet dataSet)
dataSet
- the data set to learn frompublic PCA(DataSet dataSet, int maxPCs)
dataSet
- the data set to learn frommaxPCs
- the maximum number of Principal Components to let the algorithm learn. The algorithm may stop
earlier if all the variance has been explained, or the convergence threshold has been met.
Note, the computable maximum number of PCs is limited to the minimum of the number of samples and the
number of dimensions.public PCA(int maxPCs)
maxPCs
- the maximum number of Principal Components to let the
algorithm learn. The algorithm may stop earlier if all the variance has
been explained, or the convergence threshold has been met. Note, the
computable maximum number of PCs is limited to the minimum of the number
of samples and the number of dimensions.public PCA(int maxPCs, double threshold)
maxPCs
- the maximum number of Principal Components to let the algorithm learn. The algorithm may stop
earlier if all the variance has been explained, or the convergence threshold has been met.
Note, the computable maximum number of PCs is limited to the minimum of the number of samples and the
number of dimensions.threshold
- a convergence threshold, any small value will work. Smaller values will
not produce more accurate results, but may make the algorithm take longer if it would
have terminated before maxPCs was reached.public PCA(DataSet dataSet, int maxPCs, double threshold)
dataSet
- the data set to learn frommaxPCs
- the maximum number of Principal Components to let the algorithm learn. The algorithm may stop
earlier if all the variance has been explained, or the convergence threshold has been met.
Note, the computable maximum number of PCs is limited to the minimum of the number of samples and the
number of dimensions.threshold
- a convergence threshold, any small value will work. Smaller values will
not produce more accurate results, but may make the algorithm take longer if it would
have terminated before maxPCs was reached.public void fit(DataSet dataSet)
DataTransform
FailedToFitException
exception may be
thrown.fit
in interface DataTransform
dataSet
- the dataset to fir this transform topublic void setMaxPCs(int maxPCs)
maxPCs
- the maximum number of principal components to learnpublic int getMaxPCs()
public void setThreshold(double threshold)
threshold
- the threshold for convergence of the algorithmpublic double getThreshold()
public DataPoint transform(DataPoint dp)
DataTransform
transform
in interface DataTransform
dp
- the data point to apply a transformation topublic DataTransform clone()
clone
in interface DataTransform
clone
in class Object
Copyright © 2017. All rights reserved.