Every beginner in Data Science makes this exact mistake. 👇
#datascience #machinelearning #linearregression
Every beginner in Data Science makes this exact mistake. 👇
Many people think that Linear Regression can only be used to fit perfectly straight lines. But that is actually not the full story.
What happens when your data looks like a giant curve? A standard linear model will fail to fit it properly. But instead of throwing the model away, we can just engineer a new feature!
By creating a new feature that is the square of the existing one and passing that into our model, it will suddenly fit the curved data beautifully. ✨
Why does this work? Because Linear Regression assumes the model is linear with respect to its weights and not the input features!
This technique is called Polynomial Regression. You can easily create these features using the PolynomialFeatures class in Scikit Learn, pass them right into your standard Linear Regression model, and conquer complex datasets. 💻🐍
Did you know this trick? Let me know in the comments! 👇
💾 Save this reel so you do not forget how to handle complex data, and follow me for more straightforward Machine Learning breakdowns!
#DataScience #MachineLearning #LinearRegression #PythonProgramming #PolynomialRegression DataScientist CodingTips AIEducation FeatureEngineering ScikitLearn
Comments
Comments from the original post on Instagram
No comments yet
