Testing_probs[origin]

Screen Link:

In the solution, why

testing_probs[origin] = models[origin].predict_proba(x_test)[:,1]

What does this line do or mean? Why do we need [:,1]?

Hi vroomvroom

The function predict_proba() returns a numpy array of two columns. The first column is the probability that target=0 and the second column is the probability that target=1. That is why we add [:,1] after predict_proba() in order to get the probabilities of target=1.

Hope it makes sense.
Thanks.

2 Likes