C2_W4_Decision_Tree_with_Markdown error

I got this error for this line of code which works in earlier notebook:

image

1 Like

Hi @Rose_LUO ,

p1 is calculate by taken the number of examples in the subset divided by the total number of examples at a given node. Here is how to get the number of examples in the subset:
len(y[y==1])

1 Like