haskell-ml-0.4.2: Machine learning in Haskell

Copyright(c) David Banas 2018
LicenseBSD-3
Maintainercapn.freako@gmail.com
Stabilityexperimental
Portability?
Safe HaskellNone
LanguageHaskell2010

Haskell_ML.Util

Description

 

Synopsis

Documentation

data Iris Source #

The 3 classes of iris are represented by the 3 constructors of this type.

Constructors

Setosa 
Versicolor 
Virginica 

Instances

type Sample = (Attributes, Iris) Source #

A single sample in the dataset is a pair of a list of attributes and a classification.

readIrisData :: String -> IO [Sample] Source #

Read in an Iris dataset from the given file name.

attributeToVector :: Attributes -> R 4 Source #

Convert a value of type Attributes to a value of type R 4.

irisTypeToVector :: Iris -> R 3 Source #

Convert a value of type Iris to a one-hot vector value of type R 3.

classificationAccuracy :: KnownNat n => [R n] -> [R n] -> Double Source #

Calculate the classification accuracy, given:

  • a list of results vectors, and
  • a list of reference vectors.

printVector :: KnownNat n => R n -> String Source #

Pretty printer for values of type R n.

printVecPair :: (KnownNat m, KnownNat n) => (R m, R n) -> String Source #

Pretty printer for values of type (R m, R n).

mkSmplsUniform :: [Sample] -> [Sample] Source #

Rescale all feature values, to fall in [0,1].

asciiPlot :: [Double] -> String Source #

Plot a list of Doubles to an ASCII terminal.

calcMeanList :: Fractional a => [a] -> a Source #

Calculate the mean value of a list.

for :: [a] -> (a -> b) -> [b] Source #

Convenience function (= flip map).