Hi,

I am facing this error. Can anyone help?

Hello @M_Rezaeemanesh,

We can give you some hints but you will have to figure out the problem and resolve it yourself. The error indicates which line the problem lies, and the problem itself. There are 2 variables being indexed in the line, which is `w`

, `X`

, and `X[i]`

, and one of them has only a size of 2 but you are asking for the 3rd item (1st item has index 0, 2nd item has index 1, and 3rd item has index 2).

You need to understand the meaning for `i`

, `j`

, `m`

, `w`

, and `X`

. For example, `j`

is related to `m`

, so what do each of them mean? What `i`

is for? Would `i`

or `j`

go beyond the size of the variables `w`

, `X`

, or `X[i]`

. Something must be wrong here.

Raymond

Hi Dear @rmwkwok ,

I understand that m is â€śthe number of training examples in the datasetâ€ť, and w lies in the sigmoid to predict the relationship between the data.

Actually, I think I didnâ€™t get you. Iâ€™ve exactly followed the hints that are below the code, I wonder why it didnâ€™t work. Shall I send you the code privately?

Please explain more if possible.

Regards,

M.Rezaeemanesh

If `m`

is the number of samples, then what is `j`

, `w[j]`

, and `X[i][j]`

?

I have figured out my mistake and I have corrected the code.

Thank you so much.

M. Rezaeemanesh

Great work @M_Rezaeemanesh. I shouldnâ€™t be more explicit because it is your success. Code debugging is a skill that is crucial for doing machine learning but the skill takes opportunity and time to build up, and itâ€™s your opportunity and your achievement

Raymond

I am also very happy. Thanks for your tips.

The course is over , but I really need to more practice and repeat