I am trying to get an AI to play collect data and learn, everything fumitates correctly, but at the time of passing on the collected data so that it learns about the following error:
ValueError: Found input variables with inconsistent numbers of samples: [1, 2]
This is the code
collect_target = []
collect_data = []
while jugar == 0:
Player = input()
if Player=="salir":
jugar = 1
elif Player=="entrenar":
train_target=traductor(0,1,x_palabra,x_numero,collect_target)
train_data=traductor(0,1,y_palabra,y_numero,collect_data)
print(train_target)
print(train_data)
soldado = soldado.partial_fit([train_target],train_data)
else:
jugada = soldado.predict_proba([traductor(0,0,x_palabra,x_numero,Player)])[0]
if jugada[0] >= 0.8:
IA = action[0]
elif jugada[1] >= 0.8:
IA = action[1]
else:
IA = azar(action)
mision = good(Player,IA)
if mision==0:
print("Entity: %s Action: %s Mision Cumplida" %(Player,IA))
score["win"]+=1
collect_target.append(Player)
collect_data.append(IA)
elif mision==1:
print("Entity: %s Action: %s Mision Fallida" %(Player,IA))
score["loose"]+=1