Alphabet recognition by using LogisticRegression model from sklearn.linear_model. (Udacity Assignment 1)
Continued from previous assignment, we saved pickle data from some sample alphabet images. Now we are going to extract the data and train the data, so that we can recognize the alphabet. from __future__ import print_function import matplotlib.pyplot as plt import numpy as np import os import sys import tarfile import random import hashlib from IPython.display import display, Image from sklearn.linear_model import LogisticRegression from six.moves.urllib.request import urlretrieve from six.moves import cPickle as pickle test_filename = "notMNIST.pickle" def read_data(picklename,data_name): if os.path.exists(picklename): with open(picklename, 'rb') as f: letter_set = pickle.load(f) return letter_set[data_name] train_dataset = read_data(test_filename,'train_dataset') train_labels = read_data(test_filename,'train_labels') valid_dataset = read_data(test_filename,'valid_dataset') valid_labels = read_data(test_filename,'valid_labels...