| Safe Haskell | None |
|---|
HLearn.Models.Distributions.Categorical
Contents
Description
The categorical distribution is used for discrete data. It is also sometimes called the discrete distribution or the multinomial distribution. For more, see the wikipedia entry: https://en.wikipedia.org/wiki/Categorical_distribution
- data Categorical sampletype probtype = Categorical {}
- data CategoricalParams = CategoricalParams
- dist2list :: Categorical sampletype probtype -> [(sampletype, probtype)]
- mostLikely :: Ord prob => Categorical label prob -> label
Data types
data Categorical sampletype probtype Source
Constructors
| Categorical | |
Instances
| (Semigroup (Categorical label probtype), Monoid (Categorical label probtype), Model CategoricalParams (Categorical label probtype), Ord label, Num probtype) => HomTrainer CategoricalParams label (Categorical label probtype) | |
| Model CategoricalParams (Categorical label probtype) | |
| DefaultModel CategoricalParams (Categorical Int Double) | |
| (Ord label, Num probtype) => LeftOperator probtype (Categorical label probtype) | |
| (Ord label, Num probtype) => RightOperator probtype (Categorical label probtype) | |
| (LeftOperator probtype (Categorical label probtype), Group (Categorical label probtype), Abelian (Categorical label probtype), Ord label, Num probtype) => LeftModule probtype (Categorical label probtype) | |
| (RightOperator probtype (Categorical label probtype), Group (Categorical label probtype), Abelian (Categorical label probtype), Ord label, Num probtype) => RightModule probtype (Categorical label probtype) | |
| (Eq sampletype, Eq probtype) => Eq (Categorical sampletype probtype) | |
| (Eq (Categorical sampletype probtype), Ord sampletype, Ord probtype) => Ord (Categorical sampletype probtype) | |
| (Ord sampletype, Read sampletype, Read probtype) => Read (Categorical sampletype probtype) | |
| (Show sampletype, Show probtype) => Show (Categorical sampletype probtype) | |
| (Ord label, Num probtype) => Semigroup (Categorical label probtype) | |
| (Ord label, Num probtype) => Monoid (Categorical label probtype) | |
| (Semigroup (Categorical label probtype), Ord label, Num probtype) => Abelian (Categorical label probtype) | |
| (Semigroup (Categorical label probtype), Ord label, Num probtype) => RegularSemigroup (Categorical label probtype) | |
| (NFData sampletype, NFData probtype) => NFData (Categorical sampletype probtype) | |
| (Ord label, Ord prob, Floating prob, Random prob) => Distribution (Categorical label prob) label prob | |
| (Ord label, Num probtype) => Morphism (Categorical label probtype) FreeModParams (FreeMod probtype label) | |
| Morphism (Categorical Int Double) (KDEParams Double) (KDE Double) |
data CategoricalParams Source
The Categorical distribution takes no parameters
Constructors
| CategoricalParams |
Instances
| Eq CategoricalParams | |
| Ord CategoricalParams | |
| Read CategoricalParams | |
| Show CategoricalParams | |
| NFData CategoricalParams | |
| (Semigroup (Categorical label probtype), Monoid (Categorical label probtype), Model CategoricalParams (Categorical label probtype), Ord label, Num probtype) => HomTrainer CategoricalParams label (Categorical label probtype) | |
| Model CategoricalParams (Categorical label probtype) | |
| DefaultModel CategoricalParams (Categorical Int Double) |
Helper functions
dist2list :: Categorical sampletype probtype -> [(sampletype, probtype)]Source
Converts a distribution into a list of (sample,probability) pai
mostLikely :: Ord prob => Categorical label prob -> labelSource
Extracts the element in the distribution with the highest probability