Benutzer-Werkzeuge

Webseiten-Werkzeuge


ss16:02.06.2016

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen gezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen Revision Vorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
ss16:02.06.2016 [2016/06/16 15:19]
henrikfrenzel
ss16:02.06.2016 [2016/06/16 17:07] (aktuell)
henrikfrenzel
Zeile 10: Zeile 10:
 </​code>​ </​code>​
    
-  * Aufbau ​eines einfachen ​Datensatz +  * Aufbau ​des MNIST-Datensatz 
-<code >+<​code>​
 python python
->>> ​from sklearn ​import ​datasets +>>>​ import ​scipy.io 
->>> ​digits=datasets.load_digits() +>>> ​mat=scipy.io.loadmat('/​[…]/​[…]/​scikit_learn_data/​mldata/​mnist-original.mat'​
->>> ​digits.keys() +>>> ​mat 
-['images', 'data''target_names', 'DESCR', 'target'] +'__globals__': [], 'mldata_descr_ordering': array([[array([u'label'] 
->>>​ digits.data +      dtype='<U5'), 
-array([[ ​ 0.,   ​0.,   5., ...,   0.,   ​0.  ​0.], +        array([u'data'] 
-       ​[ ​ 0.  ​0.  ​0., ...,  10.  ​0.  ​0.], +      ​dtype='<​U4'​)]],​ dtype=object),​ '​__header__':​ '​MATLAB 5.0 MAT-file Platform: posix, Created on: Thu May 26 15:44:45 2016', '​label': ​array([[ ​0.,  ​0., ​ 0., ...,  9.,  9.,  9.]])'​__version__':​ '1.0''​data':​ array([[0, 0, 0, ..., 0, 0, 0], 
-       ​[ ​ 0.  ​0.  ​0., ...,  16.  9.  ​0.],+       [0, 0, 0, ..., 0, 0, 0], 
 +       [0, 0, 0, ..., 00, 0],
        ​..., ​        ​..., ​
-       ​[ ​ 0.  ​0.  1., ...,   6.  ​0.  ​0.], +       [0, 0, 0, ..., 0, 0, 0], 
-       ​[ ​ 0.  ​0.  2., ...,  12.  ​0.  ​0.], +       [0, 0, 0, ..., 0, 0, 0], 
-       ​[ ​ 0.  ​0. 10., ...,  12.  1.  ​0.]]) +       [0, 0, 0, ..., 00, 0]], dtype=uint8)} 
->>> ​digits.data.shape +>>> ​dir(mat
-(1797, 64+['​__class__'​'​__cmp__'​'​__contains__'​'​__delattr__'​'​__delitem__'​'​__doc__'​'​__eq__'​'​__format__'​'​__ge__'​'​__getattribute__'​'​__getitem__'​'​__gt__'​'​__hash__'​'​__init__'​'​__iter__'​'​__le__'​'​__len__'​'​__lt__'​'​__ne__'​'​__new__'​'​__reduce__'​'​__reduce_ex__'​'​__repr__'​'​__setattr__'​'​__setitem__'​'​__sizeof__'​'​__str__'​'​__subclasshook__'​'​clear'​'​copy'​'​fromkeys'​'​get'​'​has_key'​'​items'​'​iteritems'​'​iterkeys'​'​itervalues'​'​keys'​'​pop'​'​popitem'​'​setdefault'​'​update'​'​values'​'​viewitems'​'​viewkeys'​'​viewvalues'​
->>>​ digits.images +>>>​ mat['​data'​
-array([[[  0.  0.  5....  1.  0.  0.], +array([[0, 0, 0, ..., 0, 0, 0], 
-        [  0.  0. 13.... 15.  5.  0.], +       [0, 0, 0, ..., 0, 0, 0], 
-        [  0.  3. 15.... 11.  8.  0.], +       ​[0, 0, 0, ..., 0, 0, 0],
-        ... +
-        [  0.  4. 11.... 12.  7.  0.], +
-        [  0.  2. 14.... 12.  0.  0.], +
-        [  0.  0.  6....  0.  0.  0.]], +
- +
-       ​[[ ​ 0.  0.  0., ...,   ​5., ​  ​0., ​  0.], +
-         ​0., ​  ​0., ​  0., ...,   ​9., ​  ​0., ​  0.], +
-         ​0., ​  ​0., ​  3., ...,   ​6., ​  ​0., ​  ​0.],​ +
-        ...,  +
-        ​ 0.  ​0.  1., ...,   ​6., ​  0.  0.], +
-        [  0.,   0.,   1., ...,   ​6., ​  0.  ​0.], +
-        [  ​0.,   ​0., ​  0., ...,  10.,   ​0., ​  0.]], +
- +
-       [[  ​0.  ​0.  ​0., ...,  ​12., ​  0.  ​0.], +
-        [  ​0.,   ​0., ​  3., ...,  14.,   ​0., ​  0.], +
-         0.  ​0.  8., ...,  16.,   0.  0.], +
-        ​...,  +
-        [  ​0.  9.,  16., ...,   0.  ​0.,   0.], +
-        [  0.,   ​3., ​ 13., ...,  11.,   ​5., ​  ​0.],​ +
-        [  0.,   ​0., ​  0., ...,  16.,   ​9., ​  ​0.]],​ +
        ​..., ​        ​..., ​
-       [[  ​0.  ​0.,   1., ...,   1.  ​0.  0.], +       [0, 0, 0, ..., 0, 0, 0], 
-        [  0.,   0.,  13., ...,   ​2., ​  ​1., ​  0.], +       [0, 0, 0, ..., 0, 0, 0], 
-        [  ​0.  ​0.,  16., ...,  16.,   ​5., ​  0.], +       [0, 0, 0, ..., 0, 0, 0]], dtype=uint8
-        ...,  +>>> ​mat['​data'​].shape 
-        [  0.,   ​0., ​ 16., ...,  15.,   ​0., ​  ​0.],​ +(78470000
-        [  0.,   ​0., ​ 15., ...,  16.,   ​0., ​  ​0.],​ +>>> ​mat.keys 
-        [  0.,   ​0., ​  2., ...,   ​6., ​  ​0., ​  ​0.]],​ +<​built-in method keys of dict object at 0x109098398>​ 
- +>>>​ mat.keys() 
-       [[  ​0.  ​0.  2., ...,   0.  0.,   0.], +['​__globals__'​'​mldata_descr_ordering'​'​__header__'​'​label'​'​__version__'​'​data'​
-        [  0.,   ​0. 14., ...,  15.,   ​1., ​  0.], +>>>​ mat['​label'​
-        [  ​0.,   ​4., ​ 16., ...,  16.,   ​7., ​  0.], +array([[ 0.,  0.,  0., ...,  ​9.,  ​9.,  ​9.]]) 
-        ...,  +>>> ​mat['​label'​].shape 
-        [  0.,   ​0., ​  0., ...,  16.,   ​2., ​  ​0.],​ +(1, 70000)
-        [  0.,   ​0., ​  4., ...,  16.,   ​2., ​  ​0.],​ +
-        [  0.,   ​0., ​  5., ...,  12.,   ​0., ​  ​0.]],​ +
- +
-       [[  ​0.  ​0.,  10., ...,   1.  ​0.  0.], +
-        [  0.,   2.,  16., ...,   ​1., ​  0.  ​0.], +
-        [  ​0.,   ​0., ​ 15., ...,  15.,   ​0., ​  0.]+
-        ...,  +
-        [  0.,   ​4., ​ 16., ...,  16.,   ​6., ​  0.], +
-        [  0.,   ​8., ​ 16., ...,  16.,   ​8., ​  ​0.],​ +
-        [  0.,   ​1., ​  8., ...,  12.,   ​1., ​  0.]]]+
->>> ​digits.images.shape +
-(1797, 88+
->>> ​digits.images[0,:,:​] +
-array([[ ​ 0.,   ​0., ​  ​5., ​ 13.,   ​9., ​  ​1., ​  ​0., ​  0.], +
-       [  0.,   ​0., ​ 13.,  15.,  10.,  15.,   ​5., ​  0.], +
-       ​ 0.  3. 15.  2.  0. ​11., ​  ​8., ​  0.], +
-       ​ ​0., ​  ​4., ​ 12.,   ​0., ​  ​0., ​  ​8., ​  ​8., ​  0.], +
-       ​ ​0., ​  ​5., ​  ​8., ​  ​0., ​  ​0., ​  ​9., ​  ​8., ​  ​0.],​ +
-        0.,   4.,  ​11.,   0.,   1.,  ​12.,   ​7., ​  0.], +
-       ​[ ​ 0.,   2.,  14.,   5.,  ​10.,  ​12.,   0.,   ​0.],​ +
-       ​[ ​ 0.,   ​0., ​  ​6., ​ 13.,  10.,   ​0., ​  ​0., ​  0.]]) +
->>> ​import matplotlib.pyplot as plt +
->>>​ plt.imshow(digits.images[0,:,:]+
-<​matplotlib.image.AxesImage Object at 0x7f5cf834c650>​ +
->>>​ plt.show() +
-</​code>​ +
-  +
-  * Aufbau des MNIST-Datensatz +
-<​code>​ +
 </​code>​ </​code>​
  
Zeile 101: Zeile 51:
 <code python> ​ <code python> ​
 import scipy.io import scipy.io
-mat=scipy.io.loadmat('/​[...]/[...]/​scikit_learn_data/​mldata/​mnist-original.mat'​)+mat=scipy.io.loadmat('/​[]/[]/​scikit_learn_data/​mldata/​mnist-original.mat'​)
 </​code>​ </​code>​
  
ss16/02.06.2016.1466083163.txt.gz · Zuletzt geändert: 2016/06/16 15:19 von henrikfrenzel