/* Standard data set: Weather data set from Weka (weather.arff) (a.k.a. Tennis, Play etc) Mappings: sunny -> 1, overcast->2, rainy->3 TRUE -> 1, FALSE -> 0, yes -> 1, no -> * Here is a solution with error 1, but it doesn't really make sense: gen = 1001 (time: 95.311s) results_best = [[1,if_less(humidity,temperature,8,6 != 7) != if_then_else(3,1,if_less(outlook,3,outlook,windy))]] * total_approx=1 num_gens=1800 gen = 1524 (time: 161.940s) results_best = [[2,if_less_equal(humidity - 5,(9 + outlook) * 7 + 8,1,0 * ((5 + 10 + outlook) * 4 / 1))]] Cf weather.conf */ import util. data(p4,Data,Vars,Unknown,Ops,Constants,MaxSize,Params) :- Data = [ [[A,B,C,D],X] : [A,B,C,D,X] in chunks_of([ % outlook temperature humidity windy play 1, 85, 85, 0, 0, 1, 80, 90, 1, 0, 2, 83, 86, 0, 1, 3, 70, 96, 0, 1, 3, 68, 80, 0, 1, 3, 65, 70, 1, 0, 2, 64, 65, 1, 1, 1, 72, 95, 0, 0, 1, 69, 70, 0, 1, 3, 75, 80, 0, 1, 1, 75, 70, 1, 1, 2, 72, 90, 1, 1, 2, 81, 75, 0, 1, 3, 71, 91, 1, 0 % test cases % 1,85,85,1,? % 1,80,90,0,? ],5)], Unknown = [1,85,85,1], Vars = ['outlook','temperature','humidity','windy'], Ops = [+,-,*,/,if_less_equal], Constants = 0..10, MaxSize = 11, Params = new_map([total_approx=1, init_size=1000, show_best=1, num_gens=1800, show_only_improvements=true, stop_criteria=generations, % debug=true, remove_dups=true ]).