IRootLab
An Open-Source MATLAB toolbox for vibrational biospectroscopy
uip_clssr_tree.m
Go to the documentation of this file.
1 %> @ingroup guigroup
2 %> @file
3 %> @brief Properties Window for @ref clssr_tree
4 %> @image html Screenshot-uip_clssr_tree.png
5 %>
6 %> <b>FSGT object (optional)</b> - see clssr_tree::fsgt
7 %>
8 %> <b>Pruning type</b> - see clssr_tree::pruningtype
9 %>
10 %> <b>Maximum number of levels</b> - see clssr_tree::no_levels_max
11 %>
12 %> <b>Chi-squared test threshold</b> - see clssr_tree::chi2threshold
13 %>
14 %> @sa @ref clssr_tree
15 
16 %> @cond
17 function varargout = uip_clssr_tree(varargin)
18 % Last Modified by GUIDE v2.5 03-Sep-2011 16:21:11
19 
20 % Begin initialization code - DO NOT EDIT
21 gui_Singleton = 1;
22 gui_State = struct('gui_Name', mfilename, ...
23  'gui_Singleton', gui_Singleton, ...
24  'gui_OpeningFcn', @uip_clssr_tree_OpeningFcn, ...
25  'gui_OutputFcn', @uip_clssr_tree_OutputFcn, ...
26  'gui_LayoutFcn', [] , ...
27  'gui_Callback', []);
28 if nargin && ischar(varargin{1})
29  gui_State.gui_Callback = str2func(varargin{1});
30 end
31 
32 if nargout
33  [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
34 else
35  gui_mainfcn(gui_State, varargin{:});
36 end
37 % End initialization code - DO NOT EDIT
38 
39 
40 % --- Executes just before uip_clssr_tree is made visible.
41 function uip_clssr_tree_OpeningFcn(hObject, eventdata, handles, varargin)
42 handles.output.flag_ok = 0;
43 guidata(hObject, handles);
44 gui_set_position(hObject);
45 refresh(handles);
46 
47 % --- Outputs from this function are returned to the command clae.
48 function varargout = uip_clssr_tree_OutputFcn(hObject, eventdata, handles)
49 try
50  uiwait(handles.figure1);
51  handles = guidata(hObject);
52  varargout{1} = handles.output;
53  delete(gcf);
54 catch
55  output.flag_ok = 0;
56  output.params = {};
57  varargout{1} = output;
58 end;
59 
60 
61 %############################################
62 
63 %#########
64 function refresh(handles)
65 listbox_load_from_workspace('fsgt', handles.popupmenu_fsgt, 0);
66 
67 
68 %############################################
69 %############################################
70 
71 % --- Executes on button press in pushbuttonOK.
72 function pushbuttonOK_Callback(hObject, eventdata, handles)
73 try
74  sfsgt = listbox_get_selected_1stname(handles.popupmenu_fsgt);
75  if isempty(sfsgt)
76  sfsgt = '[]';
77  end;
78 
79  ss = get(handles.popupmenu_pruningtype, 'String');
80  stype = ss{get(handles.popupmenu_pruningtype, 'Value')};
81  spruningtype = stype(1); %
82 
83  handles.output.params = {...
84  'fsgt', sfsgt ...
85  'pruningtype', spruningtype, ...
86  'no_levels_max', int2str(eval(get(handles.edit_no_levels_max, 'String'))), ...
87  'chi2threshold', int2str(eval(get(handles.edit_chi2threshold, 'String'))) ...
88  };
89  handles.output.flag_ok = 1;
90  guidata(hObject, handles);
91  uiresume();
92 catch ME
93  irerrordlg(ME.message, 'Cannot continue');
94 
95 end;
96 
97 function popupmenu_fsgt_Callback(hObject, eventdata, handles)
98 
99 function popupmenu_fsgt_CreateFcn(hObject, eventdata, handles)
100 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
101  set(hObject,'BackgroundColor','white');
102 end
103 
104 function edit_no_levels_max_Callback(hObject, eventdata, handles)
105 
106 function edit_no_levels_max_CreateFcn(hObject, eventdata, handles)
107 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
108  set(hObject,'BackgroundColor','white');
109 end
110 
111 function edit_chi2threshold_Callback(hObject, eventdata, handles)
112 
113 function edit_chi2threshold_CreateFcn(hObject, eventdata, handles)
114 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
115  set(hObject,'BackgroundColor','white');
116 end
117 
118 function popupmenu_pruningtype_Callback(hObject, eventdata, handles)
119 
120 function popupmenu_pruningtype_CreateFcn(hObject, eventdata, handles)
121 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
122  set(hObject,'BackgroundColor','white');
123 end
124 %> @endcond
Binary Decision Tree Classifier.
Definition: clssr_tree.m:4
function listbox_get_selected_1stname(in h_listbox)
Property no_levels_max
=10 . Maximum number of levels. The number of nodes is 2^(numberOfLevels)-1
Definition: clssr_tree.m:16
Property fsgt
=fsgt_infgain(). FSGT object to obtain the feature to be used at each node.
Definition: clssr_tree.m:10
function listbox_load_from_workspace(in classname, in h_list, in flag_blank, in string_empty, in input)
function gui_set_position(in hObject)
Property chi2threshold
Chi-squared test threshold for pruningtype = 3. 0 - no pruning; 10 - heavy pruning.
Definition: clssr_tree.m:19
function irerrordlg(in errorstring, in dlgname)
Definition: fsgt.m:5
Property pruningtype
=1 . Pruning type: 0 - no pruning; 1 - maximum number of levels; 2 - backward pruning; 3 - Quinan's c...
Definition: clssr_tree.m:13