# Leave-one-out cross-validation in LiblineaR

So I've been encountering this weird issue with LiblineaR where I get different results from just running LiblineaR with cross set to the size of my dataset and actually looping through the dataset, choosing each entry for testing and training on the rest, even though it seems like these should be exactly the same. Has anyone else dealt with this?

(This is LiblineaR's LOO cross-validation)

LiblineaR(data=data,labels=yTrain,cost=co,cross=nrow(data))


(This is the code I've been using, so that I can see which specific works were misclassified and save the weights of the training model if necessary)

for (i in 1:nrow(data)){
x = data[,2:dataCols]
y = factor(data[,1])

xTrain = x[-i,]
xTest = x[i,]
yTrain = y[-i]
yTest = y[i]

m=LiblineaR(data=xTrain, labels=yTrain, cost=co)
p=predict(m, xTest)}