Update README.md
Browse files
README.md
CHANGED
|
@@ -9,3 +9,39 @@ A curation of datasets for educations purposes.
|
|
| 9 |
Since SciKit Learn's [California Housing dataset](https://scikit-learn.org/stable/datasets/real_world.html#california-housing-dataset) often fails to download this is the Data Frame of the data in CSV format.
|
| 10 |
By default [SciKit Learn use some pre processing](https://github.com/scikit-learn/scikit-learn/blob/d3898d9d57aeb1e960d266613a2e31b07bca39d7/sklearn/datasets/_california_housing.py#L208-L220) of the [original data](https://web.archive.org/web/20250912205745/https://www.dcc.fc.up.pt/~ltorgo/Regression/cal_housing.html).
|
| 11 |
This CSV is the data after the processing of SciKit Learn.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
Since SciKit Learn's [California Housing dataset](https://scikit-learn.org/stable/datasets/real_world.html#california-housing-dataset) often fails to download this is the Data Frame of the data in CSV format.
|
| 10 |
By default [SciKit Learn use some pre processing](https://github.com/scikit-learn/scikit-learn/blob/d3898d9d57aeb1e960d266613a2e31b07bca39d7/sklearn/datasets/_california_housing.py#L208-L220) of the [original data](https://web.archive.org/web/20250912205745/https://www.dcc.fc.up.pt/~ltorgo/Regression/cal_housing.html).
|
| 11 |
This CSV is the data after the processing of SciKit Learn.
|
| 12 |
+
|
| 13 |
+
### CIFAR 10
|
| 14 |
+
|
| 15 |
+
Since using SciKit Learn's `fetch_openml()` fails to download the `CIFAR_10` dataset this is an alternative.
|
| 16 |
+
It was generated by:
|
| 17 |
+
|
| 18 |
+
```python
|
| 19 |
+
dsTrain = torchvision.datasets.CIFAR10(root = dataFolderPath, train = True, download = True)
|
| 20 |
+
dsVal = torchvision.datasets.CIFAR10(root = dataFolderPath, train = False, download = True)
|
| 21 |
+
|
| 22 |
+
numSamples = len(dsTrain)
|
| 23 |
+
tXTrain = np.zeros((numSamples, 32, 32, 3), dtype = np.uint8)
|
| 24 |
+
vYTrain = np.zeros((numSamples,), dtype = np.uint8)
|
| 25 |
+
|
| 26 |
+
for ii in range(numSamples):
|
| 27 |
+
tXi, valY = dsTrain[ii]
|
| 28 |
+
tXTrain[ii] = tXi
|
| 29 |
+
vYTrain[ii] = valY
|
| 30 |
+
|
| 31 |
+
numSamples = len(dsVal)
|
| 32 |
+
tXVal = np.zeros((numSamples, 32, 32, 3), dtype = np.uint8)
|
| 33 |
+
vYVal = np.zeros((numSamples,), dtype = np.uint8)
|
| 34 |
+
|
| 35 |
+
for ii in range(numSamples):
|
| 36 |
+
tXi, valY = dsVal[ii]
|
| 37 |
+
tXVal[ii] = tXi
|
| 38 |
+
vYVal[ii] = valY
|
| 39 |
+
|
| 40 |
+
tX = np.concatenate((tXTrain, tXVal), axis = 0)
|
| 41 |
+
vY = np.concatenate((vYTrain, vYVal), axis = 0)
|
| 42 |
+
|
| 43 |
+
mX = np.reshape(tX, (tX.shape[0], -1))
|
| 44 |
+
|
| 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_csv('CIFAR10.csv', index = False)
|
| 47 |
+
```
|