-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path@
More file actions
31 lines (22 loc) · 590 Bytes
/
@
File metadata and controls
31 lines (22 loc) · 590 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
class som_data_struct:
def __init__(self, D, labels=[], name=[],comp_names=[],comp_norm=[], label_names=[]):
self.type="som_data"
self.data=D
self.labels=labels
self.name=name
self.comp_names=comp_names
self.comp_norm=comp_norm
self.label_names=label_names
dlen=D.shape[0]
dim=D.shape[1]
#defaults
if name==[]:
self.name="unnamed"
if labels==[]:
self.labels=['']*dlen
if comp_names==[]:
comp_names=['']*dim
for i in range(0,dim):
comp_names[i]='variable ' + str(i)
if comp_norm==[]:
comp_norm=['']*dim