Witold Wydmański
commited on
Commit
•
cd847b5
0
Parent(s):
init
Browse files- .gitattributes +2 -0
- load_script.py +0 -0
- process.py +21 -0
- test.csv +3 -0
- train.csv +3 -0
.gitattributes
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
test.csv filter=lfs diff=lfs merge=lfs -text
|
2 |
+
train.csv filter=lfs diff=lfs merge=lfs -text
|
load_script.py
ADDED
File without changes
|
process.py
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#%%
|
2 |
+
import h5py
|
3 |
+
import pandas as pd
|
4 |
+
import numpy as np
|
5 |
+
|
6 |
+
#%%
|
7 |
+
with h5py.File("usps.h5", 'r') as hf:
|
8 |
+
train = hf.get('train')
|
9 |
+
X_tr = train.get('data')[:]
|
10 |
+
y_tr = train.get('target')[:]
|
11 |
+
test = hf.get('test')
|
12 |
+
X_te = test.get('data')[:]
|
13 |
+
y_te = test.get('target')[:]
|
14 |
+
|
15 |
+
# %%
|
16 |
+
X_training = np.concatenate((X_tr, y_tr.reshape(-1, 1)), axis=1)
|
17 |
+
X_test = np.concatenate((X_te, y_te.reshape(-1, 1)), axis=1)
|
18 |
+
|
19 |
+
# %%
|
20 |
+
pd.DataFrame(X_training).to_csv("train.csv", index=False, header=False)
|
21 |
+
pd.DataFrame(X_test).to_csv("test.csv", index=False, header=False)
|
test.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:229900de252b803e4cf1dd75c70d6495bf82e7393cb1c250bd2c07abfd8d4a6d
|
3 |
+
size 4509824
|
train.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:39097e4dd1ab3b3079ca5286d7ea210bdddd9970f8d04932cb3f9a2032bdaa0b
|
3 |
+
size 16341487
|