2 %> @file uip_blmisc_rowsout_ranges.m
3 %> @brief Properties Window
for Range-based Outlier Removal
4 %> @image html Screenshot-uip_blmisc_rowsout_ranges.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>Index of feature</b> - see blmisc_rowsout_uni::idx_fea
13 %> <b>Ranges</b> - see blmisc_rowsout_uni::ranges
15 %> <b>Number of bins</b> - see blmisc_rowsout_uni::no_bins. For range-based outlier removal, this has no effect in the calculation, only if the user wants to draw a histogram (blmisc_rowsout_uni::draw_histogram())
17 %> @sa blmisc_rowsout_ranges, blmisc_rowsout_uni
20 function varargout = uip_blmisc_rowsout_ranges(varargin)
21 % Last Modified by GUIDE v2.5 07-Sep-2011 18:20:22
23 % Begin initialization code - DO NOT EDIT
25 gui_State = struct('gui_Name
', mfilename, ...
26 'gui_Singleton
', gui_Singleton, ...
27 'gui_OpeningFcn
', @uip_blmisc_rowsout_ranges_OpeningFcn, ...
28 'gui_OutputFcn
', @uip_blmisc_rowsout_ranges_OutputFcn, ...
29 'gui_LayoutFcn
', [] , ...
31 if nargin && ischar(varargin{1})
32 gui_State.gui_Callback = str2func(varargin{1});
36 [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
38 gui_mainfcn(gui_State, varargin{:});
40 % End initialization code - DO NOT EDIT
43 % --- Executes just before uip_blmisc_rowsout_ranges is made visible.
44 function uip_blmisc_rowsout_ranges_OpeningFcn(hObject, eventdata, handles, varargin)
45 handles.input.block = varargin{1};
47 handles.input.data = varargin{2};
49 handles.input.data = [];
51 handles.output.flag_ok = 0;
52 guidata(hObject, handles);
53 gui_set_position(hObject);
57 % --- Outputs from this function are returned to the command clae.
58 function varargout = uip_blmisc_rowsout_ranges_OutputFcn(hObject, eventdata, handles)
60 uiwait(handles.figure1);
61 handles = guidata(hObject);
62 varargout{1} = handles.output;
67 varargout{1} = output;
70 %############################################
73 function preview(handles)
74 data = handles.input.data;
76 irerrordlg('Dataset not specified!
', 'Cannot preview
');
79 blk = handles.input.block;
80 eval(['blk = blk.setbatch(
', params2str(get_params(handles)), ');
']);
81 blk = blk.train(data);
84 irerrordlg(sprintf('Couldn
''t preview:
"%s"', ME.message), 'Sorry, mate
');
89 function params = get_params(handles)
90 temp = fel(get(handles.edit_ranges, 'String
'));
91 s = sprintf('%s
', temp');
92 s_ranges = mat2str(eval(s));
95 'idx_fea', int2str(eval(
get(handles.edit_idx_fea,
'String'))), ...
96 'no_bins', int2str(eval(
get(handles.edit_no_bins,
'String'))), ...
97 'ranges', s_ranges, ...
98 'flag_mark_only', int2str(
get(handles.checkbox_flag_mark_only,
'Value')) ...
102 %############################################
103 %############################################
106 % --- Executes on button press in pushbuttonOk.
107 function pushbuttonOk_Callback(hObject, eventdata, handles)
109 handles.output.params = get_params(handles);
110 handles.output.flag_ok = 1;
111 guidata(hObject, handles);
118 function editVariables_Callback(hObject, eventdata, handles)
120 % --- Executes during
object creation, after setting all properties.
121 function editVariables_CreateFcn(hObject, eventdata, handles)
122 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
123 set(hObject,'BackgroundColor','white');
127 % --- Executes on selection change in popupmenuType.
128 function popupmenuType_Callback(hObject, eventdata, handles)
130 % --- Executes during
object creation, after setting all properties.
131 function popupmenuType_CreateFcn(hObject, eventdata, handles)
132 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
133 set(hObject,'BackgroundColor','white');
136 function edit_no_bins_Callback(hObject, eventdata, handles)
138 % --- Executes during
object creation, after setting all properties.
139 function edit_no_bins_CreateFcn(hObject, eventdata, handles)
140 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
141 set(hObject,'BackgroundColor','white');
144 function edit_threshold_Callback(hObject, eventdata, handles)
146 % --- Executes during
object creation, after setting all properties.
147 function edit_threshold_CreateFcn(hObject, eventdata, handles)
148 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
149 set(hObject,'BackgroundColor','white');
152 % --- Executes on selection change in popupmenuFsg.
153 function popupmenuFsg_Callback(hObject, eventdata, handles)
156 % --- Executes during
object creation, after setting all properties.
157 function popupmenuFsg_CreateFcn(hObject, eventdata, handles)
158 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
159 set(hObject,'BackgroundColor','white');
162 function edit_ranges_Callback(hObject, eventdata, handles)
164 % --- Executes during
object creation, after setting all properties.
165 function edit_ranges_CreateFcn(hObject, eventdata, handles)
166 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
167 set(hObject,'BackgroundColor','white');
171 % --- Executes on button press in pushbuttonPreview.
172 function pushbuttonPreview_Callback(hObject, eventdata, handles)
175 function edit_idx_fea_Callback(hObject, eventdata, handles)
177 % --- Executes during
object creation, after setting all properties.
178 function edit_idx_fea_CreateFcn(hObject, eventdata, handles)
179 if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
180 set(hObject,'BackgroundColor','white');
184 % --- Executes on button press in checkbox_flag_mark_only.
185 function checkbox_flag_mark_only_Callback(hObject, eventdata, handles)
function irerrordlg(in errorstring, in dlgname)