mltool-0.2.0.1: Machine Learning Toolbox

Copyright(c) Alexander Ignatyev 2016-2017
LicenseBSD-3
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

MachineLearning.Classification.MultiClass

Description

MultiClass Classification.

Synopsis

Documentation

class Classifier a where Source #

Classifier type class represents Multi-class classification models.

Minimal complete definition

cscore, chypothesis, ccost, cgradient, cnumClasses

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 

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.

data Regularization Source #

Regularization

Constructors

RegNone

No regularization

L2 R

L2 Regularization

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.