Update README.md
Browse filesAdded information about the MNIST dataset.
README.md
CHANGED
|
@@ -45,3 +45,24 @@ mX = np.reshape(tX, (tX.shape[0], -1))
|
|
| 45 |
dfData = pd.DataFrame(np.concatenate((mX, vY[:, np.newaxis]), axis = 1), columns = [f'Pixel_{ii:04d}' for ii in range(mX.shape[1])] + ['Label'])
|
| 46 |
dfData.to_parquet('CIFAR10.parquet', index = False)
|
| 47 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
dfData = pd.DataFrame(np.concatenate((mX, vY[:, np.newaxis]), axis = 1), columns = [f'Pixel_{ii:04d}' for ii in range(mX.shape[1])] + ['Label'])
|
| 46 |
dfData.to_parquet('CIFAR10.parquet', index = False)
|
| 47 |
```
|
| 48 |
+
|
| 49 |
+
### MNIST
|
| 50 |
+
|
| 51 |
+
A dataframe where the first 60,000 rows are the train set and the last 10,000 are the test set.
|
| 52 |
+
The last column is the label.
|
| 53 |
+
Images are row major, hence a `np.reshape(dfX.iloc[0, :-1], (28, 28))` will generate the image.
|
| 54 |
+
|
| 55 |
+
Generated by:
|
| 56 |
+
|
| 57 |
+
```python
|
| 58 |
+
import numpy as np
|
| 59 |
+
from sklearn.datasets import fetch_openml
|
| 60 |
+
|
| 61 |
+
dfX, dsY = fetch_openml('mnist_784', version = 1, return_X_y = True, as_frame = True)
|
| 62 |
+
|
| 63 |
+
dfX.columns = [f'{ii:04d}' for ii in range(dfX.shape[1])]
|
| 64 |
+
dfX['Label'] = dsY.astype(np.uint8)
|
| 65 |
+
dfX = dfX.astype(np.uint8)
|
| 66 |
+
|
| 67 |
+
dfX.to_parquet('MNIST.parquet', index = False)
|
| 68 |
+
```
|