Problem: How to define a detector for a class of interest?
Solution: The sddetector command provides a ready to use solution.
PRSD Studio provides a shortcut for easy construction of detectors, the sddetector.
It expects the dataset, the name of the target class and an untrained model. If the desired target class is present in the dataset all remaining classes are used as non target. sddetector trains the model and performs ROC analysis on data subsets. The
ROC is used to set the operating point.
>> load fruit % load a three class dataset
>> [pd,r]=sddetector(a,'banana',sdgauss) % 'banana' is the target class
new lablist:
1: apple -> non-banana
2: banana -> banana
3: stone -> non-banana
sequential pipeline 2x1 'Gaussian model+Decision'
1 Gaussian model 2x1 one class, 1 component (sdp_normal)
2 Decision 1x1 thresholding ROC on banana at op 34 (sdp_decide)
ROC (52 thr-based op.points, 3 measures), curop: 34
est: 1:err(banana)=0.20, 2:err(non-banana)=0.09, 3:mean-error=0.15
>> sdscatter(a,pd,'roc',r)
Both the ROC curve and the scatter plot are provided with this option of sdscatter. In the scatterplot, the blue region include the points of the feature space that would be labelled as 'banana' by the detector. It can be visually seen that a single gaussion was used to model the 'banana' class. By hovering the mouse over the operating points on the ROC curve, the labeled image of the 'banana' detector shrinks accordingly in the scatter plot.
