GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — DeepLearningPython/mnist_svm.py at master · MichalDanielDobrzanski/DeepLearningPython Expand file tree/ Copy pathmnist_svm.pyMore file actions 28 lines (22 loc) · 770 Bytes / Copy pathmnist_svm.pyFile metadata and controls28 lines (22 loc) · 770 Bytes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 """ mnist_svm ~~~~~~~~~ A classifier program for recognizing handwritten digits from the MNIST data set, using an SVM classifier.""" #### Libraries # My libraries import mnist_loader # Third-party libraries from sklearn import svm def svm_baseline(): training_data, validation_data, test_data = mnist_loader.load_data() # train clf = svm.SVC() clf.fit(training_data[0], training_data[1]) # test predictions = [int(a) for a in clf.predict(test_data[0])] num_correct = sum(int(a == y) for a, y in zip(predictions, test_data[1])) print("Baseline classifier using an SVM.") print(str(num_correct) + " of " + str(len(test_data[1])) + " values correct.") if __name__ == "__main__": svm_baseline() |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |