I am working on MNIST digit recognizer dataset
Here, I have 10 class labels and I am looking to build and compare all the pairs of classes, ie, to run 10c2 logistic regression models and compare them. I know I could use
combn(unique(mnist$label), 2, function(x) , simplify = TRUE)
in a loop and write the model in function. But, Im stuck here.
loglist <- list()
for(i in unique(mnist$label)){
tmp <- try(append(loglist, glm(label~.,family=binomial(link=logit),
data = mnist[mnist$label == i, ])))
if (class(tmp) != "try-error") loglist <- append(loglist, tmp)
}
Any help or suggestion would be of great help, Thank you.