IDeA {FRESA.CAD} | R Documentation |
Decorrelation of data frames
Description
All continous features that with significant correlation will be decorrelated
Usage
ILAA(data=NULL,
thr=0.80,
method=c("pearson","spearman"),
Outcome=NULL,
drivingFeatures=NULL,
maxLoops=100,
verbose=FALSE,
bootstrap=0
)
IDeA(data=NULL,thr=0.80,
method=c("fast","pearson","spearman","kendall"),
Outcome=NULL,
refdata=NULL,
drivingFeatures=NULL,
useDeCorr=TRUE,
relaxed=TRUE,
corRank=TRUE,
maxLoops=100,
unipvalue=0.05,
verbose=FALSE,
...)
predictDecorrelate(decorrelatedobject,testData)
Arguments
data |
The dataframe whose features will de decorrelated |
thr |
The maximum allowed correlation. |
refdata |
Option: A data frame that may be used to decorrelate the target dataframe |
Outcome |
The target outcome for supervised basis |
drivingFeatures |
A vector of features to be used as basis vectors. |
unipvalue |
Maximum p-value for correlation significance |
useDeCorr |
if TRUE, the transformation matrix (UPLTM) will be computed |
maxLoops |
the maxumum number of iteration loops |
verbose |
if TRUE, it will display internal evolution of algorithm. |
method |
if not set to "fast" the method will be pased to the |
relaxed |
is set to TRUE it will use relaxed convergence |
corRank |
is set to TRUE it will correlation matrix to break ties. |
... |
parameters passed to the |
decorrelatedobject |
The returned dataframe of the |
testData |
The new dataframe to be decorrelated |
bootstrap |
If greater than 1 the number of boostrapping loops |
Details
The dataframe will be analyzed and significantly correlated features whose correlation
is larger than the user supplied threshold will be decorrelated.
Basis feature selection may be based on Outcome association or by an unsupervised method.
The default options will run the decorrelation using fast matrix operations using Rfast
;
hence, Pearson correlation will be used to estimate the unit-preserving spatial transformation matrix (UPLTM).
ILAA is a wrapper of the more comprensive IDeA method. It estimates linear transforms and allows for boosted transform estimations
Value
decorrelatedDataframe |
The decorrelated data frame with the follwing attributes |
attr:UPLTM |
Attribute of decorrelatedDataframe: The Decorrelation matrix with the beta coefficients |
attr:fscore |
Attribute of decorrelatedDataframe: The score of each feature. |
attr:drivingFeatures |
Attribute of decorrelatedDataframe: The list of features used as base features for supervised basis |
attr:unipvalue |
Attribute of decorrelatedDataframe: The p-value used to check for fit significance |
attr:R.critical |
Attribute of decorrelatedDataframe: The pearson correlation critical value |
attr:IDeAEvolution |
Attribute of decorrelatedDataframe: The R measure history and the sparcity |
attr:VarRatio |
Attribute of decorrelatedDataframe: The variance ratio between the output latent variable and the observed |
Author(s)
Jose G. Tamez-Pena
See Also
featureAdjustment
Examples
## Not run:
# load FRESA.CAD library
# library("FRESA.CAD")
# iris data set
data('iris')
colors <- c("red","green","blue")
names(colors) <- names(table(iris$Species))
classcolor <- colors[iris$Species]
#Decorrelating with usupervised basis and correlation goal set to 0.25
system.time(irisDecor <- IDeA(iris,thr=0.25))
## The transformation matrix is stored at "UPLTM" attribute
UPLTM <- attr(irisDecor,"UPLTM")
print(UPLTM)
#Decorrelating with supervised basis and correlation goal set to 0.25
system.time(irisDecorOutcome <- IDeA(iris,Outcome="Species",thr=0.25))
## The transformation matrix is stored at "UPLTM" attribute
UPLTM <- attr(irisDecorOutcome,"UPLTM")
print(UPLTM)
## Compute PCA
features <- colnames(iris[,sapply(iris,is,"numeric")])
irisPCA <- prcomp(iris[,features]);
## The PCA transformation
print(irisPCA$rotation)
## Plot the transformed sets
plot(iris[,features],col=classcolor,main="Raw IRIS")
plot(as.data.frame(irisPCA$x),col=classcolor,main="PCA IRIS")
featuresDecor <- colnames(irisDecor[,sapply(irisDecor,is,"numeric")])
plot(irisDecor[,featuresDecor],col=classcolor,main="Outcome-Blind IDeA IRIS")
featuresDecor <- colnames(irisDecorOutcome[,sapply(irisDecorOutcome,is,"numeric")])
plot(irisDecorOutcome[,featuresDecor],col=classcolor,main="Outcome-Driven IDeA IRIS")
## End(Not run)