-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathtest_wtsi.py
More file actions
34 lines (30 loc) · 839 Bytes
/
test_wtsi.py
File metadata and controls
34 lines (30 loc) · 839 Bytes
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
from TELF.factorization import NMFk
import mat73
import pytest
import os
def test_wtsi_k():
X = mat73.loadmat(os.path.join("..", "data", "wtsi.mat"))['X'].astype('float32')
params = {
"n_perturbs":32,
"n_iters":5000,
"epsilon":0.015,
"n_jobs":-1,
"init":"nnsvd",
"use_gpu":False,
"save_output":False,
"collect_output":True,
"predict_k":True,
"verbose":True,
"transpose":False,
"sill_thresh":0.9,
"nmf_verbose":False,
"nmf_method":'nmf_kl_mu',
"k_search_method":"bst_post",
"H_sill_thresh":0.1
}
model = NMFk(**params)
Ks = range(1,8,1)
name = "wtsi"
note = "This is an example run of NMFk"
results = model.fit(X, Ks, name, note)
assert results['k_predict'] == 4