diff --git a/src/Evaluation.hs b/src/Evaluation.hs new file mode 100644 index 0000000..fc8deaf --- /dev/null +++ b/src/Evaluation.hs @@ -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?