-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfindClass.m
More file actions
79 lines (79 loc) · 2.39 KB
/
findClass.m
File metadata and controls
79 lines (79 loc) · 2.39 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
function [ind_val] = findClass(tree,trainRow_vals,attributes_names,trainData_vals)
ind=find(attributes_names==tree.value);
ind_val=trainRow_vals(ind);
col_size=sort(unique(trainData_vals(:,ind)));
for i=1:size(col_size,1)
if(ind_val==col_size(i))
if(i==1)
if(~isnumeric(tree.first))
findClass(tree.first,trainRow_vals,attributes_names,trainData_vals);
else
ind_val=tree.first;
end
end
if(i==2)
if(~isnumeric(tree.second))
findClass(tree.second,trainRow_vals,attributes_names,trainData_vals);
else
ind_val=tree.second;
end
end
if(i==3)
if(~isnumeric(tree.third))
findClass(tree.third,trainRow_vals,attributes_names,trainData_vals);
else
ind_val=tree.third;
end
end
if(i==4)
if(~isnumeric(tree.fourth))
findClass(tree.fourth,trainRow_vals,attributes_names,trainData_vals);
else
ind_val=tree.fourth;
end
end
if(i==5)
if(~isnumeric(tree.fifth))
findClass(tree.fifth,trainRow_vals,attributes_names,trainData_vals);
else
ind_val=tree.fifth;
end
end
if(i==6)
if(~isnumeric(tree.sixth))
findClass(tree.sixth,trainRow_vals,attributes_names,trainData_vals);
else
ind_val=tree.sixth;
end
end
if(i==7)
if(~isnumeric(tree.seventh))
findClass(tree.seventh,trainRow_vals,attributes_names,trainData_vals);
else
ind_val=tree.seventh;
end
end
if(i==8)
if(~isnumeric(tree.eight))
findClass(tree.eight,trainRow_vals,attributes_names,trainData_vals);
else
ind_val=tree.eight;
end
end
if(i==9)
if(~isnumeric(tree.nine))
findClass(tree.nine,trainRow_vals,attributes_names,trainData_vals);
else
ind_val=tree.nine;
end
end
if(i==10)
if(~isnumeric(tree.ten))
findClass(tree.ten,trainRow_vals,attributes_names,trainData_vals);
else
ind_val=tree.ten;
end
end
end
end
end