Hi, I hope all is well. I am trying to understand why my plotLoadings looks odd.
I am running the following code using my own dataset:
srbct.splsda ← splsda(X, Y, ncomp = 10)
perf.splsda.srbct ← perf(srbct.splsda, validation = “Mfold”,
folds = 5, nrepeat = 10,
progressBar = FALSE, auc = FALSE)
Note: this errors if I run AUC=TRUE (Error in cut.default(cases, thresholds) : ‘breaks’ are not unique)
Output:
perf.splsda.srbct$choice.ncomp
Output:
max.dist centroids.dist mahalanobis.dist
overall 1 1 1
BER 1 1 1
list.keepX ← c(1:7)
tune.splsda.srbct ← tune.splsda(X, Y, ncomp = 1,
validation = ‘Mfold’,
folds = 5, nrepeat = 10,
dist = ‘centroids.dist’,
measure = “BER”,
test.keepX = list.keepX)
Output:
final.splsda ← splsda(X, Y,
ncomp = 1,
keepX = 7)
plotLoadings(final.splsda, comp = 1, contrib = ‘max’, method = ‘median’)
Note: If works if I change contrib to NULL
plotLoadings(final.splsda, comp = 1, contrib = NULL, method = ‘median’)