You can always check if a dataset is a proper one-class dataset by
>> isocset(x)This is often not very useful for normal users, but becomes important when you're constructing one-class classifiers for yourself.
When a one-class dataset is constructed, you can extract again which objects are target or outlier:
>> [It,Io] = find_target(x) >> xt = x(It,:); >> xo = x(Io,:);Thus find_target returns the indices of the target (in It) and the outlier data (in Io). This is often used to split a one-class dataset into target and outlier objects. This is cheaper than running target_class twice:
>> xt = target_class(x); >> xo = target_class(x,'outlier');This last implementation has the added drawback that xo is now labeled target. The advantage of using target_class is, that in one comment you can extract the target class from the data into a new Prtools dataset. This avoids the lengthy construction It=find_target(x); xt=x(It,:).
The only special thing about one-class datasets is actually, that they contain just 1 or 2 classes, with the labels target and/or outlier. When you define your own dataset with these two labels, it will be automatically recognized as a one-class dataset.3.1 Other datasets with two classes are not one-class datasets, because there it is not clear which of the two is considered the target class.