Compare commits
7 Commits
iris_9
...
german_cos
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d6ee799491 | ||
|
|
a94cccf2b6 | ||
|
|
ecad79279e | ||
|
|
87c78beeed | ||
|
|
7b4e9a1653 | ||
|
|
3ea8700611 | ||
|
|
2b7cf859ac |
@@ -86,13 +86,13 @@ lE =
|
|||||||
((Ref.SomeTypeRep (Ref.TypeRep @(Job))), [(fmap show (enumUniform UnemployedOrUnskilledNonResident HighlySkilled ))])
|
((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))),
|
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 = 5,
|
maxDepth = 8,
|
||||||
weights =
|
weights =
|
||||||
ExpressionWeights
|
ExpressionWeights
|
||||||
{ lambdaSpucker = 1,
|
{ lambdaSpucker = 0,
|
||||||
lambdaSchlucker = 2,
|
lambdaSchlucker = 10,
|
||||||
symbol = 30,
|
symbol = 100,
|
||||||
variable = 10,
|
variable = 5,
|
||||||
constant = 5
|
constant = 5
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -151,6 +151,7 @@ data LamdaExecutionEnv = LamdaExecutionEnv
|
|||||||
data FittnesRes = FittnesRes
|
data FittnesRes = FittnesRes
|
||||||
{ total :: R,
|
{ total :: R,
|
||||||
fitnessTotal :: R,
|
fitnessTotal :: R,
|
||||||
|
costAccordingToDataset :: N,
|
||||||
fitnessGeoMean :: R,
|
fitnessGeoMean :: R,
|
||||||
fitnessMean :: R,
|
fitnessMean :: R,
|
||||||
accuracy :: R,
|
accuracy :: R,
|
||||||
@@ -189,8 +190,9 @@ 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 = (biasSmall - 1) - (fromIntegral costAccordingToDS),
|
||||||
fitnessTotal = fitness',
|
fitnessTotal = fitness',
|
||||||
|
costAccordingToDataset = costAccordingToDS,
|
||||||
fitnessMean = meanOfAccuricyPerClass resAndTarget,
|
fitnessMean = meanOfAccuricyPerClass resAndTarget,
|
||||||
fitnessGeoMean = geomeanOfDistributionAccuracy resAndTarget,
|
fitnessGeoMean = geomeanOfDistributionAccuracy resAndTarget,
|
||||||
accuracy = acc,
|
accuracy = acc,
|
||||||
@@ -201,7 +203,8 @@ evalResult ex tr result = ( tr,
|
|||||||
where
|
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))
|
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)
|
resAndTarget = (zip (snd (dset ex)) res)
|
||||||
acc = (foldr (\ts s -> if ((fst ts) == (snd ts)) then s + 1 else s) 0 resAndTarget) / fromIntegral (length resAndTarget)
|
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)
|
||||||
biasSmall = exp ((-(fromIntegral (countTrsR tr))) / 1000) -- 0 (schlecht) bis 1 (gut)
|
biasSmall = exp ((-(fromIntegral (countTrsR tr))) / 1000) -- 0 (schlecht) bis 1 (gut)
|
||||||
fitness' = meanOfAccuricyPerClass resAndTarget
|
fitness' = meanOfAccuricyPerClass resAndTarget
|
||||||
score = fitness' + (biasSmall - 1)
|
score = fitness' + (biasSmall - 1)
|
||||||
|
|||||||
@@ -53,13 +53,13 @@ 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 = 5,
|
maxDepth = 8,
|
||||||
weights =
|
weights =
|
||||||
ExpressionWeights
|
ExpressionWeights
|
||||||
{ lambdaSpucker = 1,
|
{ lambdaSpucker = 0,
|
||||||
lambdaSchlucker = 2,
|
lambdaSchlucker = 10,
|
||||||
symbol = 30,
|
symbol = 100,
|
||||||
variable = 10,
|
variable = 5,
|
||||||
constant = 5
|
constant = 5
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -68,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),
|
||||||
@@ -89,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),
|
||||||
@@ -155,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,
|
||||||
|
|||||||
@@ -74,13 +74,13 @@ lE =
|
|||||||
((Ref.SomeTypeRep (Ref.TypeRep @(Health))), [(fmap show (enumUniform NotRecommendHealth PriorityHealth ))])
|
((Ref.SomeTypeRep (Ref.TypeRep @(Health))), [(fmap show (enumUniform NotRecommendHealth PriorityHealth ))])
|
||||||
],
|
],
|
||||||
targetType = (Ref.SomeTypeRep (Ref.TypeRep @(Parents -> HasNurs -> Form -> Children -> Housing -> Finance -> Social -> Health -> NurseryClass))),
|
targetType = (Ref.SomeTypeRep (Ref.TypeRep @(Parents -> HasNurs -> Form -> Children -> Housing -> Finance -> Social -> Health -> NurseryClass))),
|
||||||
maxDepth = 5,
|
maxDepth = 8,
|
||||||
weights =
|
weights =
|
||||||
ExpressionWeights
|
ExpressionWeights
|
||||||
{ lambdaSpucker = 1,
|
{ lambdaSpucker = 0,
|
||||||
lambdaSchlucker = 2,
|
lambdaSchlucker = 10,
|
||||||
symbol = 30,
|
symbol = 100,
|
||||||
variable = 10,
|
variable = 5,
|
||||||
constant = 5
|
constant = 5
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,9 +8,9 @@ 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)
|
||||||
|
|||||||
Reference in New Issue
Block a user