mltool-0.2.0.1: Machine Learning Toolbox

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

MachineLearning.Model

Description

Regression Model type class.

Documentation

class Model a where Source #

Minimal complete definition

hypothesis, cost, gradient

Methods

hypothesis :: a -> Matrix -> Vector -> Vector Source #

Hypothesis function, a.k.a. score function (for lassifition problem) Takes X (m x n) and theta (n x 1), returns y (m x 1).

cost :: a -> Regularization -> Matrix -> Vector -> Vector -> R Source #

Cost function J(Theta), a.k.a. loss function. It takes regularizarion parameter, matrix X (m x n), vector y (m x 1) and vector theta (n x 1).

gradient :: a -> Regularization -> Matrix -> Vector -> Vector -> Vector Source #

Gradient function. It takes regularizarion parameter, X (m x n), y (m x 1) and theta (n x 1). Returns vector of gradients (n x 1).