forked from WaterFutures/WaterBenchmarkHub
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_gecco_waterquality.py
More file actions
61 lines (42 loc) · 1.87 KB
/
test_gecco_waterquality.py
File metadata and controls
61 lines (42 loc) · 1.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
"""
Module provides tests to test the `water_benchmark_hub.gecco_waterquality.gecco_waterquality` module.
"""
import numpy as np
from water_benchmark_hub import load
from .utils import get_temp_folder
def test_gecco_waterquality2017():
res = load("GECCO-WaterQuality2017")
assert res.get_meta_info() != {}
X, y = res.load_data(download_dir=get_temp_folder(), return_X_y=True)
assert X is not None
assert y is not None
assert res.compute_evaluation_score(np.random.choice([0, 1], size=y.shape), y=y) is not None
df_data = res.load_data(download_dir=get_temp_folder(), return_X_y=False)
assert df_data is not None
def test_gecco_waterquality2018():
res = load("GECCO-WaterQuality2018")
assert res.get_meta_info() != {}
X, y = res.load_data(download_dir=get_temp_folder(), return_X_y=True)
assert X is not None
assert y is not None
assert res.compute_evaluation_score(np.random.choice([0, 1], size=y.shape), y=y) is not None
df_data = res.load_data(download_dir=get_temp_folder(), return_X_y=False)
assert df_data is not None
def test_gecco_waterquality2019():
res = load("GECCO-WaterQuality2019")
assert res.get_meta_info() != {}
d = res.load_data(download_dir=get_temp_folder(), return_X_y=True)
X, y = d["train"]
assert X is not None
assert y is not None
assert res.compute_evaluation_score(np.random.choice([0, 1], size=y.shape), y=y) is not None
X, y = d["validation"]
assert X is not None
assert y is not None
assert res.compute_evaluation_score(np.random.choice([0, 1], size=y.shape), y=y) is not None
X, y = d["test"]
assert X is not None
assert y is not None
assert res.compute_evaluation_score(np.random.choice([0, 1], size=y.shape), y=y) is not None
df_data = res.load_data(download_dir=get_temp_folder(), return_X_y=False)
assert df_data is not None