Compare commits
3 Commits
german_cos
...
nurse_1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f19e976408 | ||
|
|
1e916bd6c4 | ||
|
|
dcfe1ee497 |
@@ -86,13 +86,13 @@ 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 = 10,
|
||||
lambdaSchlucker = 1,
|
||||
symbol = 20,
|
||||
variable = 100,
|
||||
{ lambdaSpucker = 1,
|
||||
lambdaSchlucker = 2,
|
||||
symbol = 30,
|
||||
variable = 10,
|
||||
constant = 5
|
||||
}
|
||||
}
|
||||
@@ -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)
|
||||
|
||||
@@ -53,13 +53,13 @@ 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 = 10,
|
||||
lambdaSchlucker = 1,
|
||||
symbol = 20,
|
||||
variable = 100,
|
||||
{ lambdaSpucker = 1,
|
||||
lambdaSchlucker = 2,
|
||||
symbol = 30,
|
||||
variable = 10,
|
||||
constant = 5
|
||||
}
|
||||
}
|
||||
@@ -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,
|
||||
|
||||
@@ -74,13 +74,13 @@ 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 = 10,
|
||||
lambdaSchlucker = 1,
|
||||
symbol = 20,
|
||||
variable = 100,
|
||||
{ lambdaSpucker = 1,
|
||||
lambdaSchlucker = 2,
|
||||
symbol = 30,
|
||||
variable = 10,
|
||||
constant = 5
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user