in video at 6:43, we returned ‘return np.argmax(model.predict(state)[0])’ why we wrote [0] after state?
Doubt in video at 6:43?
hey @saksham_thukral ,
thats becuase model.predict(state) returns an array containing an array of actual predictions.
hence we use indexing and take out that inner predicitions.
like
x = [ [ actual predictions in this array ] ]
x[0] will return [ actual predictions in this array ]
and hence after this we can easily use np.argmax function to get our final prediction.
I hope this would have resolved your doubt.
Happy Learning. 