-
Notifications
You must be signed in to change notification settings - Fork 12
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
Correct the code to handle single item outcome factors #38
Comments
PS in the validatePredict function ->> block #Segment your data by fold using the which() function, rows 64-65: returns "Error in dependentMatrix[testIndexes, ] : incorrect number of dimensions" My "testIndex" and "dependentMatrix" are as follows:
Could you please advise why? |
Hi Roman Thanks for your interest, and apologies for the slow response to your queries. I will get on top of this ASAP and should have an answer for you tomorrow morning, China time. Kind regards, Sent from my Samsung device -------- Original message -------- PS in the validatePredict function ->> block #Segment your data by fold using the which() function, rows 64-65: returns "Error in dependentMatrix[testIndexes, ] : incorrect number of dimensions" My "testIndex" and "dependentMatrix" are as follows:
Could you please advise why? You are receiving this because you are subscribed to this thread. |
Hi Roman
Date: Fri, 23 Sep 2016 02:40:13 -0700 PS in the validatePredict function ->> block #Segment your data by fold using the which() function, rows 64-65: depTestData <- dependentMatrix[testIndexes, ] depTrainData <- dependentMatrix[-testIndexes, ] returns "Error in dependentMatrix[testIndexes, ] : incorrect number of dimensions" My "testIndex" and "dependentMatrix" are as follows: testIndexes [1] 1 2 3 4 5 6 7 8 9 dependentMatrix [1] 9.81 11.00 4.77 10.14 10.27 1.39 10.40 2.48 2.20 8.77 10.36 3.89 11.83 1.61 3.81 11.33 8.81 8.94 10.09 4.23 3.09 [22] 9.12 9.43 11.36 10.26 9.23 10.58 4.95 4.09 9.54 10.49 9.37 2.20 9.40 2.08 9.84 4.68 9.27 8.76 9.70 10.68 5.75 [43] 9.56 3.14 10.28 10.29 10.53 11.54 9.32 9.10 10.33 5.43 11.25 10.98 3.83 6.62 8.58 10.48 9.30 9.86 9.89 11.31 2.83 [64] 7.93 10.41 9.69 7.71 9.92 8.69 4.49 6.62 10.68 9.93 5.88 3.81 8.68 9.37 5.05 3.76 9.90 11.52 1.39 10.01 Could you please advise why? many thanks in advance. regards, roman —
|
Hello Nick, many thanks for the reply. There is only one error (Error in dependentMatrix[testIndexes, ] : incorrect number of dimensions) so far, when colling (I use your variables names with my data) Please find the scripts with the models and a dataset on Google Drive: Many thanks in advance. Best regards, |
Hi Roman Date: Sat, 24 Sep 2016 04:59:50 -0700 Hello Nick, many thanks for the reply. There is only one error (Error in dependentMatrix[testIndexes, ] : incorrect number of dimensions) so far, when colling predictionMetrics <- validatePredict(russett, smMatrix, mmMatrix,noFolds=10) (I use your variables names with my data) Please find the scripts with the models and a dataset on Google Drive: https://drive.google.com/drive/folders/0B7hmTYx_ULtscXV4cEtmSzFWUEE?usp=sharing Many thanks in advance. Best regards, roman —
|
Hello Nick, many thanks for the reply. And great that you have indentified the bug. It will be highly appreciated if you have time and possibility to fix this bug. Best regards, |
Hello Nick, I've failed to fix the error. Thank you. Best regards, |
@roman-bm: sorry i haven't been following this discussion too closely, but out of curiousity: do you have mediating factors in the model you wish to ultimately test? I ask because the pls-predict algorithm currently does not handle mediators too well (we will be adding that feature later this year). |
@soumyaray thank you for the message. rather no. |
@roman-bm the document illustrating the model contains a mediator: PRE-RELEASE COMMUNITY BUZZ. I'm afraid our algorithm currently cannot handle this model appropriately. Given that fixing the one-item factor issue will take some time, and also that we will not be able to handle mediators until much later, I would suggest a different route. You could take the factor scores from your estimated model (from R or SmartPLS) and run a linear regression or logistic regression on the factor scores. If you set up such a model in R, you can run the model through R's I apologize for letting you down on this, but I sense that time is pressing for your project. My suggestion above would let you generate very good predictions, if indeed predictions is all you need at this time. |
@soumyaray thank you very much for your reply. |
@roman-bm I did a quick patch job on your bug and I got the code working. |
@NicholasDanks Thank you Nick! predictionMetrics doesn't fully work but returns the statistics, right? |
@roman it returns the kfold cross validated RMSE MAPE and MAD. You can specify k for number of folds. If you want straight point predictions use Plspredict and if you want the prediction intervals use predictionInterval. My example also has a nice pair of visualizations to use but these might need tweaking to suit your data. Xlim ylim etc. Sent from my Samsung device -------- Original message -------- @NicholasDanks Thank you Nick! predictionMetrics doesn't fully work but returns the statistics, right? — |
@NicholasDanks Many thanks!! |
@roman-bm : hope this works for you! But please do keep in mind that if you have mediation in your model, the results might change in future versions of pls-predict. |
@NicholasDanks are the statistics for each of these 10 folders saved in PLSSAD, PLSSAPE, PLSSSE matrices? thank you. |
@NicholasDanks I mean, how to provide the statistics for each of the 10-folders estimations? |
Dear Nicholas,
I have just receive the following error:
predictionMetrics <- validatePredict(data, smMatrix, mmMatrix,noFolds=10)
Error in dependentMatrix[testIndexes, ] : incorrect number of dimensions
how to sort it out?
Thanks.
regards,
roman
The text was updated successfully, but these errors were encountered: