Week2, logistic regression 2 questions

I think now it became more clear. Thank you again for patience.

You are welcome :wink:

Now that I think you might actually want to discuss it in a neural network setting, for your following question:

It is true that you want more neurons/layers in order to model a higher degree polynomial term.

Cheers,
Raymond

1 Like

@Igor_Goldberg,

Try this Tensorflow playground.

Follow me through the following three examples:

Example 1:

If you choose the first dataset (which is a binary dataset) in the left (circle number 1), pick the degree-2 polynomial features (circle number 2), then you don’t need any hidden layer (circle number 3) and you will still be able to fit it pretty well (circle number 4)

Example 2:

However, if you change to use the degree-1 features (circle number 5), the result will be bad (circle number 6)

Example 3:

If you want the model to learn non-linear features from degree-1 features, what do you do? Add hidden layers and neurons like below. Note that the result still doesn’t look very nice, but I will leave it to you to experiment how to add layers/neurons to get a good result. There are more than one way to do it. It is a pretty interesting exercise actually. Try it!

Good luck!
Raymond

Thank you very much :slight_smile: