forgot file.

This commit is contained in:
Nicole Dresselhaus 2018-06-07 12:15:07 +02:00
parent cc6fac6533
commit eeacfad4f6
Signed by: Drezil
GPG Key ID: 057D94F356F41E25

20
src/Evaluation.hs Normal file
View File

@ -0,0 +1,20 @@
module Evaluation ( varianceOfProducedCompounds
, meanOfDistinctCompounds
) where
import Control.Foldl as F
import Numeric.LinearAlgebra as LA
import Environment
eps :: Amount
eps = 0.01
varianceOfProducedCompounds :: [LA.Vector Amount] -> Double
varianceOfProducedCompounds comps = F.fold F.variance $ sumElements <$> comps
-- | count compound as active if it is over eps.
meanOfDistinctCompounds :: [LA.Vector Amount] -> Double
meanOfDistinctCompounds comps = F.fold F.mean $ sumElements . LA.cmap (\x -> if abs x < eps then 0 else 1) <$> comps
-- TODO: Mean enzyme-activity?