-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Most frequently used machine learning tools
--
-- Please see the README on Github at
-- https://github.com/masterdezign/Learning#readme
@package Learning
@version 0.0.0
-- |
Machine learning utilities
--
-- A micro library containing the most common machine learning tools.
-- Check also the mltool package
-- https://hackage.haskell.org/package/mltool.
module Learning
data Dataset a b
Dataset :: [a] -> [b] -> Dataset a b
[_samples] :: Dataset a b -> [a]
[_labels] :: Dataset a b -> [b]
data PCA
PCA :: Matrix Double -> (Vector Double -> Matrix Double) -> (Matrix Double -> Vector Double) -> PCA
[_u] :: PCA -> Matrix Double
[_compress] :: PCA -> Vector Double -> Matrix Double
[_decompress] :: PCA -> Matrix Double -> Vector Double
-- | Principal component analysis (PCA)
pca :: Int -> [Vector Double] -> PCA
type Classifier a = (Matrix Double -> a)
-- | Perform supervised learning to create a linear classifier. The ridge
-- regression is run with regularization parameter mu=1e-4.
learn :: Storable a => Vector a -> Matrix Double -> Matrix Double -> Either String (Classifier a)
-- | Create a linear readout using the ridge regression
learn' :: Matrix Double -> Matrix Double -> Maybe (Matrix Double)
-- | Teacher matrix
teacher :: Int -> Int -> Int -> Matrix Double
-- | Evaluate the network state (nonlinear response) according to some
-- readout matrix trW.
scores :: Matrix Double -> Matrix Double -> Vector Double
-- | Winner-takes-all classification method
winnerTakesAll :: Storable a => Matrix Double -> Vector a -> Classifier a
-- | Returns the misclassified cases
errors :: Eq a => [(a, a)] -> [(a, a)]
-- | Calculates the error rate in %
errorRate :: (Eq a, Fractional err) => [a] -> [a] -> err