trekhleb / homemade-machine-learning

🤖 Python examples of popular machine learning algorithms with interactive Jupyter demos and math being explained
MIT License
22.95k stars 4.06k forks source link

Code to handle polynomial regression without adding sinusoid features #11

Closed buck06191 closed 5 years ago

buck06191 commented 5 years ago

Issue #10 fixed by adding conditionals to check if both datasets in add_polynomials have a column. In the case where there is only one column of data passed, this column alone is used to generate polynomial features.

trekhleb commented 5 years ago

Thank you for PR @buck06191

trekhleb commented 5 years ago

@buck06191 I've refactored add_polynomials() function a bit. Could you please take a look at its current implementation? I guess it should fix the issue you were trying to solve.

buck06191 commented 5 years ago

Hey @trekhleb - yeah that fixes what I was trying to solve but in a much more robust and testable format. Good inspiration for my own work!