Skip to content

Commit ea1f5d6

Browse files
committed
test: updated, shortned mock dataset for unittests
1 parent 017b3ee commit ea1f5d6

File tree

6 files changed

+535
-20751
lines changed

6 files changed

+535
-20751
lines changed

tests/example_dataset/CaliforniaHousing.csv

Lines changed: 0 additions & 20641 deletions
This file was deleted.

tests/example_dataset/mockData.csv

Lines changed: 499 additions & 0 deletions
Large diffs are not rendered by default.

tests/test_predictors/test_multivarhybrid.py

Lines changed: 19 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@
44

55
from imbrium.predictors.multivarhybrid import HybridMulti
66

7-
data = pd.read_csv("tests/example_dataset/CaliforniaHousing.csv")
7+
data = pd.read_csv("tests/example_dataset/mockData.csv")
88
target = np.array(data["target"])
99
features = np.array(
1010
data[
1111
[
12-
"HouseAge",
13-
"AveRooms",
14-
"AveBedrms",
15-
"Population",
16-
"AveOccup",
17-
"Latitude",
18-
"Longitude",
19-
"MedInc",
12+
"A",
13+
"B",
14+
"C",
15+
"D",
16+
"E",
17+
"F",
18+
"G",
19+
"H",
2020
]
2121
]
2222
)
@@ -25,14 +25,14 @@
2525
features_small = np.array(
2626
data_small[
2727
[
28-
"HouseAge",
29-
"AveRooms",
30-
"AveBedrms",
31-
"Population",
32-
"AveOccup",
33-
"Latitude",
34-
"Longitude",
35-
"MedInc",
28+
"A",
29+
"B",
30+
"C",
31+
"D",
32+
"E",
33+
"F",
34+
"G",
35+
"H",
3636
]
3737
]
3838
)
@@ -41,18 +41,6 @@
4141
1,
4242
5,
4343
5,
44-
# data=data,
45-
# features=[
46-
# "target",
47-
# "HouseAge",
48-
# "AveRooms",
49-
# "AveBedrms",
50-
# "Population",
51-
# "AveOccup",
52-
# "Latitude",
53-
# "Longitude",
54-
# "MedInc",
55-
# ],
5644
target=target,
5745
features=features,
5846
)
@@ -62,18 +50,6 @@
6250
1,
6351
5,
6452
5,
65-
# data=data_small,
66-
# features=[
67-
# "target",
68-
# "HouseAge",
69-
# "AveRooms",
70-
# "AveBedrms",
71-
# "Population",
72-
# "AveOccup",
73-
# "Latitude",
74-
# "Longitude",
75-
# "MedInc",
76-
# ],
7753
target=target_small,
7854
features=features_small,
7955
)
@@ -83,18 +59,6 @@
8359
1,
8460
5,
8561
5,
86-
# data=data_small,
87-
# features=[
88-
# "target",
89-
# "HouseAge",
90-
# "AveRooms",
91-
# "AveBedrms",
92-
# "Population",
93-
# "AveOccup",
94-
# "Latitude",
95-
# "Longitude",
96-
# "MedInc",
97-
# ],
9862
target=target_small,
9963
features=features_small,
10064
)
@@ -195,8 +159,8 @@
195159

196160
y = np.array([3.422, 2.697, 2.992, 2.414, 2.267])
197161

198-
shape_x = (20632, 1, 40, 1)
199-
shape_y = (20632, 5)
162+
shape_x = (490, 1, 40, 1)
163+
shape_y = (490, 5)
200164

201165
model_id = "CNN-LSTM"
202166
optimizer = "adam"

tests/test_predictors/test_multivarpure.py

Lines changed: 11 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@
44

55
from imbrium.predictors.multivarpure import PureMulti
66

