Package com.namsor.oss.classify.bayes
Interface IClassification
-
- All Known Subinterfaces:
IClassificationExplained
- All Known Implementing Classes:
ClassificationExplainedImpl
,ClassificationImpl
public interface IClassification
Classification output : class probabilities and (optionally) the features and counters for explanation / audit trail- Author:
- elian
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description IClassProbability[]
getClassProbabilities()
The ordered classes and probabilities.Map<String,Long>
getExplanationData()
All the data needed to explain the results.Map<String,String>
getFeatures()
The input featuresdouble
getLaplaceSmoothingAlpha()
The alpha value used for Laplace smoothingboolean
isLaplaceSmoothed()
Is Laplace smoothed?boolean
isLaplaceSmoothedVariant()
If Laplace Smoothed With variant, then: likelyhood[i] = 1d * ((categoryCount + alpha) / (globalCount + globalCountCategories * alpha)) * product; otherwise: likelyhood[i] = 1d * categoryCount / globalCount * product;
-
-
-
Method Detail
-
getClassProbabilities
IClassProbability[] getClassProbabilities()
The ordered classes and probabilities.- Returns:
- the classProbabilities : class name and probability (possibly the last class is 'Other')
-
getExplanationData
Map<String,Long> getExplanationData()
All the data needed to explain the results.- Returns:
- the explanation : list of features and counts
-
isLaplaceSmoothed
boolean isLaplaceSmoothed()
Is Laplace smoothed?- Returns:
- True if Laplace smoothed
-
isLaplaceSmoothedVariant
boolean isLaplaceSmoothedVariant()
If Laplace Smoothed With variant, then: likelyhood[i] = 1d * ((categoryCount + alpha) / (globalCount + globalCountCategories * alpha)) * product; otherwise: likelyhood[i] = 1d * categoryCount / globalCount * product;- Returns:
- If Laplace smothing variant used
-
getLaplaceSmoothingAlpha
double getLaplaceSmoothingAlpha()
The alpha value used for Laplace smoothing- Returns:
- The alpha value, usually 1.0
-
-