forked from stelmo/LoopRanking
-
Notifications
You must be signed in to change notification settings - Fork 0
/
testControl.py
56 lines (38 loc) · 1.33 KB
/
testControl.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# -*- coding: utf-8 -*-
"""
Created on Wed Apr 11 00:07:50 2012
@author: St Elmo Wilken
"""
from localGainCalculator import localgains
from gainRank import gRanking
from RGABristol import RGA
import numpy as np
from numpy import array, zeros
test1 = localgains("connectionsTE.csv", "scaledinputs005h5.txt", 13)
gainm = test1.normaliseGainMatrix(test1.linlocalgainmatrix)
varm = test1.variables
googlem = test1.normaliseGainMatrix(test1.connectionmatrix)
test2 = gRanking(gainm, varm)
test2.showConnectRank()
gainnc = array(test2.rankArray).reshape(-1,1)
test2 = gRanking(googlem, varm)
test2.showConnectRank()
googlenc = array(test2.rankArray).reshape(-1,1)
rationc = array(gainnc/googlenc).reshape(-1,1)
"""**************"""
test1 = localgains("connectionsTEcontrol.csv", "scaledcontrol.txt", 21)
gainm = test1.normaliseGainMatrix(test1.linlocalgainmatrix)
varm = test1.variables
googlem = test1.normaliseGainMatrix(test1.connectionmatrix)
test2 = gRanking(gainm, varm)
#test2.showConnectRank()
gainnc = array(test2.rankArray).reshape(-1,1)
test2 = gRanking(googlem, varm)
#test2.showConnectRank()
googlec = array(test2.rankArray).reshape(-1,1)
ratioc = array(gainnc/googlec).reshape(-1,1)
compare = array(zeros((49,2)))
compare[:,0] = rationc[:,0]
compare[:,1] = ratioc[:,0]
diff = array(compare[:,0] - compare[:,1]).reshape(-1,1)
print(diff)