-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.py
39 lines (34 loc) · 834 Bytes
/
test.py
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
__author__ = 'admin'
import numpy as np
from scipy import linalg as la
import scipy.sparse as ss
from anchorTopic import *
from ioProcess import *
import datetime
starttime = time.time()
row = np.array([0,0,1,2,2,2])
col = np.array([0,2,2,0,1,2])
data = np.array([1,2,3,4,5.0,6])
msm = ss.csr_matrix((data, (row, col)), shape=(3,3))
print msm.todense()
# Q = compute_Q(msm)
# p, r = choose_anchor_partial(msm, 2)
# test nnl
# msm = ss.csr_matrix(msm / msm.sum(1))
# b = msm[2, :]
# AtA = msm * msm.T
# Atb = msm * b.T
# print AtA.todense()
# print Atb.todense()
# x, iter = simplex_nnls_eg(AtA, Atb)
# print (x)
# test compute_A
# Qn = ss.csr_matrix(msm / msm.sum(1))
# s = Qn.sum(1)
# p = np.array([0, 2])
# compute_A(Qn, s, p)
# test io
load_uci('test', min_tf=0.1)
#long running
endtime = time.time()
print endtime - starttime