I have a similar problem as this one. My training samples contain N observations and K>2 classes. I want to classify my test samples into one of the K classes, or as an outlier if it is far from any known class.
Is there any R(preferred) or Python package to solve this?
One method I can think of is to use some sort of Gaussian fitting. I fit my in-sample data to get K Gaussian distributions, then for new samples I check its probability w.r.t each of the K distributions. If the largest one is above some threshold, I classify it to the class with largest prob, else it's an outlier.
Is there a package to do this? Or preferreably a more sophisticated approach. This approach suffers from curse of dimensionality I think. Maybe random forest? SVM?
The gausspr
in R package kernlab
seems to provide this. But after fitting, predict(..., type = 'probabilities')
only gives normalised probability (prob for K classes to sum to 1). Can I get the raw score before normalisation?
?predict.gausspr
works to get the doc, butpredict.gausspr
gets meobject predict.gausspr not found
$\endgroup$ – jf328 Jul 17 '16 at 16:14kernlab:::predict.gausspr
(with three:
s) $\endgroup$ – shadowtalker Jul 17 '16 at 16:16