Copyright(c) Fabricio Olivetti de Franca 2020
LicenseGPL-3
Maintainerfabricio.olivetti@gmail.com
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone

IT.Regression

Description

Definitions of IT data structure and support functions.

Synopsis

IT specific stuff

data Task Source #

Instances

Instances details
Eq Task Source # 
Instance details

Defined in IT.Regression

Methods

(==) :: Task -> Task -> Bool

(/=) :: Task -> Task -> Bool

Read Task Source # 
Instance details

Defined in IT.Regression

Methods

readsPrec :: Int -> ReadS Task

readList :: ReadS [Task]

readPrec :: ReadPrec Task

readListPrec :: ReadPrec [Task]

type FitFun = Vector -> Vector -> Double Source #

data Penalty Source #

Constructors

NoPenalty 
Len Double 
Shape Double 

Instances

Instances details
Read Penalty Source # 
Instance details

Defined in IT.Regression

Methods

readsPrec :: Int -> ReadS Penalty

readList :: ReadS [Penalty]

readPrec :: ReadPrec Penalty

readListPrec :: ReadPrec [Penalty]

Show Penalty Source # 
Instance details

Defined in IT.Regression

Methods

showsPrec :: Int -> Penalty -> ShowS

show :: Penalty -> String

showList :: [Penalty] -> ShowS

predict :: Matrix Double -> Vector -> Vector Source #

Predict a linear model

solveOLS :: Matrix Double -> Vector -> Vector Source #

Solve the OLS *zss*w = ys*

isInvalidMatrix :: Matrix Double -> Bool Source #

regress :: Matrix Double -> Vector -> [Vector] Source #

Applies OLS and returns a Solution if the expression is invalid, it returns Infinity as a fitness

classify :: Matrix Double -> Vector -> [Vector] Source #

classifyMult :: Matrix Double -> Vector -> [Vector] Source #

fitTask :: Task -> Matrix Double -> Vector -> [Vector] Source #

Fitness function for regression

Split the dataset into twice the available cores evaluate the expressions in parallel run a Linear regression on the evaluated expressions Remove from the population any expression that leads to NaNs or Infs it was fitnessReg

predictTask :: Task -> Matrix Double -> [Vector] -> Vector Source #

evalPenalty :: Penalty -> Int -> Double -> Double Source #

applyMeasures :: NonEmpty Measure -> Vector -> Vector -> [Double] Source #

evalTrain :: Task -> NonEmpty Measure -> Constraint -> Penalty -> Dataset Double -> Vector -> Dataset Double -> Vector -> Expr -> Maybe Solution Source #

evalTest :: Task -> NonEmpty Measure -> Dataset Double -> Vector -> Solution -> Maybe [Double] Source #

Evaluates an expression into the test set. This is different from fitnessReg since it doesn't apply OLS. It was: fitnessTest