extractor.feature.Rd
This function is used to extract the features required by the pre-trained Long Short Term Memory (LSTM) Network. @seealso LSTM
extractor.feature(
response,
cor.type = "pearson",
use = "pairwise.complete.obs"
)
A required N
× I
matrix or data.frame consisting of the responses of N
individuals
to I
items.
A character string indicating which correlation coefficient (or covariance) is to be computed. One of "pearson" (default), "kendall", or "spearman". @seealso cor.
An optional character string giving a method for computing covariances in the presence of missing values. This must be one of the strings "everything", "all.obs", "complete.obs", "na.or.complete", or "pairwise.complete.obs" (default). @seealso cor.
A matrix (1×20) containing all the features for the LSTM.
For "LSTM"
, a total of 2 types of features. These features are as follows:
The top 10 largest eigenvalues.
The difference of the top 10 largest eigenvalues to the corresponding reference eigenvalues from arallel Analysis (PA). @seealso PA
library(LSTMfactors)
set.seed(123)
##Take the data.DAPCS dataset as an example.
data(data.DAPCS)
response <- as.matrix(data.DAPCS[, 3:22]) ## loading data
# \donttest{
## Run extractor.feature function
features <- extractor.feature(response)
print(features)
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7]
#> [1,] 8.272696 2.199799 2.078531 0.9503657 0.7932281 0.6609389 0.5889548
#> [,8] [,9] [,10] [,11] [,12] [,13] [,14]
#> [1,] 0.531376 0.4930556 0.4384936 6.976858 0.9535314 0.8777455 -0.2198813
#> [,15] [,16] [,17] [,18] [,19] [,20]
#> [1,] -0.3519379 -0.4558081 -0.501823 -0.5358521 -0.5501463 -0.5819528
#> attr(,"class")
#> [1] "features.LSTM"
# }