Skip to content
Snippets Groups Projects
Commit 8613f432 authored by Luc Giffon's avatar Luc Giffon
Browse files

Mnist dataset tested

parent b5ddb30b
Branches
No related tags found
No related merge requests found
......@@ -55,11 +55,7 @@ class MnistDataset(ImageDataset):
def read(self):
"""
Return a dict of data where, for each key is associated a (data, label) tuple.
The values of the tuple are np.ndarray.
:return: dict
set the _train and _test attribute of dataset
"""
# todo add possibility to provide percentage for validation set instead of size
self._train = LabeledData(
......
import os
import unittest
from skluc.main.data.mldatasets import MnistDataset
class TestMnistDataset(unittest.TestCase):
def test_mnist(self):
mnist = MnistDataset()
mnist.load()
for name in mnist.l_filepaths:
self.assertTrue(os.path.exists(name))
def test_to_image(self):
mnist = MnistDataset()
mnist.load()
mnist.to_image()
self.assertTrue(mnist.train.data[0].shape == (28, 28, 1))
if __name__ == "__main__":
unittest.main()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment