asher-k / TransientTerminalGP

Project undertaken for the VUW Summer Scholars programme. Provides an implementation of a novel genetic operator called the Transient Terminal Set.
0 stars 0 forks source link

Balanced Individual for Bike Dataset throws ValueError #27

Closed asher-k closed 3 years ago

asher-k commented 3 years ago

Attempting to obtain the most balanced individual from the Bike dataset throws the following error:

Traceback (most recent call last): File "C:/Users/Asher (GOD)/Desktop/VUW/SRS/Research/transient-terminal-gp/code/test-script.py", line 59, in _best, _log = method.evolve(train_data, train_target, dataset.columns.drop([target]), test_data, test_target) File "C:\Users\Asher (GOD)\Desktop\VUW\SRS\Research\transient-terminal-gp\code\ttgp.py", line 109, in evolve logbook.record(gen=g, best=toolbox.evaluation(function=hof[0], data=tdata, actual=tlabels), balanced=shared File "C:\Users\Asher (GOD)\Desktop\VUW\SRS\Research\transient-terminal-gp\code\shared.py", line 182, in getBalancedInd return pareto[distances.index(np.min(distances))] ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

Other datasets do not throw this; this may be due to the presence of individuals with identical fitness in the Pareto front.