Copyright | (c) Alexander Ignatyev 2016-2017 |
---|---|
License | BSD-3 |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
MachineLearning.Classification.MultiClass
Description
MultiClass Classification.
- class Classifier a where
- data MultiClassModel m = MultiClass m
- processOutput :: Classifier c => c -> Vector -> Matrix
- data Regularization
- ccostReg :: Regularization -> Matrix -> R
- cgradientReg :: Regularization -> Matrix -> Matrix
Documentation
class Classifier a where Source #
Classifier type class represents Multi-class classification models.
Minimal complete definition
Methods
cscore :: a -> Matrix -> Matrix -> Matrix Source #
Score function
chypothesis :: a -> Matrix -> Matrix -> Vector Source #
Hypothesis function Takes X (m x n) and theta (n x k), returns y (m x k).
ccost :: a -> Regularization -> Matrix -> Vector -> Matrix -> R Source #
Cost function J(Theta), a.k.a. loss function. It takes regularizarion parameter lambda, matrix X (m x n), vector y (m x 1) and vector theta (n x 1).
cgradient :: a -> Regularization -> Matrix -> Vector -> Matrix -> Matrix Source #
Gradient function. It takes regularizarion parameter lambda, X (m x n), y (m x 1) and theta (n x 1). Returns vector of gradients (n x 1).
cnumClasses :: a -> Int Source #
Returns Number of Classes
data MultiClassModel m Source #
MultiClassModel is Model wrapper class around Classifier
Constructors
MultiClass m |
Instances
Classifier a => Model (MultiClassModel a) Source # | |
processOutput :: Classifier c => c -> Vector -> Matrix Source #
Process outputs for MultiClass Classification. Takes Classifier and output vector y. Returns matrix of binary outputs. It is supposed that labels are integerets start at 0.
ccostReg :: Regularization -> Matrix -> R Source #
Calculates regularization for Classifier.ccost. It takes regularization parameter and theta.
cgradientReg :: Regularization -> Matrix -> Matrix Source #
Calculates regularization for Classifier.cgradient. It takes regularization parameter and theta.