以下のコードを実行するとエラーとなってしまいます.
どなたか解決していただけないでしょうか??
ソースコード
from platypus import NSGAII, Problem, Real
def belegundu(vars):
x1 = vars[0]
x2 = vars[1]
x3 = vars[2]
x4 = vars[3]
x5 = vars[4]
x6 = vars[5]
# x7 = vars[6]
# x8 = vars[7]
# x9 = vars[8]
# x10 = vars[9]
# x11 = vars[10]
return [0.64000573*x1+0.14397378*x2+0.54079948*x3+0.22333884*x4-1.04133668*x5-1.02149524*x6
# -0.80324154*x7-0.96197168*x8+2.17547164*x9+2.1159477*x10+2.11594784*x11+2.1556302*x12
# -0.81051432*x13-0.98908598*x14-0.65178426*x15-0.85019723*x16+1.42402255*x17+1.54307024*x18
# +1.54307019*x19+1.4438638*x20+0.60094854*x21+0.60094859*x22+0.58110701*x23+0.56126604*x24
# +1.37255057*x25+1.54120144*x26-2.64281005*x27-2.77177842*x28+1.07142851*x29+0.84325402*x30
# -1.714979555
,-0.01221614*x1-1.15591655*x2+3.97238539*x3-0.0635985*x4-0.01579076*x5+0.47912646*x6
# -0.35423701*x7-0.38614298*x8-2.33929053*x9-4.22182428*x10-4.99001553*x11+3.75250581*x12
# +2.12183612*x13+0.82466014*x14+1.67771848*x15+2.19306848*x16-1.60337024*x17+0.05854879*x18
# -1.25631746*x19-1.67983829*x20-1.58976272*x21+0.11155756*x22-1.55505578*x23-2.12679008*x24
# -2.12289794*x25-0.86725301*x26+4.58191061*x27+2.03660415*x28+0.91999822*x29-0.76666518*x30
# -0.77416676
],[x1+x2+x3+x4-1, x5+x6-1]
problem = Problem(6, 2, 2)
problem.types[:] = [Real(0, 1), Real(0, 1), Real(0, 1), Real(0, 1), Real(0, 1), Real(0, 1)]
problem.constraints[:] = "<=0"
problem.function = belegundu
algorithm = NSGAII(problem)
algorithm.run(10000)
import pandas as pd
df = pd.DataFrame(columns = ("x1","x2","x3","x4","x5","x6""c1","c2","f1","f2"))
for i in range(len(algorithm.result)):
df.loc[i] = algorithm.result[i].variables[:]+ \
algorithm.result[i].constraints[:] + \
algorithm.result[i].objectives[:]
df.to_csv("platypus_exp3.csv")
import seaborn as sns
sns.pairplot(df)
エラーメッセージ
**ValueError Traceback (most recent call last)
<ipython-input-22-eb0f9a1f7d68> in <module>
42 df.loc[i] = algorithm.result[i].variables[:]+ \
43 algorithm.result[i].constraints[:] + \
---> 44 algorithm.result[i].objectives[:]
45
46 df.to_csv("platypus_exp3.csv")**