Compare commits

..

5 Commits

Author SHA1 Message Date
Johannes Merl
3268eabd0d fix Iris 2024-05-09 10:53:57 +02:00
Johannes Merl
9fa5fa9ff7 reduce population to fix memory issues in higher depth case 2024-05-09 10:13:06 +02:00
Johannes Merl
073079a079 variation 4 2024-05-09 09:27:02 +02:00
Johannes Merl
7292568247 variation 2 2024-05-09 09:27:02 +02:00
Johannes Merl
dcfe1ee497 switch to nursery Dataset 2024-05-09 09:01:57 +02:00
4 changed files with 8 additions and 11 deletions

View File

@@ -86,7 +86,7 @@ lE =
((Ref.SomeTypeRep (Ref.TypeRep @(Job))), [(fmap show (enumUniform UnemployedOrUnskilledNonResident HighlySkilled ))])
],
targetType = (Ref.SomeTypeRep (Ref.TypeRep @(AccountStatus -> Int -> CreditHistory -> Purpose -> Int -> Savings -> EmploymentStatus -> Int -> StatusAndSex -> OtherDebtors -> Int -> Property -> Int -> OtherPlans -> Housing -> Int -> Job -> Int -> Bool -> Bool -> GermanClass))),
maxDepth = 9,
maxDepth = 8,
weights =
ExpressionWeights
{ lambdaSpucker = 10,
@@ -151,7 +151,6 @@ data LamdaExecutionEnv = LamdaExecutionEnv
data FittnesRes = FittnesRes
{ total :: R,
fitnessTotal :: R,
costAccordingToDataset :: N,
fitnessGeoMean :: R,
fitnessMean :: R,
accuracy :: R,
@@ -190,9 +189,8 @@ 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 ex tr result = ( tr,
FittnesRes
{ total = (biasSmall - 1) - (fromIntegral costAccordingToDS),
{ total = score,
fitnessTotal = fitness',
costAccordingToDataset = costAccordingToDS,
fitnessMean = meanOfAccuricyPerClass resAndTarget,
fitnessGeoMean = geomeanOfDistributionAccuracy resAndTarget,
accuracy = acc,
@@ -203,8 +201,7 @@ evalResult ex tr result = ( tr,
where
res = map (\(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t) -> result a b c d e f g h i j k l m n o p q r s t) (fst (dset ex))
resAndTarget = (zip (snd (dset ex)) res)
acc = (foldr (\(actual,predicted) s -> if (actual == predicted) then s + 1 else s) 0 resAndTarget) / fromIntegral (length resAndTarget)
costAccordingToDS = (foldr (\(actual,predicted) s -> if ((actual) == (predicted)) then s else (if actual == Deny then s+5 else s+1)) 0 resAndTarget)
acc = (foldr (\ts s -> if ((fst ts) == (snd ts)) then s + 1 else s) 0 resAndTarget) / fromIntegral (length resAndTarget)
biasSmall = exp ((-(fromIntegral (countTrsR tr))) / 1000) -- 0 (schlecht) bis 1 (gut)
fitness' = meanOfAccuricyPerClass resAndTarget
score = fitness' + (biasSmall - 1)

View File

@@ -53,7 +53,7 @@ lE =
((Ref.SomeTypeRep (Ref.TypeRep @(IrisClass))), [(fmap show (enumUniform Setosa Versicolor :: RVar IrisClass))])
],
targetType = (Ref.SomeTypeRep (Ref.TypeRep @(Float -> Float -> Float -> Float -> IrisClass))),
maxDepth = 9,
maxDepth = 8,
weights =
ExpressionWeights
{ lambdaSpucker = 10,
@@ -155,7 +155,7 @@ evalResults ex trs = do
evalResult :: LamdaExecutionEnv -> TypeRequester -> (Float -> Float -> Float -> Float -> IrisClass) -> (TypeRequester, FittnesRes)
evalResult ex tr result = ( tr,
FittnesRes
{ total = acc * 100 + (biasSmall - 1),
{ total = score,
fitnessTotal = fitness',
fitnessMean = meanOfAccuricyPerClass resAndTarget,
fitnessGeoMean = geomeanOfDistributionAccuracy resAndTarget,

View File

@@ -74,7 +74,7 @@ lE =
((Ref.SomeTypeRep (Ref.TypeRep @(Health))), [(fmap show (enumUniform NotRecommendHealth PriorityHealth ))])
],
targetType = (Ref.SomeTypeRep (Ref.TypeRep @(Parents -> HasNurs -> Form -> Children -> Housing -> Finance -> Social -> Health -> NurseryClass))),
maxDepth = 9,
maxDepth = 8,
weights =
ExpressionWeights
{ lambdaSpucker = 10,

View File

@@ -9,8 +9,8 @@ import Pretty
import Protolude hiding (for)
import System.IO
-- import LambdaDatasets.IrisDataset
-- import LambdaDatasets.NurseryDataset
import LambdaDatasets.GermanDataset
import LambdaDatasets.NurseryDataset
-- import LambdaDatasets.GermanDataset
import Debug.Trace as DB
import qualified Data.Map.Strict as Map