-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdd_ex4.m
More file actions
executable file
·42 lines (35 loc) · 1.11 KB
/
dd_ex4.m
File metadata and controls
executable file
·42 lines (35 loc) · 1.11 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
% DD_EX4
%
% This should show the use of consistent_occ, for the optimization
% of complexity parameters of one-class classifiers. This function
% can be applied to all one-class classifiers in the toolbox, for
% instance:
% function range
% knndd 1:10
% svdd scale_range
% lpdd scale_range
% parzen_dd scale_range (here the automatic optimization works
% also quite satisfactory)
% Copyright: D.M.J. Tax, D.M.J.Tax@prtools.org
% Faculty EWI, Delft University of Technology
% P.O. Box 5031, 2600 GA Delft, The Netherlands
% Generate some data:
nrx = 100;
x = target_class(gendatb([nrx nrx]),'1');
% Define the error on the target class
fracrej = 0.2;
% The knndd:
% Define a useful range of scales:
range = 1:10;
% Optimize the k in the knndd using the consistency:
w_knndd = consistent_occ(x,'knndd',fracrej,range);
% The LPDD:
% Define a useful range of scales:
range = scale_range(x);
% Optimize the scale in the LPDD using the consistency:
w_lpdd = consistent_occ(x,'lpdd',fracrej,range);
% Plot the results:
figure(1); clf;
scatterd(x);
plotc(w_knndd);
plotc(w_lpdd,'r');