Switch to unified view

a b/man/tuneCluster.block.spls.Rd
1
% Generated by roxygen2: do not edit by hand
2
% Please edit documentation in R/tuneCluster.block.spls.R
3
\name{tuneCluster.block.spls}
4
\alias{tuneCluster.block.spls}
5
\title{Feature Selection Optimization for block (s)PLS method}
6
\usage{
7
tuneCluster.block.spls(
8
  X,
9
  Y = NULL,
10
  indY = NULL,
11
  ncomp = 2,
12
  test.list.keepX = NULL,
13
  test.keepY = NULL,
14
  ...
15
)
16
}
17
\arguments{
18
\item{X}{list of numeric matrix (or data.frame) with features in columns and samples in rows (with samples order matching in all data sets).}
19
20
\item{Y}{(optional) numeric matrix (or data.frame) with features in columns and samples in rows (same rows as \code{X}).}
21
22
\item{indY}{integer, to supply if Y is missing, indicates the position of the matrix response in the list \code{X}.}
23
24
\item{ncomp}{integer, number of component to include in the model}
25
26
\item{test.list.keepX}{list of integers with the same size as X. Each entry corresponds to the different keepX value to test for each block of \code{X}.}
27
28
\item{test.keepY}{only if Y is provideid. Vector of integer containing the different value of keepY to test for block \code{Y}.}
29
30
\item{...}{other parameters to be included in the spls model (see \code{mixOmics::block.spls})}
31
}
32
\value{
33
\item{silhouette}{silhouette coef. computed for every combinasion of keepX/keepY}
34
\item{ncomp}{number of component included in the model}
35
\item{test.keepX}{list of tested keepX}
36
\item{test.keepY}{list of tested keepY}
37
\item{block}{names of blocks}
38
\item{slopes}{"slopes" computed from the silhouette coef. for each keepX and keepY, used to determine the best keepX and keepY}
39
\item{choice.keepX}{best \code{keepX} for each component}
40
\item{choice.keepY}{best \code{keepY} for each component}
41
}
42
\description{
43
This function identify the number of feautures to keep per component and thus by cluster in \code{mixOmics::block.spls} by optimizing the silhouette coefficient, which assesses the quality of clustering.
44
}
45
\details{
46
For each component and for each keepX/keepY value, a spls is done from these parameters.
47
Then the clustering is performed and the silhouette coefficient is calculated for this clustering.
48
49
We then calculate "slopes" where keepX/keepY are the coordinates and the silhouette is the intensity.
50
A z-score is assigned to each slope.
51
We then identify the most significant slope which indicates a drop in the silhouette coefficient and thus a deterioration of the clustering.
52
}
53
\examples{
54
demo <- suppressWarnings(get_demo_cluster())
55
X <- list(X = demo$X, Z = demo$Z)
56
Y <- demo$Y
57
test.list.keepX <- list("X" = c(5,10,15,20), "Z" = c(2,4,6,8))
58
test.keepY <- c(2:5)
59
60
# tuning
61
tune.block.spls <- tuneCluster.block.spls(X= X, Y= Y, 
62
                                          test.list.keepX= test.list.keepX, 
63
                                          test.keepY= test.keepY, 
64
                                          mode= "canonical")
65
keepX <- tune.block.spls$choice.keepX
66
keepY <- tune.block.spls$choice.keepY
67
68
# final model
69
block.spls.res <- mixOmics::block.spls(X= X, Y= Y, keepX = keepX, 
70
                             keepY = keepY, ncomp = 2, mode = "canonical")
71
# get clusters and plot longitudinal profile by cluster
72
block.spls.cluster <- getCluster(block.spls.res)
73
}
74
\seealso{
75
\code{\link[mixOmics]{block.spls}}, \code{\link[timeOmics]{getCluster}}, \code{\link[timeOmics]{plotLong}}
76
}