Polynomial features transform non-linear data relationships into linear ones by creating higher-degree terms (e.g., squaring the input variable), allowing linear regression models to capture curved patterns and significantly improve model performance, as demonstrated by the ice cream sales example where the score improved from 0.69 to 0.90.
深度探索
先修知识
- 暂无数据。
后续步骤
- 暂无数据。
深度探索
How to improve your model score with polynomial features? #machinelearning #coding #python #aiml本站添加:
So guys, so far we have seen the linear regression model, how actually we can train the model and predict the data.
But here is the limitation of linear regression model. So if I run the code, you can see the model score is just 0.69. So there is nothing wrong with this model, rather we have the data like this. So but during the extreme heat, our ice cream sales is going down. So that is not forming the linear graph, okay? So in that case, there comes the polynomial regression. You can import polynomial features, okay? We can create a instance for polynomial features, all right? And we can give the degree is equal to two. Two is for curve, one is for a straight line, okay? Let's take a variable, we can call it as temp poly.
So we are going to transform the data, okay? So poly.fit transform, okay? And then we can pass the input data, which is nothing but the temperature, okay?
Now we are going to use the same model, but instead of training that with temperature, we are going to train it with temp poly, the variable we have created, okay? And while evaluating the model also, let's replace the temp with temp poly. Now if I run the code, you should be seeing the model score has been improved.
So here you go, it has been improved to 0.90.
相关推荐
OpenHuman VS Hermes AI: Who Wins?
JulianGoldieSEO
285 views•2026-05-29
BREAKING: Microsoft’s New Image Generating Model Beat Out GPT 1.5 and Nano Banana 2
aimmediahouse
122 views•2026-06-03
Long-Running Agents — Build an Agent That Never Forgets with Google ADK
suryakunju
142 views•2026-05-30
This computer is made from real human brain cells. And you can buy it.
Talktmsmedia
3K views•2026-05-28
I Made the Same Anime Fight Scene in Every AI Video Generator
NobleGooseAnime
295 views•2026-05-30
Nvidia Bets Big On AI PCs | New Chip To Power Windows Laptops | Technology | AI Updates | N18S
cnnnews18
3K views•2026-06-01
I Tested NEW Opus 4.8 on Four Projects (Updated LLM Leaderboard)
AICodingDaily
298 views•2026-05-29
3D Platformer Update - NO CAPES
SolarLune
294 views•2026-05-30











