tagenalgo icon indicating copy to clipboard operation
tagenalgo copied to clipboard

tuple index out of range

Open algoherif opened this issue 4 years ago • 3 comments

i got that error, please help

image

algoherif avatar Mar 12 '21 06:03 algoherif

i got that error, please help

Hi, Since I don't have enough information, could you pls paste complete codes you used in the following form? I will do my best to help you out.

# Example
# pls paste your codes.

mick-liu avatar Mar 17 '21 12:03 mick-liu

I think the problem is that _fitness_cal(self, params, sig_total=0.03) only returns fitness_val_cumret, fitness_val_winrate but _fitness_evaluation(self, pop) is attempting to obtain self._fitness_cal(ind)[2] when it doesn't exist.

Steven-Herrera avatar Mar 09 '22 07:03 Steven-Herrera

I think the problem is that _fitness_cal(self, params, sig_total=0.03) only returns fitness_val_cumret, fitness_val_winrate but _fitness_evaluation(self, pop) is attempting to obtain self._fitness_cal(ind)[2] when it doesn't exist.

And how would this best be fixed?

(I am having the same issue) Traceback (most recent call last): File "/home/-/OptRSI.py", line 26, in model.fit(init_pop) File "/home/-/tagenalgo/tagenalgo.py", line 311, in fit pop_fit = self._fitness_evaluation(pop) File "/home/-/tagenalgo/tagenalgo.py", line 249, in _fitness_evaluation win_pat.append(self._fitness_cal(ind)[2]) IndexError: tuple index out of range

sierret avatar Apr 02 '22 19:04 sierret