Compare commits

..

4 Commits

Author SHA1 Message Date
Johannes Merl
75247d1cb5 fix fittness 2024-05-11 19:46:30 +02:00
Johannes Merl
361e9bcf99 fix Iris 2024-05-09 10:54:23 +02:00
Johannes Merl
13565a3f95 reduce population to fix memory issues in higher depth case 2024-05-09 10:15:21 +02:00
Johannes Merl
9aeefbeb9b weights #3 2024-05-09 09:31:56 +02:00
4 changed files with 7 additions and 10 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 = 8,
maxDepth = 5,
weights =
ExpressionWeights
{ lambdaSpucker = 0,
@@ -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 = acc * 100 + (biasSmall - 1),
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 = 8,
maxDepth = 5,
weights =
ExpressionWeights
{ lambdaSpucker = 0,

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 = 8,
maxDepth = 5,
weights =
ExpressionWeights
{ lambdaSpucker = 0,

View File

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