2 %> @file uip_blmisc_rowsout_kernel.m
3 %> @brief Properties Window
for Kernel-based Outlier Removal
4 %> @image html Screenshot-uip_blmisc_rowsout_kernel.png
6 %> <b>Mark outliers only</b> -
7 %> @arg If not checked, the dataset will be split in two: the first one will contain the inliers, whereas the second one will contain the outliers.
8 %> @arg If checked, only one
new dataset will be generated, where the outliers will be marked (outliers
' class will be
9 %> -2). See blmisc_rowsout::flag_mark_only
11 %> <b>Threshold</b> - See blmisc_rowsout_distr::threshold
13 %> <b>Range filter</b> - See blmisc_rowsout_distr::quantile
15 %> <b>Tail trimming mode</b> - See blmisc_rowsout_distr::flag_trim_tail
17 %> <b>Number of bins</b> - See blmisc_rowsout_distr::no_bins
19 %> <b>Kernel width</b> - See blmisc_rowsout_kernel::kernelwidth
21 %> @sa blmisc_rowsout_kernel, blmisc_rowsout_hist
24 function varargout = uip_blmisc_rowsout_kernel(varargin)
25 % Last Modified by GUIDE v2.5 07-Sep-2011 18:11:24
27 % Begin initialization code - DO NOT EDIT
29 gui_State = struct('gui_Name
', mfilename, ...
30 'gui_Singleton
', gui_Singleton, ...
31 'gui_OpeningFcn
', @uip_blmisc_rowsout_kernel_OpeningFcn, ...
32 'gui_OutputFcn
', @uip_blmisc_rowsout_kernel_OutputFcn, ...
33 'gui_LayoutFcn
', [] , ...
35 if nargin && ischar(varargin{1})
36 gui_State.gui_Callback = str2func(varargin{1});
40 [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
42 gui_mainfcn(gui_State, varargin{:});
44 % End initialization code - DO NOT EDIT
47 % --- Executes just before uip_blmisc_rowsout_kernel is made visible.
48 function uip_blmisc_rowsout_kernel_OpeningFcn(hObject, eventdata, handles, varargin)
49 handles.input.block = varargin{1};
51 handles.input.data = varargin{2};
53 handles.input.data = [];
55 handles.output.flag_ok = 0;
56 guidata(hObject, handles);
57 gui_set_position(hObject);
60 % --- Outputs from this function are returned to the command clae.
61 function varargout = uip_blmisc_rowsout_kernel_OutputFcn(hObject, eventdata, handles)
63 uiwait(handles.figure1);
64 handles = guidata(hObject);
65 varargout{1} = handles.output;
70 varargout{1} = output;
73 %############################################
77 function preview(handles)
78 data = handles.input.data;
80 irerrordlg('Dataset not specified!
', 'Cannot preview
');
82 blk = handles.input.block;
83 eval(['blk = blk.setbatch(
', params2str(get_params(handles)), ');
']);
84 blk = blk.train(data);
90 function params = get_params(handles)
91 types = {'threshold
', 'ranges
'};
94 'flag_mark_only
', int2str(get(handles.checkbox_flag_mark_only, 'Value
')), ...
95 'idx_fea
', int2str(eval(get(handles.edit_idx_fea, 'String
'))), ...
96 'no_bins
', int2str(eval(get(handles.edit_no_bins, 'String
'))), ...
97 'threshold
', get(handles.edit_threshold, 'String
'), ...
98 'quantile
', int2str(get(handles.popupmenu_quantile, 'Value
')-1), ...
99 'flag_trim_tail
', int2str(get(handles.checkbox_flag_trim_tail, 'value
')), ...
100 'quantile
', int2str(get(handles.popupmenu_quantile, 'Value
')-1), ...
101 'kernelwidth
', num2str(eval(get(handles.edit_kernelwidth, 'String
'))) ...
104 %############################################
105 %############################################
108 % --- Executes on button press in pushbuttonOk.
109 function pushbuttonOk_Callback(hObject, eventdata, handles)
111 handles.output.params = get_params(handles);
112 handles.output.flag_ok = 1;
113 guidata(hObject, handles);
116 irerrordlg(ME.message, 'Cannot
continue');
120 function edit_no_bins_Callback(hObject, eventdata, handles)
122 % --- Executes during object creation, after setting all properties.
123 function edit_no_bins_CreateFcn(hObject, eventdata, handles)
124 if ispc && isequal(get(hObject,'BackgroundColor
'), get(0,'defaultUicontrolBackgroundColor
'))
125 set(hObject,'BackgroundColor
','white
');
128 function edit_threshold_Callback(hObject, eventdata, handles)
130 % --- Executes during object creation, after setting all properties.
131 function edit_threshold_CreateFcn(hObject, eventdata, handles)
132 if ispc && isequal(get(hObject,'BackgroundColor
'), get(0,'defaultUicontrolBackgroundColor
'))
133 set(hObject,'BackgroundColor
','white
');
136 % --- Executes on button press in pushbuttonPreview.
137 function pushbuttonPreview_Callback(hObject, eventdata, handles)
140 function edit_idx_fea_Callback(hObject, eventdata, handles)
142 % --- Executes during object creation, after setting all properties.
143 function edit_idx_fea_CreateFcn(hObject, eventdata, handles)
144 if ispc && isequal(get(hObject,'BackgroundColor
'), get(0,'defaultUicontrolBackgroundColor
'))
145 set(hObject,'BackgroundColor
','white
');
148 % --- Executes on selection change in popupmenu_quantile.
149 function popupmenu_quantile_Callback(hObject, eventdata, handles)
151 % --- Executes during object creation, after setting all properties.
152 function popupmenu_quantile_CreateFcn(hObject, eventdata, handles)
153 if ispc && isequal(get(hObject,'BackgroundColor
'), get(0,'defaultUicontrolBackgroundColor
'))
154 set(hObject,'BackgroundColor
','white
');
157 % --- Executes on button press in checkbox_flag_trim_tail.
158 function checkbox_flag_trim_tail_Callback(hObject, eventdata, handles)
160 function edit_kernelwidth_Callback(hObject, eventdata, handles)
162 % --- Executes during object creation, after setting all properties.
163 function edit_kernelwidth_CreateFcn(hObject, eventdata, handles)
164 if ispc && isequal(get(hObject,'BackgroundColor
'), get(0,'defaultUicontrolBackgroundColor
'))
165 set(hObject,'BackgroundColor
','white
');
168 % --- Executes on button press in checkbox_flag_mark_only.
169 function checkbox_flag_mark_only_Callback(hObject, eventdata, handles)