Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

predict_pls: Subscript endogenous_items must be a simple vector, not a matrix #333

Open
anh-huynhlt opened this issue Jul 5, 2023 · 0 comments

Comments

@anh-huynhlt
Copy link

Hi, I'm trying to apply predict_pls, but I get this error:

Parallel encountered this ERROR:
Can't subset columns with endogenous_items.
✖ Subscript endogenous_items must be a simple vector, not a matrix.Error in parallel::stopCluster(cl) : object 'cl' not found

It's strange that I encounter an error with the parallel process since I want to use k-fold cross-validation. I tried specifying noFolds = 10 and cores=NULL, but I still get the same error. Here are my codes.

###### Measurement model 

mm_em <- constructs(composite("VVLT", multi_items("vvlt", 1:4)),
                       composite("VEOU", multi_items("veou", 1:2)),
                       composite("VRA", multi_items("vra", 1:2)),
                      composite("VINT", multi_items("vint", 1:3)))

###### Structural model 

inner_model_em <- relationships(paths(from = c("VVLT", "VEOU", "VRA"), to = "VINT"))

###### Estimate the model

em <- estimate_pls(data = data, 
                   measurement_model = mm_em,
                   structural_model = inner_model_em,
                   inner_weights = path_weighting)

###### PLSpredict

pred <- predict_pls(model = em, technique = predict_DA, noFolds = 10, reps = 10, cores = NULL)

Thanks a lot!

jhorzek added a commit to jhorzek/seminr that referenced this issue May 30, 2024
…ble with a matrix (endogenous_items) fails. The fix casts the matrix to a vector when subsetting the data.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant