Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/acsala/sPLSPM
sPLSPM package
https://github.com/acsala/sPLSPM
Last synced: about 8 hours ago
JSON representation
sPLSPM package
- Host: GitHub
- URL: https://github.com/acsala/sPLSPM
- Owner: acsala
- Created: 2021-01-28T12:35:12.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-03-25T09:36:46.000Z (over 3 years ago)
- Last Synced: 2024-08-02T20:43:40.694Z (3 months ago)
- Language: R
- Size: 477 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-multi-omics - msPLS - Csala - multiset sparse partial least squares path modeling - [paper](https://doi.org/10.1186/s12859-019-3286-3) (Software packages and methods / Multi-omics correlation or factor analysis)
README
# sPLSPM R package
[Multiset sparse partial least squares path modeling for high dimensional data analysis](https://doi.org/10.1186/s12859-019-3286-3)This R application is based on [plspm](https://cran.r-project.org/web/packages/plspm/index.html)
## Installation
Install the development version of [sPLSPM](https://github.com/acsala/sPLSPM)
```r
# install "devtools"
install.packages("devtools")
library(devtools)# install "sPLSPM"
install_github("acsala/sPLSPM")
```
## Minimum examplelibrary(sPLSPM)
```r
Generated_data <- sPLSPM::generate_data(number_of_ksi = 1,
number_of_patients = 150,
number_of_Xs_associated_with_ksis = c(15),
number_of_not_associated_Xs = 100,
mean_of_the_regression_weights_of_the_associated_Xs = c(0.9),
sd_of_the_regression_weights_of_the_associated_Xs = c(0.05),
Xnoise_min = -0.2, Xnoise_max = 0.2,
number_of_Ys_associated_with_ksis = c(15),
number_of_not_associated_Ys = 85,
mean_of_the_regression_weights_of_the_associated_Ys = c(0.9),
sd_of_the_regression_weights_of_the_associated_Ys = c(0.05),
Ynoise_min = -0.2, Ynoise_max = 0.2)
X <- Generated_data$X
Y <- Generated_data$Y
data_info1 <- Generated_data$data_info
Data <- cbind(X,Y)
dim(X)
dim(Y)dim(Data)
## 2 DATASETS connectivity matrix
EXPL_X = c(0,0)
RESP_Y = c(1,0)
path_matrix = rbind(EXPL_X, RESP_Y)
## blocks of outer model
blocks = list(1:dim(X)[2], dim(X)[2]+1:dim(Y)[2])
dim(Data[,blocks[[1]]])
dim(Data[,blocks[[2]]])
## define vector of reflective modes
modes = c("B","A")## fit the model
time_data <- system.time(
s_satpls <- splspm(Data, path_matrix, blocks, modes, scheme="path",
scaled=T, penalization = "enet", nonzero = c(40,20),
cross_validate = T, lambda = 1, maxiter = 100)
)s_satpls$outer_model
s_satpls$model$iter
s_satpls$nonzero
s_satpls$lambda
```