Safe Haskell | None |
---|---|
Language | Haskell98 |
Data.SVM
Description
This module provides a safe bindings to libsvm functions and structures with implicit memory handling.
- type Vector = IntMap Double
- type Problem = [(Double, Vector)]
- data KernelType
- data Algorithm
- data ExtraParam = ExtraParam {}
- data Model
- train :: Algorithm -> KernelType -> Problem -> IO Model
- train' :: ExtraParam -> Algorithm -> KernelType -> Problem -> IO Model
- crossValidate :: Algorithm -> KernelType -> Problem -> Int -> IO [Double]
- crossValidate' :: ExtraParam -> Algorithm -> KernelType -> Problem -> Int -> IO [Double]
- loadModel :: FilePath -> IO Model
- saveModel :: Model -> FilePath -> IO ()
- predict :: Model -> Vector -> IO Double
Documentation
type Vector = IntMap Double Source #
Vector type provides a sparse implementation of vector. It uses IntMap as underlying implementation.
type Problem = [(Double, Vector)] Source #
SVM problem is a list of maps from training vectors to 1.0 or -1.0
data KernelType Source #
Kernel function for SVM algorithm.
SVM Algorithm with parameters
train :: Algorithm -> KernelType -> Problem -> IO Model Source #
The train
function allows training a Model
starting from a Problem
by specifying an Algorithm
and a KernelType
train' :: ExtraParam -> Algorithm -> KernelType -> Problem -> IO Model Source #
Like train
but with extra parameters
crossValidate :: Algorithm -> KernelType -> Problem -> Int -> IO [Double] Source #
Stratified cross validation
crossValidate' :: ExtraParam -> Algorithm -> KernelType -> Problem -> Int -> IO [Double] Source #
Like crossvalidate
but with extra parameters