Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
34fdc83c10 | ||
|
9d7efe596c | ||
|
54e45a31d2 | ||
|
76a6c6c840 | ||
|
4835d3ff51 | ||
|
c6de876e2d | ||
|
155bc888bf | ||
|
137aaf81f4 |
|
@ -38,7 +38,7 @@ lE =
|
||||||
((Ref.SomeTypeRep (Ref.TypeRep @(Int -> Int -> Int))), ["(+)", "(-)", "(*)"]),
|
((Ref.SomeTypeRep (Ref.TypeRep @(Int -> Int -> Int))), ["(+)", "(-)", "(*)"]),
|
||||||
-- Logic
|
-- Logic
|
||||||
((Ref.SomeTypeRep (Ref.TypeRep @(Bool -> Bool -> Bool))), ["(&&)", "(||)"]),
|
((Ref.SomeTypeRep (Ref.TypeRep @(Bool -> Bool -> Bool))), ["(&&)", "(||)"]),
|
||||||
-- Ordered Enums
|
-- Ordered
|
||||||
((Ref.SomeTypeRep (Ref.TypeRep @(Int -> Int -> Bool))), ["(>)", "(==)", "(/=)", "(>=)"]),
|
((Ref.SomeTypeRep (Ref.TypeRep @(Int -> Int -> Bool))), ["(>)", "(==)", "(/=)", "(>=)"]),
|
||||||
((Ref.SomeTypeRep (Ref.TypeRep @(AccountStatus -> AccountStatus -> Bool))), ["(>)", "(==)", "(/=)", "(>=)"]),
|
((Ref.SomeTypeRep (Ref.TypeRep @(AccountStatus -> AccountStatus -> Bool))), ["(>)", "(==)", "(/=)", "(>=)"]),
|
||||||
((Ref.SomeTypeRep (Ref.TypeRep @(CreditHistory -> CreditHistory -> Bool))), ["(>)", "(==)", "(/=)", "(>=)"]),
|
((Ref.SomeTypeRep (Ref.TypeRep @(CreditHistory -> CreditHistory -> Bool))), ["(>)", "(==)", "(/=)", "(>=)"]),
|
||||||
|
@ -46,7 +46,7 @@ lE =
|
||||||
((Ref.SomeTypeRep (Ref.TypeRep @(EmploymentStatus -> EmploymentStatus -> Bool))), ["(>)", "(==)", "(/=)", "(>=)"]),
|
((Ref.SomeTypeRep (Ref.TypeRep @(EmploymentStatus -> EmploymentStatus -> Bool))), ["(>)", "(==)", "(/=)", "(>=)"]),
|
||||||
((Ref.SomeTypeRep (Ref.TypeRep @(OtherDebtors -> OtherDebtors -> Bool))), ["(>)", "(==)", "(/=)", "(>=)"]),
|
((Ref.SomeTypeRep (Ref.TypeRep @(OtherDebtors -> OtherDebtors -> Bool))), ["(>)", "(==)", "(/=)", "(>=)"]),
|
||||||
((Ref.SomeTypeRep (Ref.TypeRep @(Job -> Job -> Bool))), ["(>)", "(==)", "(/=)", "(>=)"]),
|
((Ref.SomeTypeRep (Ref.TypeRep @(Job -> Job -> Bool))), ["(>)", "(==)", "(/=)", "(>=)"]),
|
||||||
-- Eq Enum
|
-- Eq
|
||||||
((Ref.SomeTypeRep (Ref.TypeRep @(GermanClass -> GermanClass -> Bool))), ["(==)", "(/=)"]),
|
((Ref.SomeTypeRep (Ref.TypeRep @(GermanClass -> GermanClass -> Bool))), ["(==)", "(/=)"]),
|
||||||
((Ref.SomeTypeRep (Ref.TypeRep @(Purpose -> Purpose -> Bool))), ["(==)", "(/=)"]),
|
((Ref.SomeTypeRep (Ref.TypeRep @(Purpose -> Purpose -> Bool))), ["(==)", "(/=)"]),
|
||||||
((Ref.SomeTypeRep (Ref.TypeRep @(StatusAndSex -> StatusAndSex -> Bool))), ["(==)", "(/=)"]),
|
((Ref.SomeTypeRep (Ref.TypeRep @(StatusAndSex -> StatusAndSex -> Bool))), ["(==)", "(/=)"]),
|
||||||
|
@ -55,7 +55,7 @@ lE =
|
||||||
((Ref.SomeTypeRep (Ref.TypeRep @(Housing -> Housing -> Bool))), ["(==)", "(/=)"]),
|
((Ref.SomeTypeRep (Ref.TypeRep @(Housing -> Housing -> Bool))), ["(==)", "(/=)"]),
|
||||||
-- Any Type
|
-- Any Type
|
||||||
((Ref.SomeTypeRep (Ref.TypeRep @(Bool -> Int -> Int -> Int))), ["if'"]),
|
((Ref.SomeTypeRep (Ref.TypeRep @(Bool -> Int -> Int -> Int))), ["if'"]),
|
||||||
((Ref.SomeTypeRep (Ref.TypeRep @(Bool -> GermanClass -> GermanClass -> GermanClass))), ["if'","if'","if'","if'","if'","if'","if'","if'"]),
|
((Ref.SomeTypeRep (Ref.TypeRep @(Bool -> GermanClass -> GermanClass -> GermanClass))), ["if'"]),
|
||||||
((Ref.SomeTypeRep (Ref.TypeRep @(Bool -> AccountStatus -> AccountStatus -> AccountStatus))), ["if'"]),
|
((Ref.SomeTypeRep (Ref.TypeRep @(Bool -> AccountStatus -> AccountStatus -> AccountStatus))), ["if'"]),
|
||||||
((Ref.SomeTypeRep (Ref.TypeRep @(Bool -> CreditHistory -> CreditHistory -> CreditHistory))), ["if'"]),
|
((Ref.SomeTypeRep (Ref.TypeRep @(Bool -> CreditHistory -> CreditHistory -> CreditHistory))), ["if'"]),
|
||||||
((Ref.SomeTypeRep (Ref.TypeRep @(Bool -> Purpose -> Purpose -> Purpose))), ["if'"]),
|
((Ref.SomeTypeRep (Ref.TypeRep @(Bool -> Purpose -> Purpose -> Purpose))), ["if'"]),
|
||||||
|
@ -89,10 +89,10 @@ lE =
|
||||||
maxDepth = 8,
|
maxDepth = 8,
|
||||||
weights =
|
weights =
|
||||||
ExpressionWeights
|
ExpressionWeights
|
||||||
{ lambdaSpucker = 1,
|
{ lambdaSpucker = 10,
|
||||||
lambdaSchlucker = 2,
|
lambdaSchlucker = 1,
|
||||||
symbol = 30,
|
symbol = 20,
|
||||||
variable = 10,
|
variable = 100,
|
||||||
constant = 5
|
constant = 5
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -189,7 +189,7 @@ evalResults ex trs = do
|
||||||
evalResult :: LamdaExecutionEnv -> TypeRequester -> (AccountStatus -> Int -> CreditHistory -> Purpose -> Int -> Savings -> EmploymentStatus -> Int -> StatusAndSex -> OtherDebtors -> Int -> Property -> Int -> OtherPlans -> Housing -> Int -> Job -> Int -> Bool -> Bool -> GermanClass) -> (TypeRequester, FittnesRes)
|
evalResult :: LamdaExecutionEnv -> TypeRequester -> (AccountStatus -> Int -> CreditHistory -> Purpose -> Int -> Savings -> EmploymentStatus -> Int -> StatusAndSex -> OtherDebtors -> Int -> Property -> Int -> OtherPlans -> Housing -> Int -> Job -> Int -> Bool -> Bool -> GermanClass) -> (TypeRequester, FittnesRes)
|
||||||
evalResult ex tr result = ( tr,
|
evalResult ex tr result = ( tr,
|
||||||
FittnesRes
|
FittnesRes
|
||||||
{ total = score,
|
{ total = acc * 100 + (biasSmall - 1),
|
||||||
fitnessTotal = fitness',
|
fitnessTotal = fitness',
|
||||||
fitnessMean = meanOfAccuricyPerClass resAndTarget,
|
fitnessMean = meanOfAccuricyPerClass resAndTarget,
|
||||||
fitnessGeoMean = geomeanOfDistributionAccuracy resAndTarget,
|
fitnessGeoMean = geomeanOfDistributionAccuracy resAndTarget,
|
||||||
|
|
|
@ -34,12 +34,17 @@ lE =
|
||||||
LambdaEnviroment
|
LambdaEnviroment
|
||||||
{ functions =
|
{ functions =
|
||||||
Map.fromList
|
Map.fromList
|
||||||
[ ((Ref.SomeTypeRep (Ref.TypeRep @(Float -> Float -> Float))), ["(+)", "(-)", "(*)"]),
|
[ -- Math
|
||||||
((Ref.SomeTypeRep (Ref.TypeRep @(Float -> Float -> Bool))), ["(>)", "(==)", "(>=)"]),
|
((Ref.SomeTypeRep (Ref.TypeRep @(Float -> Float -> Float))), ["(+)", "(-)", "(*)"]),
|
||||||
((Ref.SomeTypeRep (Ref.TypeRep @(IrisClass -> IrisClass -> Bool))), ["(==)"]),
|
-- Logic
|
||||||
((Ref.SomeTypeRep (Ref.TypeRep @(Bool -> Float -> Float -> Float))), ["if'","if'","if'","if'","if'","if'","if'","if'"]),
|
|
||||||
((Ref.SomeTypeRep (Ref.TypeRep @(Bool -> Bool -> Bool))), ["(&&)", "(||)"]),
|
((Ref.SomeTypeRep (Ref.TypeRep @(Bool -> Bool -> Bool))), ["(&&)", "(||)"]),
|
||||||
((Ref.SomeTypeRep (Ref.TypeRep @(Bool -> IrisClass -> IrisClass -> IrisClass))), ["if'","if'","if'","if'","if'","if'","if'","if'","if'","if'"])
|
-- Ordered
|
||||||
|
((Ref.SomeTypeRep (Ref.TypeRep @(Float -> Float -> Bool))), ["(>)", "(==)", "(/=)", "(>=)"]),
|
||||||
|
-- Eq
|
||||||
|
((Ref.SomeTypeRep (Ref.TypeRep @(IrisClass -> IrisClass -> Bool))), ["(==)","(/=)"]),
|
||||||
|
-- Any Type
|
||||||
|
((Ref.SomeTypeRep (Ref.TypeRep @(Bool -> Float -> Float -> Float))), ["if'"]),
|
||||||
|
((Ref.SomeTypeRep (Ref.TypeRep @(Bool -> IrisClass -> IrisClass -> IrisClass))), ["if'"])
|
||||||
],
|
],
|
||||||
constants =
|
constants =
|
||||||
Map.fromList
|
Map.fromList
|
||||||
|
@ -48,12 +53,12 @@ lE =
|
||||||
((Ref.SomeTypeRep (Ref.TypeRep @(IrisClass))), [(fmap show (enumUniform Setosa Versicolor :: RVar IrisClass))])
|
((Ref.SomeTypeRep (Ref.TypeRep @(IrisClass))), [(fmap show (enumUniform Setosa Versicolor :: RVar IrisClass))])
|
||||||
],
|
],
|
||||||
targetType = (Ref.SomeTypeRep (Ref.TypeRep @(Float -> Float -> Float -> Float -> IrisClass))),
|
targetType = (Ref.SomeTypeRep (Ref.TypeRep @(Float -> Float -> Float -> Float -> IrisClass))),
|
||||||
maxDepth = 10,
|
maxDepth = 8,
|
||||||
weights =
|
weights =
|
||||||
ExpressionWeights
|
ExpressionWeights
|
||||||
{ lambdaSpucker = 1,
|
{ lambdaSpucker = 10,
|
||||||
lambdaSchlucker = 1,
|
lambdaSchlucker = 1,
|
||||||
symbol = 30,
|
symbol = 20,
|
||||||
variable = 100,
|
variable = 100,
|
||||||
constant = 5
|
constant = 5
|
||||||
}
|
}
|
||||||
|
@ -63,7 +68,7 @@ lEE :: LamdaExecutionEnv
|
||||||
lEE =
|
lEE =
|
||||||
LamdaExecutionEnv
|
LamdaExecutionEnv
|
||||||
{ -- For now these need to define all available functions and types. Generic functions can be used.
|
{ -- For now these need to define all available functions and types. Generic functions can be used.
|
||||||
imports = ["LambdaDatasets.IrisDataset"],
|
imports = ["LambdaDatasets.IrisDefinition"],
|
||||||
training = True,
|
training = True,
|
||||||
trainingData =
|
trainingData =
|
||||||
( map fst (takeFraktion 0.8 irisTrainingData),
|
( map fst (takeFraktion 0.8 irisTrainingData),
|
||||||
|
@ -84,7 +89,7 @@ shuffledLEE = do
|
||||||
itD <- smpl $ shuffle irisTrainingData
|
itD <- smpl $ shuffle irisTrainingData
|
||||||
return LamdaExecutionEnv
|
return LamdaExecutionEnv
|
||||||
{ -- For now these need to define all available functions and types. Generic functions can be used.
|
{ -- For now these need to define all available functions and types. Generic functions can be used.
|
||||||
imports = ["LambdaDatasets.IrisDataset"],
|
imports = ["LambdaDatasets.IrisDefinition"],
|
||||||
training = True,
|
training = True,
|
||||||
trainingData =
|
trainingData =
|
||||||
( map fst (takeFraktion 0.8 itD),
|
( map fst (takeFraktion 0.8 itD),
|
||||||
|
@ -150,7 +155,7 @@ evalResults ex trs = do
|
||||||
evalResult :: LamdaExecutionEnv -> TypeRequester -> (Float -> Float -> Float -> Float -> IrisClass) -> (TypeRequester, FittnesRes)
|
evalResult :: LamdaExecutionEnv -> TypeRequester -> (Float -> Float -> Float -> Float -> IrisClass) -> (TypeRequester, FittnesRes)
|
||||||
evalResult ex tr result = ( tr,
|
evalResult ex tr result = ( tr,
|
||||||
FittnesRes
|
FittnesRes
|
||||||
{ total = score,
|
{ total = acc * 100 + (biasSmall - 1),
|
||||||
fitnessTotal = fitness',
|
fitnessTotal = fitness',
|
||||||
fitnessMean = meanOfAccuricyPerClass resAndTarget,
|
fitnessMean = meanOfAccuricyPerClass resAndTarget,
|
||||||
fitnessGeoMean = geomeanOfDistributionAccuracy resAndTarget,
|
fitnessGeoMean = geomeanOfDistributionAccuracy resAndTarget,
|
||||||
|
|
|
@ -37,7 +37,7 @@ lE =
|
||||||
[ -- Math
|
[ -- Math
|
||||||
-- Logic
|
-- Logic
|
||||||
((Ref.SomeTypeRep (Ref.TypeRep @(Bool -> Bool -> Bool))), ["(&&)", "(||)"]),
|
((Ref.SomeTypeRep (Ref.TypeRep @(Bool -> Bool -> Bool))), ["(&&)", "(||)"]),
|
||||||
-- Ordered Enums
|
-- Ordered
|
||||||
((Ref.SomeTypeRep (Ref.TypeRep @(NurseryClass -> NurseryClass -> Bool))), ["(>)", "(==)", "(/=)", "(>=)"]),
|
((Ref.SomeTypeRep (Ref.TypeRep @(NurseryClass -> NurseryClass -> Bool))), ["(>)", "(==)", "(/=)", "(>=)"]),
|
||||||
((Ref.SomeTypeRep (Ref.TypeRep @(Parents -> Parents -> Bool))), ["(>)", "(==)", "(/=)", "(>=)"]),
|
((Ref.SomeTypeRep (Ref.TypeRep @(Parents -> Parents -> Bool))), ["(>)", "(==)", "(/=)", "(>=)"]),
|
||||||
((Ref.SomeTypeRep (Ref.TypeRep @(HasNurs -> HasNurs -> Bool))), ["(>)", "(==)", "(/=)", "(>=)"]),
|
((Ref.SomeTypeRep (Ref.TypeRep @(HasNurs -> HasNurs -> Bool))), ["(>)", "(==)", "(/=)", "(>=)"]),
|
||||||
|
@ -47,7 +47,7 @@ lE =
|
||||||
((Ref.SomeTypeRep (Ref.TypeRep @(Finance -> Finance -> Bool))), ["(>)", "(==)", "(/=)", "(>=)"]),
|
((Ref.SomeTypeRep (Ref.TypeRep @(Finance -> Finance -> Bool))), ["(>)", "(==)", "(/=)", "(>=)"]),
|
||||||
((Ref.SomeTypeRep (Ref.TypeRep @(Social -> Social -> Bool))), ["(>)", "(==)", "(/=)", "(>=)"]),
|
((Ref.SomeTypeRep (Ref.TypeRep @(Social -> Social -> Bool))), ["(>)", "(==)", "(/=)", "(>=)"]),
|
||||||
((Ref.SomeTypeRep (Ref.TypeRep @(Health -> Health -> Bool))), ["(>)", "(==)", "(/=)", "(>=)"]),
|
((Ref.SomeTypeRep (Ref.TypeRep @(Health -> Health -> Bool))), ["(>)", "(==)", "(/=)", "(>=)"]),
|
||||||
-- Eq Enum
|
-- Eq
|
||||||
-- Any Type
|
-- Any Type
|
||||||
((Ref.SomeTypeRep (Ref.TypeRep @(Bool -> Int -> Int -> Int))), ["if'"]),
|
((Ref.SomeTypeRep (Ref.TypeRep @(Bool -> Int -> Int -> Int))), ["if'"]),
|
||||||
((Ref.SomeTypeRep (Ref.TypeRep @(Bool -> NurseryClass -> NurseryClass -> NurseryClass))), ["if'","if'","if'","if'","if'","if'","if'","if'"]),
|
((Ref.SomeTypeRep (Ref.TypeRep @(Bool -> NurseryClass -> NurseryClass -> NurseryClass))), ["if'","if'","if'","if'","if'","if'","if'","if'"]),
|
||||||
|
@ -77,10 +77,10 @@ lE =
|
||||||
maxDepth = 8,
|
maxDepth = 8,
|
||||||
weights =
|
weights =
|
||||||
ExpressionWeights
|
ExpressionWeights
|
||||||
{ lambdaSpucker = 1,
|
{ lambdaSpucker = 10,
|
||||||
lambdaSchlucker = 2,
|
lambdaSchlucker = 1,
|
||||||
symbol = 30,
|
symbol = 20,
|
||||||
variable = 20,
|
variable = 100,
|
||||||
constant = 5
|
constant = 5
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,8 +8,8 @@ import Pipes
|
||||||
import Pretty
|
import Pretty
|
||||||
import Protolude hiding (for)
|
import Protolude hiding (for)
|
||||||
import System.IO
|
import System.IO
|
||||||
-- import LambdaDatasets.IrisDataset
|
import LambdaDatasets.IrisDataset
|
||||||
import LambdaDatasets.NurseryDataset
|
-- import LambdaDatasets.NurseryDataset
|
||||||
-- import LambdaDatasets.GermanDataset
|
-- import LambdaDatasets.GermanDataset
|
||||||
import Debug.Trace as DB
|
import Debug.Trace as DB
|
||||||
import qualified Data.Map.Strict as Map
|
import qualified Data.Map.Strict as Map
|
||||||
|
@ -35,7 +35,7 @@ options =
|
||||||
( long "population-size"
|
( long "population-size"
|
||||||
<> short 'p'
|
<> short 'p'
|
||||||
<> metavar "N"
|
<> metavar "N"
|
||||||
<> value 400
|
<> value 100
|
||||||
<> help "Population size"
|
<> help "Population size"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ main =
|
||||||
selectionType = Tournament 3,
|
selectionType = Tournament 3,
|
||||||
termination = (steps (iterations opts)),
|
termination = (steps (iterations opts)),
|
||||||
poulationSize = (populationSize opts),
|
poulationSize = (populationSize opts),
|
||||||
stepSize = 120,
|
stepSize = 90,
|
||||||
elitismRatio = 5/100
|
elitismRatio = 5/100
|
||||||
}
|
}
|
||||||
pop' <- runEffect (for (run cfg) logCsv)
|
pop' <- runEffect (for (run cfg) logCsv)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user