svm_mnist_digit_classification icon indicating copy to clipboard operation
svm_mnist_digit_classification copied to clipboard

Other Dataset

Open mab85 opened this issue 7 years ago • 2 comments

@ksopyla I am new in python and i ask how to use this code to own dataset with two images folders train and test. thanks in advance

mab85 avatar Dec 27 '17 11:12 mab85

Hi, First of all, I read all images in line 28 in to "images" variable (https://github.com/ksopyla/svm_mnist_digit_classification/blob/master/svm_mnist_classification.py#L28)

Then normalize images pixels from 0-255 to 0-1 (line 45)

And then use sciki-learn 'train_test_split' function to split X_data into X_train and X_test

So the simplest thing you could try is to read the data from your folders to variables X_train, X_test, y_train, y_test, and normalize X_train and X_test

ksopyla avatar Dec 27 '17 13:12 ksopyla

excuse me,can you tell me how to run these py scripts?

kevinyu1949 avatar May 07 '18 14:05 kevinyu1949