mstampfer / Coursera-Stanford-ML-Python

Coursera/Stanford Machine Learning course assignments in python
445 stars 231 forks source link

./ex2/ex2_reg.py data format is pandas dataFrame, not numpy array. #10

Open aerinkim opened 7 years ago

aerinkim commented 7 years ago

This causes few issues like 1) being unable to broadcast 2) need to write different version of cost function calculation: (1-y).values.flatten() instead of (1-y)

It's better to unify the data type as numpy array to reduce confusion from users.

aerinkim commented 7 years ago

One quick fix would be using

from sklearn.preprocessing import PolynomialFeatures

PolynomialFeatures(6)