HLearn-distributions-0.2.1: Distributions for use with the HLearn library

Safe HaskellNone

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

Synopsis

Data types

data Categorical sampletype probtype Source

Constructors

Categorical 

Fields

pdfmap :: !(Map sampletype probtype)
 

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) 
Model CategoricalParams (Categorical label probtype) => DefaultModel CategoricalParams (Categorical label probtype) 
(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) 
(Show label, Show prob, Num prob, Ord prob) => PlottableDistribution (Categorical label prob) 
(Ord label, Ord prob, Fractional 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 

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