tuneCluster.spls {timeOmics} | R Documentation

## Feature Selection Optimization for sPLS method

### Description

This function identify the number of feautures to keep per component and thus by cluster in `mixOmics::spls` by optimizing the silhouette coefficient, which assesses the quality of clustering.

### Usage

    tuneCluster.spls(
      X,
      Y,
      ncomp = 2,
      test.keepX = rep(ncol(X), ncomp),
      test.keepY = rep(ncol(Y), ncomp),
      ...
    )

### Arguments

`X` | numeric matrix (or data.frame) with features in columns and samples in rows
`Y` | numeric matrix (or data.frame) with features in columns and samples in rows (same rows as `X`)
`ncomp` | integer, number of component to include in the model
`test.keepX` | vector of integer containing the different value of keepX to test for block `X`.
`test.keepY` | vector of integer containing the different value of keepY to test for block `Y`.
`...` | other parameters to be included in the spls model (see `mixOmics::spls`)

### Details

For each component and for each keepX/keepY value, a spls is done from these parameters. Then the clustering is performed and the silhouette coefficient is calculated for this clustering.

We then calculate "slopes" where keepX/keepY are the coordinates and the silhouette is the intensity. A z-score is assigned to each slope. We then identify the most significant slope which indicates a drop in the silhouette coefficient and thus a deterioration of the clustering.

### Value

`silhouette` | silhouette coef. computed for every combinasion of keepX/keepY
`ncomp` | number of component included in the model
`test.keepX` | list of tested keepX
`test.keepY` | list of tested keepY
`block` | names of blocks
`slopes` | "slopes" computed from the silhouette coef. for each keepX and keepY, used to determine the best keepX and keepY
`choice.keepX` | best `keepX` for each component
`choice.keepY` | best `keepY` for each component

### See Also

`spls`, `getCluster`, `plotLong`

### Examples

    demo <- suppressWarnings(get_demo_cluster())
    X <- demo$X
    Y <- demo$Y

    # tuning
    tune.spls <- tuneCluster.spls(X, Y, ncomp= 2, test.keepX= c(5,10,15,20), test.keepY= c(2,4,6))
    keepX <- tune.spls$choice.keepX
    keepY <- tune.spls$choice.keepY

    # final model
    spls.res <- mixOmics::spls(X, Y, ncomp= 2, keepX= keepX, keepY= keepY)

    # get clusters and plot longitudinal profile by cluster
    spls.cluster <- getCluster(spls.res)
    plotLong(spls.res)

[Package timeOmics version 1.4.0 Index]