-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtempOperator
More file actions
60 lines (42 loc) · 1.58 KB
/
Copy pathtempOperator
File metadata and controls
60 lines (42 loc) · 1.58 KB
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
55
56
57
58
59
60
# -*- coding: utf-8 -*-
"""
Spyder Editor
This is a temporary script file.
"""
sep = ','
params = []
def read_in_data(file_name,separator):
file_ = open(file_name, "r")#just for reading
data = []
for line in file_:
line = line.strip('\n')
split_up = line.split(separator)
if len(params) == 0:
params.append(split_up)
else:
data.append(split_up)
return data
print read_in_data( 'spectTrain.txt', sep)
print params
def reffinementOperator(data):
k = 10 #maxHyppothreesises
m = 10 #number of isntances
n = 10 #number of binary attributes
D = 10 #Size of matrix
F = 1 #Quality fucntion type
cnt = 0 #counter for the number of variables we need to be true
levelCounter =0 #counter for the conjunctions found per level
trueVariablesFound = 0
for(i in range (n))#to go through the whole data representing the iterations
for(line in range(m)) #to go through the lines
for(varaible in range(n)) #to go through the varables
if(data[line][varable]=1)
Current[n]=1; #keepinhg track of what we foudn so far
tureVariablesFound ++ #to keep track of the number of variables found
if(TrueVariablesFound >= cnt)
level[i][levelCounter] = Current
reintialzeCurrent(Current,tureVariablesFound)
def reintialzeCurrent(Current,tureVariablesFound):
trueVariableFound = 0
for(i in len(Current))
Current[i]=0