How does feature mapping work in Andrew Ng's Logistic Regression course?

1.1k Views Asked by At

enter image description here

1 ✓

x₁ ✓

x₂ ✓

x₁^2 sure....

x₁x₂ ✓i guess

x₂^2 ✓

x₁^3 ????????????

This is a sequence, right? I can't figure out the pattern. Why not just 1,x₁,x₂,x₁x₂,(x₁^2)x₂,x₁(x₂^2),(x₁^2)(x₂^2), etc?

1

There are 1 best solutions below

1
On BEST ANSWER

Define the degree of a the term $x_1^ax_2^b$ to be $a+b$. He is just ordering the terms by degree. For example, the terms of degree 2 are $x_1^2, x_1x_2, x_2^2$, and the terms of degree $3$ are $x_1^3, x_1^2x_2, x_1x_2^2, x_2^3$. In the matrix you posted, it looks like he went up to degree $6$.