7-
data = pd.read_csv("tests/example_dataset/CaliforniaHousing.csv")
7+
data = pd.read_csv("tests/example_dataset/mockData.csv")
88
target = np.array(data["target"])
99
features = np.array(
1010
data[
1111
[
12-
"HouseAge",
13-
"AveRooms",
14-
"AveBedrms",
15-
"Population",
16-
"AveOccup",
17-
"Latitude",
18-
"Longitude",
19-
"MedInc",
12+
"A",
13+
"B",
14+
"C",
15+
"D",
16+
"E",
17+
"F",
18+
"G",
19+
"H",
2020
]
2121
]
2222
)
@@ -27,35 +27,11 @@
2727
10,
2828
target=target,
2929
features=features,
30-
# data=data,
31-
# features=[
32-
# "target",
33-
# "HouseAge",
34-
# "AveRooms",
35-
# "AveBedrms",
36-
# "Population",
37-
# "AveOccup",
38-
# "Latitude",
39-
# "Longitude",
40-
# "MedInc",
41-
# ],
4230
)
4331

4432
test1 = PureMulti(
4533
2,
4634
10,
47-
# data=data_small,
48-
# features=[
49-
# "target",
50-
# "HouseAge",
51-
# "AveRooms",
52-
# "AveBedrms",
53-
# "Population",
54-
# "AveOccup",
55-
# "Latitude",
56-
# "Longitude",
57-
# "MedInc",
58-
# ],
5935
target=target,
6036
features=features,
6137
)
@@ -64,18 +40,6 @@
6440
test2 = PureMulti(
6541
2,
6642
10,
67-
# data=data_small,
68-
# features=[
69-
# "target",
70-
# "HouseAge",
71-
# "AveRooms",
72-
# "AveBedrms",
73-
# "Population",
74-
# "AveOccup",
75-
# "Latitude",
76-
# "Longitude",
77-
# "MedInc",
78-
# ],
7943
target=target,
8044
features=features,
8145
)
@@ -136,8 +100,8 @@
136100

137101
y = np.array([3.585, 3.521, 3.413, 3.422, 2.697, 2.992, 2.414, 2.267, 2.611, 2.815])
138102

139-
shape_x = (20630, 2, 8)
140-
shape_y = (20630, 10)
103+
shape_x = (488, 2, 8)
104+
shape_y = (488, 10)
141105

142106
model_id = "LSTM"
143107
optimizer = "adam"

tests/test_predictors/test_univarhybrid.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44

55
from imbrium.predictors.univarhybrid import HybridUni
66

7-
data = pd.read_csv("tests/example_dataset/CaliforniaHousing.csv")
8-
# data = data["target"]
7+
data = pd.read_csv("tests/example_dataset/mockData.csv")
98
data = np.array(data["target"])
109
data_small = data[:20]
1110

@@ -69,8 +68,8 @@
6968
y = np.array([[2.135], [1.913], [1.592]])
7069

7170

72-
shape_x = (20628, 2, 5, 1)
73-
shape_y = (20628, 3, 1)
71+
shape_x = (486, 2, 5, 1)
72+
shape_y = (486, 3, 1)
7473

7574
model_id = "CNN-LSTM"
7675
optimizer = "adam"

tests/test_predictors/test_univarpure.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44

55
from imbrium.predictors.univarpure import PureUni
66

7-
data = pd.read_csv("tests/example_dataset/CaliforniaHousing.csv")
8-
# data = data["target"]
7+
data = pd.read_csv("tests/example_dataset/mockData.csv")
98
data = np.array(data["target"])
109
data_small = data[:20]
1110

@@ -44,8 +43,8 @@
4443

4544
y = np.array([[3.422], [2.697], [2.992]])
4645

47-
shape_x = (20636, 2, 1)
48-
shape_y = (20636, 3, 1)
46+
shape_x = (494, 2, 1)
47+
shape_y = (494, 3, 1)
4948

5049
model_id = "LSTM"
5150
optimizer = "adam"

0 commit comments

Comments
 (0)