Skip to content

Commit 18f5703

Browse files
committed
har_trees: Unhardcode features vector length
1 parent 3c97be0 commit 18f5703

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

examples/har_trees/compute_features.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import npyfile
77

8-
from timebased import calculate_features_xyz, DATA_TYPECODE
8+
from timebased import calculate_features_xyz, DATA_TYPECODE, N_FEATURES
99

1010
def compute_dataset_features(data: npyfile.Reader,
1111
skip_samples=0, limit_samples=None, verbose=0):
@@ -70,7 +70,7 @@ def main():
7070
limit_samples = None
7171

7272
out_typecode = 'f'
73-
n_features = 92
73+
n_features = N_FEATURES
7474

7575
features_array = array.array(out_typecode, (0 for _ in range(n_features)))
7676

examples/har_trees/har_run.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44
import zipfile
55
import npyfile
66
import emlearn_trees
7+
import timebased
78

89
def har_load_test_data(path,
910
skip_samples=0, limit_samples=None):
1011

11-
n_features = 92
12+
n_features = timebased.N_FEATURES
1213

1314
with zipfile.ZipFile(path) as archive:
1415
ext = '.npy'

0 commit comments

Comments
 (0)