-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathismilset.m
More file actions
executable file
·56 lines (50 loc) · 1.15 KB
/
Copy pathismilset.m
File metadata and controls
executable file
·56 lines (50 loc) · 1.15 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
%ISMILSET Check if dataset is MIL
%
% OUT = ISMILSET(A,LABELED)
%
% INPUT
% A Dataset
% LABELED Flag to test for correct labels (default = 1)
%
% OUTPUT
% OUT True if A is correctly MIL
%
% DESCRIPTION
% Test if dataset A is MIL. It should have
% 1. bags defined,
% 2. 'positive'/'negative' labels defined.
% When LABELED=0, the second check is not performed, but only the first
% one.
%
% SEE ALSO
% ismillabelled, hasmilbags
% 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
function out = ismilset(a,labeled)
if nargin<2
labeled=1;
end
% We start with a positive attitude:
out = 1;
% check if it is a dataset (pretty basic...)
if ~isdataset(a)
out = 0;
if nargout==0
disp('A is not a dataset.');
clear out;
end
return
end
% bags defined?
out = hasmilbags(a);
% if the bags are defined, and the user also want to check the labels,
% then also look if the labels are correct:
if out & labeled
out = ismillabeled(a);
end
% give something on the commandline when nargout=0
if (nargout==0) & ~out
error('Dataset is not MIL.');
end
return