0

I have downloaded the MNIST files from:

http://yann.lecun.com/exdb/mnist/index.html

because I want to train an SVM like the following:

clf_svm = LinearSVC()
clf_svm.fit(X_train, y_train)

but I see that the data that I downloaded is divided in training images and labels, so how can I join them to form a numpy array that comprises the X_train variable.

I have tried to do the following:

path_train="D:\\Anaconda\\t10k-images-idx3-ubyte\\t10k-images.idx3-ubyte"
f=open(path_train,"rb")
train_data=cPickle.load(f)

but I got the following error:

train_data=cPickle.load(f)

EOFError

so the question is how to form that X_train with the information that I need?

Thanks

2
  • Possible duplicate of stackoverflow.com/questions/39195113/… Please refer to this link for solution Commented Aug 9, 2018 at 2:55
  • 2
    I think you should use train_data=cPickle.load(f). Commented Aug 9, 2018 at 3:06

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.