|
a |
|
b/man/tuneCluster.spca.Rd |
|
|
1 |
% Generated by roxygen2: do not edit by hand |
|
|
2 |
% Please edit documentation in R/tuneCluster.spca.R |
|
|
3 |
\name{tuneCluster.spca} |
|
|
4 |
\alias{tuneCluster.spca} |
|
|
5 |
\title{Feature Selection Optimization for sPCA method} |
|
|
6 |
\usage{ |
|
|
7 |
tuneCluster.spca(X, ncomp = 2, test.keepX = rep(ncol(X), ncomp), ...) |
|
|
8 |
} |
|
|
9 |
\arguments{ |
|
|
10 |
\item{X}{numeric matrix (or data.frame) with features in columns and samples in rows} |
|
|
11 |
|
|
|
12 |
\item{ncomp}{integer, number of component to include in the model} |
|
|
13 |
|
|
|
14 |
\item{test.keepX}{vector of integer containing the different value of keepX to test for block \code{X}.} |
|
|
15 |
|
|
|
16 |
\item{...}{other parameters to be included in the spls model (see \code{mixOmics::spca})} |
|
|
17 |
} |
|
|
18 |
\value{ |
|
|
19 |
\item{silhouette}{silhouette coef. computed for every combinasion of keepX/keepY} |
|
|
20 |
\item{ncomp}{number of component included in the model} |
|
|
21 |
\item{test.keepX}{list of tested keepX} |
|
|
22 |
\item{block}{names of blocks} |
|
|
23 |
\item{slopes}{"slopes" computed from the silhouette coef. for each keepX and keepY, used to determine the best keepX and keepY} |
|
|
24 |
\item{choice.keepX}{best \code{keepX} for each component} |
|
|
25 |
} |
|
|
26 |
\description{ |
|
|
27 |
This function identify the number of feautures to keep per component and thus by cluster in \code{mixOmics::spca} |
|
|
28 |
by optimizing the silhouette coefficient, which assesses the quality of clustering. |
|
|
29 |
} |
|
|
30 |
\details{ |
|
|
31 |
For each component and for each keepX value, a spls is done from these parameters. |
|
|
32 |
Then the clustering is performed and the silhouette coefficient is calculated for this clustering. |
|
|
33 |
|
|
|
34 |
We then calculate "slopes" where keepX are the coordinates and the silhouette is the intensity. |
|
|
35 |
A z-score is assigned to each slope. |
|
|
36 |
We then identify the most significant slope which indicates a drop in the silhouette coefficient and thus a deterioration of the clustering. |
|
|
37 |
} |
|
|
38 |
\examples{ |
|
|
39 |
demo <- suppressWarnings(get_demo_cluster()) |
|
|
40 |
X <- demo$X |
|
|
41 |
|
|
|
42 |
# tuning |
|
|
43 |
tune.spca.res <- tuneCluster.spca(X = X, ncomp = 2, test.keepX = c(2:10)) |
|
|
44 |
keepX <- tune.spca.res$choice.keepX |
|
|
45 |
plot(tune.spca.res) |
|
|
46 |
|
|
|
47 |
# final model |
|
|
48 |
spca.res <- mixOmics::spca(X=X, ncomp = 2, keepX = keepX) |
|
|
49 |
plotLong(spca.res) |
|
|
50 |
} |