/* Ohm electrical circuits From https://github.com/lindseyspratt/bacon-logtalk/blob/master/src/test_data_set.lgt """ Ohm's original data for electrical circuits. p. 84. len*imp = -20.14993361510822223*len + 7245.18359387258871. This needs infer_linear linearity limit of 0.1 (using other_linear_error). test_data_set(ohm1, 0.001, 0.1, 0.01, [[2.0, 326.75], [4.0, 300.75], [6.0, 277.75], [10.0, 238.25], [18.0, 190.75], [34.0, 134.5], [66.0, 83.25], [130, 48.5]], [len, imp]). """ The solution should be something like In[3]:= Solve[len*imp == -20.14993361510822223*len + 7245.1835938725887,imp] 7245.18 - 20.1499 len Out[3]= {{imp -> ---------------------}} len * stop_criteria=generations nums_gens=1800 gen = 811 (time: 27.762s) results_best = [[199.149959015010836,pow2(-211.234146361813941) / pow4(pow4((-444.450578393624482 - Len) / -329.554488570221906))]] stop_criteria 'generations' reached gen = 1721 (time: 60.658s) results_best = [[168.742846584875849,pow2(Len - -444.450578393624482) / (680.375434309419006 + Len / (Len / Len) * Len + Len)]] stop_criteria 'generations' reached Cf ohm_electrical_circuit.conf */ import util. data(odd_parity,Data,Vars,Unknown,Ops,Constants,MaxSize,Params) :- Data = [ [[X],Y] : [X,Y] in chunks_of([ 2.0,326.75, 4.0,300.75, 6.0,277.75, 10.0,238.25, 18.0,190.75, 34.0,134.5, 66.0,83.25, 130.0,48.5 ],2)], Unknown = [130.0], Vars = ['Len'], Ops = [+,-,*,/,pow2,pow3,pow4], Constants = [frand(-1000,1000) : _ in 1..10], MaxSize = 21, Params = new_map([ approx=1, init_size=1000, show_best=1, num_gens=1800, show_only_improvements=true, stop_criteria=generations, remove_dups=true ]).