Safe Haskell | Safe-Infered |
---|
NaiveBayes.NaiveBayes
- data NaiveBayes = NaiveBayes {
- cNames :: [ClassName]
- cPrior :: [(ClassName, Probability)]
- dist :: Distribution
- nClasses :: Int
- nDims :: Int
- posteriorFunctions :: [Probe]
- display :: NaiveBayes -> IO ()
- fit :: PriorType -> Distribution -> DataSet -> NaiveBayes
- posterior :: NaiveBayes -> FeatureVector -> ClassName -> Probability
- predict :: NaiveBayes -> FeatureVector -> ClassName
- predictMulti :: NaiveBayes -> [FeatureVector] -> [ClassName]
Documentation
data NaiveBayes
This is a NaiveBayes object. It stores the classnames, priorprobabilities, distribution, dimensions, PosteriorFunctions are the list of probes for each of the features
Constructors
NaiveBayes | |
Fields
|
Instances
Show NaiveBayes |
display :: NaiveBayes -> IO ()
fit :: PriorType -> Distribution -> DataSet -> NaiveBayes
fits the given data set to give the naive bayes object
posterior :: NaiveBayes -> FeatureVector -> ClassName -> Probability
Finds the probability of the featurevector for a given naive bayes object
predict :: NaiveBayes -> FeatureVector -> ClassName
Predicts the class a particular data point belongs to given the naive bayes object
predictMulti :: NaiveBayes -> [FeatureVector] -> [ClassName]
predicts the classes for a list of feature vectors