library(“e1071″, lib.loc=”~/Library/R/3.3/library”)
library(“SparseM”, lib.loc=”~/Library/R/3.3/library”)
data <- read.csv(‘/Users/margusja/Downloads/mnist_test.csv’)
dim(data)
x <- as.matrix(data[,2:785])
y <- data[,1]
xs <- as.matrix.csr(x)
write.matrix.csr(xs, y =y, file=”test.txt”)