机器学习笔记之特征及多项式回归

本文探讨了如何通过组合特征及应用多项式回归来改善假设函数的表现形式,从而更好地拟合数据。文中介绍了如何创建二次、三次乃至平方根等不同形式的假设函数,并强调了在选择这些特征时进行特征缩放的重要性。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Features and Polynomial Regression

We can improve our features and the formof our hypothesis function in a couple different ways.

We can combine multiple features intoone. For example, we can combine x1 and x2 into a newfeature x3 bytaking x1x2.

Polynomial Regression

Our hypothesis function need not belinear (a straight line) if that does not fit the data well.

We can change the behavior orcurve of our hypothesis function by making it a quadratic, cubic orsquare root function (or any other form).

For example, if our hypothesis function is hθ(x)=θ0+θ1x1 then wecan create additional features based on x1, to get thequadratic function hθ(x)=θ0+θ1x1+θ2x21 or thecubic function hθ(x)=θ0+θ1x1+θ2x21+θ3x31

In the cubic version, we have created new features x2 and x3 where x2=x21 and x3=x31.

To make it a square root function, we could do: hθ(x)=θ0+θ1x1+θ2x1−−√

One important thing to keep in mind is,if you choose your features this way then feature scaling becomes veryimportant.

eg. if x1 has range 1- 1000 then range of x21 becomes 1- 1000000 and that of x31 becomes 1- 1000000000


 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值