Copyright | (c) Amy de Buitléir 2012-2018 |
---|---|

License | BSD-style |

Maintainer | amy@nualeargais.ie |

Stability | experimental |

Portability | portable |

Safe Haskell | Safe |

Language | Haskell2010 |

Tools for identifying patterns in data.

## Synopsis

- class Classifier (c :: * -> * -> * -> *) v k p where
- toList :: c v k p -> [(k, p)]
- numModels :: c v k p -> Int
- models :: c v k p -> [p]
- differences :: c v k p -> p -> [(k, v)]
- classify :: Ord v => c v k p -> p -> k
- train :: c v k p -> p -> c v k p
- trainBatch :: c v k p -> [p] -> c v k p
- classifyAndTrain :: c v k p -> p -> (k, c v k p)
- diffAndTrain :: c v k p -> p -> ([(k, v)], c v k p)
- reportAndTrain :: c v k p -> p -> (k, [(k, v)], c v k p)

# Documentation

class Classifier (c :: * -> * -> * -> *) v k p where Source #

A machine which learns to classify input patterns.
Minimal complete definition: `trainBatch`

, `reportAndTrain`

.

toList :: c v k p -> [(k, p)] Source #

Returns a list of index/model pairs.

numModels :: c v k p -> Int Source #

Returns the number of models this classifier can learn.

models :: c v k p -> [p] Source #

Returns the current models of the classifier.

differences :: c v k p -> p -> [(k, v)] Source #

returns the indices of all nodes in
`differences`

c target`c`

, paired with the difference between `target`

and the
node's model.

classify :: Ord v => c v k p -> p -> k Source #

`classify c target`

returns the index of the node in `c`

whose model best matches the `target`

.

train :: c v k p -> p -> c v k p Source #

returns a modified copy
of the classifier `train`

c target`c`

that has partially learned the `target`

.

trainBatch :: c v k p -> [p] -> c v k p Source #

returns a modified copy
of the classifier `trainBatch`

c targets`c`

that has partially learned the `targets`

.

classifyAndTrain :: c v k p -> p -> (k, c v k p) Source #

returns a tuple containing the
index of the node in `classifyAndTrain`

c target`c`

whose model best matches the input
`target`

, and a modified copy of the classifier `c`

that has
partially learned the `target`

. Invoking `classifyAndTrain c p`

may be faster than invoking `(p `

, but
they
should give identical results.`classify`

c, train c p)

diffAndTrain :: c v k p -> p -> ([(k, v)], c v k p) Source #

returns a tuple containing:
1. The indices of all nodes in `diffAndTrain`

c target`c`

, paired with the difference
between `target`

and the node's model
2. A modified copy of the classifier `c`

that has partially
learned the `target`

.
Invoking `diffAndTrain c p`

may be faster than invoking
`(p `

, but they should give identical
results.`diff`

c, train c p)

reportAndTrain :: c v k p -> p -> (k, [(k, v)], c v k p) Source #

returns a tuple containing:
1. The index of the node in `reportAndTrain`

c f target`c`

whose model best matches the
input `target`

2. The indices of all nodes in `c`

, paired with the difference
between `target`

and the node's model
3. A modified copy of the classifier `c`

that has partially
learned the `target`

Invoking `diffAndTrain c p`

may be faster than invoking
`(p `

, but they should give identical
results.`diff`

c, train c p)

## Instances

(GridMap gm p, k ~ Index (BaseGrid gm p), FiniteGrid (gm p), GridMap gm x, k ~ Index (gm p), k ~ Index (gm x), k ~ Index (BaseGrid gm x), Ord k, Ord x, Num x, Fractional x) => Classifier (DSOM gm) x k p Source # | |

Defined in Data.Datamining.Clustering.DSOMInternal toList :: DSOM gm x k p -> [(k, p)] Source # numModels :: DSOM gm x k p -> Int Source # models :: DSOM gm x k p -> [p] Source # differences :: DSOM gm x k p -> p -> [(k, x)] Source # classify :: DSOM gm x k p -> p -> k Source # train :: DSOM gm x k p -> p -> DSOM gm x k p Source # trainBatch :: DSOM gm x k p -> [p] -> DSOM gm x k p Source # classifyAndTrain :: DSOM gm x k p -> p -> (k, DSOM gm x k p) Source # diffAndTrain :: DSOM gm x k p -> p -> ([(k, x)], DSOM gm x k p) Source # reportAndTrain :: DSOM gm x k p -> p -> (k, [(k, x)], DSOM gm x k p) Source # | |

(GridMap gm p, k ~ Index (BaseGrid gm p), Grid (gm p), GridMap gm x, k ~ Index (gm p), k ~ Index (BaseGrid gm x), Num t, Ord x, Num x, Num d) => Classifier (SOM t d gm) x k p Source # | |

Defined in Data.Datamining.Clustering.SOMInternal toList :: SOM t d gm x k p -> [(k, p)] Source # numModels :: SOM t d gm x k p -> Int Source # models :: SOM t d gm x k p -> [p] Source # differences :: SOM t d gm x k p -> p -> [(k, x)] Source # classify :: SOM t d gm x k p -> p -> k Source # train :: SOM t d gm x k p -> p -> SOM t d gm x k p Source # trainBatch :: SOM t d gm x k p -> [p] -> SOM t d gm x k p Source # classifyAndTrain :: SOM t d gm x k p -> p -> (k, SOM t d gm x k p) Source # diffAndTrain :: SOM t d gm x k p -> p -> ([(k, x)], SOM t d gm x k p) Source # reportAndTrain :: SOM t d gm x k p -> p -> (k, [(k, x)], SOM t d gm x k p) Source # |