Safe Haskell | None |
---|---|
Language | Haskell2010 |
Machine learning utilities
A micro library containing the most common machine learning tools. Check also the mltool package https://hackage.haskell.org/package/mltool.
- data Dataset a b = Dataset {}
- data PCA = PCA {}
- pca :: Int -> [Vector Double] -> PCA
- type Classifier a = Matrix Double -> a
- learn :: Storable a => Vector a -> Matrix Double -> Matrix Double -> Either String (Classifier a)
- learn' :: Matrix Double -> Matrix Double -> Maybe (Matrix Double)
- teacher :: Int -> Int -> Int -> Matrix Double
- scores :: Matrix Double -> Matrix Double -> Vector Double
- winnerTakesAll :: Storable a => Matrix Double -> Vector a -> Classifier a
- errors :: Eq a => [(a, a)] -> [(a, a)]
- errorRate :: (Eq a, Fractional err) => [a] -> [a] -> err
Datasets
Principal component analysis
Supervised learning
type Classifier a = Matrix Double -> a Source #
learn :: Storable a => Vector a -> Matrix Double -> Matrix Double -> Either String (Classifier a) Source #
Perform supervised learning to create a linear classifier. The ridge regression is run with regularization parameter mu=1e-4.
learn' :: Matrix Double -> Matrix Double -> Maybe (Matrix Double) Source #
Create a linear readout using the ridge regression
scores :: Matrix Double -> Matrix Double -> Vector Double Source #
Evaluate the network state (nonlinear response) according to some readout matrix trW.
:: Storable a | |
=> Matrix Double | Transposed readout matrix |
-> Vector a | Vector of possible classes |
-> Classifier a |
Winner-takes-all classification method
Evaluation
errorRate :: (Eq a, Fractional err) => [a] -> [a] -> err Source #
Calculates the error rate in %