Safe HaskellNone




indicator :: Num a => Bool -> aSource

bool2num :: Num a => Bool -> aSource

num2bool :: (Ord a, Num a) => a -> BoolSource

class Labeled dp whereSource

Associated Types

type Label dp Source

type Attributes dp Source


getLabel :: dp -> Label dpSource

getAttributes :: dp -> Attributes dpSource


Labeled (Coord ring) 
Labeled (label, attr) 

class Labeled (Datapoint model) => ProbabilityClassifier model whereSource

Associated Types

type ResultDistribution model Source


(ProbabilityClassifier (BaseModel params), ~ * (Ring (BaseModel params)) (Ring (ResultDistribution (FiniteBoost params))), Module (ResultDistribution (FiniteBoost params)), FiniteBoostParams params) => ProbabilityClassifier (FiniteBoost params) 
(~ * (Margin labelLens dist) (Categorical label prob), Ord label, Ord prob, Fractional prob, ~ * label (Label (Datapoint dist)), ~ * prob (Probability (MarginalizeOut labelLens dist)), Labeled (Datapoint dist), ~ * (Datapoint (MarginalizeOut labelLens dist)) (Attributes (Datapoint dist)), PDF (MarginalizeOut labelLens dist), PDF (Margin labelLens dist), Marginalize labelLens dist) => ProbabilityClassifier (Bayes labelLens dist) 
(Ord label, Ord (Ring dp), MetricSpace (Centroid dp), Monoid dp, HasRing dp) => ProbabilityClassifier (Perceptron label dp) 
(ProbabilityClassifier basemodel, Monoid (ResultDistribution basemodel)) => ProbabilityClassifier (MonoidBoost k basemodel) 
(Ord label, ~ * label (Label (label, dp)), Foldable container, MetricSpace dp, Ord (Ring dp)) => ProbabilityClassifier (NaiveNN container label dp) 

class MarginClassifier model whereSource


margin :: model -> Attributes (Datapoint model) -> (Ring model, Label (Datapoint model))Source

class Labeled (Datapoint model) => Classifier model whereSource


classify :: model -> Attributes (Datapoint model) -> Label (Datapoint model)Source


Floating ring => Classifier (PowerLaw ring) 
(ProbabilityClassifier (Bayes labelLens dist), ~ * (Label (Datapoint (Bayes labelLens dist))) (Datapoint (Margin labelLens dist)), Mean (Margin labelLens dist)) => Classifier (Bayes labelLens dist) 

class (Classifier model, Ring model ~ Label (Datapoint model)) => Regression model Source

this is a default instance that any instance of Classifier should satisfy if it is also an instance of ProbabilityClassifier instance ( Label (Datapoint model) ~ Datapoint (ResultDistribution model) , Mean (ResultDistribution model) , ProbabilityClassifier model ) => Classifier model where classify model dp = mean $ probabilityClassify model dp

Regression is classification where the class labels are (isomorphic to) real numbers. The constraints could probably be better specified, but they're close enough for now.


(Classifier model, ~ * (Ring model) (Label (Datapoint model))) => Regression model