What does np.mean(p == y_train) do? My answer

My answer is:

The function np.mean calculates how many elements of the two arrays/vectors (vector “predicted” with shape 100 x 1 compared with vector “actual” with shape 100 x 1) are identical element-wise divided by the length of these arrays/vectors. Possible values for each example and for both vectors are 0 or 1 (admission yes or no).

My source is here.

I hope this helps someone.

Thanks for your contribution.

I’d agree with your answer totally if you replace “100” with ‘m’ (where ‘m’ is the length of p and y_train). That bit of code works for any size of vectors.