asmbPLSDA.vote.fit {asmbPLS} | R Documentation |

Function to fit multiple asmbPLS-DA models using cross validation results with
different decision rules obtained from `asmbPLSDA.cv`

,
the weight for each model are calculated based on cross-validation accuracy,
which can be used for `asmbPLSDA.vote.predict`

to obtain
the final classification.

```
asmbPLSDA.vote.fit(
X.matrix,
Y.matrix,
X.dim,
cv.results.list,
nPLS,
outcome.type,
method = "weighted",
measure = NULL,
center = TRUE,
scale = TRUE
)
```

`X.matrix` |
Predictors matrix. Samples in rows, variables in columns. |

`Y.matrix` |
Outcome matrix. Samples in rows, this is a matrix with one column (binary) or multiple columns (more than 2 levels, dummy variables). |

`X.dim` |
A vector containing the number of predictors in each block (ordered). |

`cv.results.list` |
A list containing |

`nPLS` |
A vector containing the number of PLS components used for different decision rules. |

`outcome.type` |
The type of the outcome Y. " |

`method` |
Vote options. " |

`measure` |
Measure to be selected when |

`center` |
A logical value indicating whether weighted mean center should
be implemented for |

`scale` |
A logical value indicating whether scale should be
implemented for |

`asmbPLSDA.vote.fit`

returns a list of lists, which can be used as the
inputs for `asmbPLSDA.vote.predict`

. Each list contains the
fit information for model with specific decision rule:

`fit.model` |
A list containing model fit information. |

`nPLS` |
The number of PLS components used. |

`weight` |
The weight for this model. |

`outcome.type` |
The type of the outcome Y. |

```
## Use the example dataset
data(asmbPLSDA.example)
X.matrix = asmbPLSDA.example$X.matrix
X.matrix.new = asmbPLSDA.example$X.matrix.new
Y.matrix.binary = asmbPLSDA.example$Y.matrix.binary
X.dim = asmbPLSDA.example$X.dim
PLS.comp = asmbPLSDA.example$PLS.comp
quantile.comb.table.cv = asmbPLSDA.example$quantile.comb.table.cv
## Cross validaiton based on fixed cutoff
cv.results.cutoff <- asmbPLSDA.cv(X.matrix = X.matrix,
Y.matrix = Y.matrix.binary,
PLS.comp = PLS.comp,
X.dim = X.dim,
quantile.comb.table = quantile.comb.table.cv,
outcome.type = "binary",
method = "fixed_cutoff",
k = 3,
ncv = 1)
quantile.comb.cutoff <- cv.results.cutoff$quantile_table_CV
## Cross validation using Euclidean distance of X super score
cv.results.EDX <- asmbPLSDA.cv(X.matrix = X.matrix,
Y.matrix = Y.matrix.binary,
PLS.comp = PLS.comp,
X.dim = X.dim,
quantile.comb.table = quantile.comb.table.cv,
outcome.type = "binary",
method = "Euclidean_distance_X",
k = 3,
ncv = 1)
quantile.comb.EDX <- cv.results.EDX$quantile_table_CV
## Cross validation using Mahalanobis distance of X super score
cv.results.MDX <- asmbPLSDA.cv(X.matrix = X.matrix,
Y.matrix = Y.matrix.binary,
PLS.comp = PLS.comp,
X.dim = X.dim,
quantile.comb.table = quantile.comb.table.cv,
outcome.type = "binary",
method = "Mahalanobis_distance_X",
k = 3,
ncv = 1)
quantile.comb.MDX <- cv.results.MDX$quantile_table_CV
#### vote list ####
cv.results.list = list(fixed_cutoff = quantile.comb.cutoff,
Euclidean_distance_X = quantile.comb.EDX,
Mahalanobis_distance_X = quantile.comb.MDX)
## vote models fit
vote.fit <- asmbPLSDA.vote.fit(X.matrix = X.matrix,
Y.matrix = Y.matrix.binary,
X.dim = X.dim,
nPLS = c(cv.results.cutoff$optimal_nPLS,
cv.results.EDX$optimal_nPLS,
cv.results.MDX$optimal_nPLS),
cv.results.list = cv.results.list,
outcome.type = "binary",
method = "weighted")
```

[Package *asmbPLS* version 1.0.0 Index]