Computer Vision with Python 3 by Saurabh Kapur

Computer Vision with Python 3 by Saurabh Kapur

Author:Saurabh Kapur [Kapur, Saurabh]
Language: eng
Format: azw3, epub, pdf
Tags: COM012050 - COMPUTERS / Image Processing, COM051360 - COMPUTERS / Programming Languages / Python, COM044000 - COMPUTERS / Neural Networks
Publisher: Packt Publishing
Published: 2017-08-24T04:00:00+00:00


mnist = datasets.load_digits()

images = mnist.images

data_size = len(images)

#Preprocessing images

images = images.reshape(len(images), -1)

labels = mnist.target

#Initialize Support Vector Machine

SVM_classifier = svm.SVC(gamma=0.001)

#Training the data on only 75% of the dataset. Rest of the 25% will be used in testing the

Support Vector Machine

SVM_classifier.fit(images[:int((data_size / 4) * 3)], labels[:int((data_size / 4) * 3)])

#Testing the data

predictions = SVM_classifier.predict(images[int((data_size / 4)):])

target = labels[int((data_size/4)):]



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.