def read_dataset(): dataset = sets.Ocr() dataset = sets.OneHot(dataset.target, depth=2)(dataset, columns=['target']) dataset['data'] = dataset.data.reshape(dataset.data.shape[:-2] + (-1, )).astype(float) train, test = sets.Split(0.66)(dataset) return train, test
def get_dataset(): """Read dataset and flatten images.""" dataset = sets.Ocr() dataset = sets.OneHot(dataset.target, depth=2)(dataset, columns=['target']) dataset['data'] = dataset.data.reshape(dataset.data.shape[:-2] + (-1, )).astype(float) train, test = sets.Split(0.66)(dataset) return train, test
def test_ocr(): dataset = sets.Ocr() dataset = sets.OneHot(dataset.target, depth=2)(dataset, columns=['target'])