Hi everyone.

I am using PLS-DA to predict (2 categories). I have used the perf function on the original dataset to determine the number of components for the final model (ncomp=2). Now, for the prediction, I have split the data into training and testing sets (80% and 20%). I want to repeat this process 100 times and compute the average AUC at the end. My question is ;

1-/ Should I use the ncomp=2 for each split?

2-/ Or should I determine the number of components (using the perf function) for each of the 100 training data? If this is the case, how can I choose these numbers? since with 100 splits, I donâ€™t have the chance to visualize the perf plot?

Thank for your advice.