Diff of /man/tuneCluster.spls.Rd [000000] .. [d79ff0]

Switch to unified view

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