r中如何求变量的对数转换_对数转换以求阳性。

r中如何求变量的对数转换

In Simple terms, log transform squashes or compresses range of large numbers and expands the range of small numbers. So if x is larger, then slower the log(x) increments.

用简单的术语来说,对数变换可以挤压或压缩大数范围,并扩大小数范围。 因此,如果x较大,则log(x)的增量会变慢。

Image for post
Log transform on range(1,1000), on x axis is real value and on y axis is log transformed value.
在range(1,1000)上的对数变换,在x轴上是实数值,在y轴上是对数变换值。

If you closely look at the plot above, which actually talks about log transformation on values ranging from 1 to 1000. As we can see from the plot, log has transformed values from [1,1000] into [0,7] range.

如果仔细看一下上面的图,它实际上是关于从1到1000的值的对数转换。从图中可以看出,对数已将值从[1,1000]转换为[0,7]范围。

Note that how x values from 200 to 1000 get compressed into just ~5 and 7. So the larger the x, slower the log(x) increments.

请注意,如何将200到1000之间的x值压缩为仅〜5和7。因此,x越大,log(x)的增量越慢。

Log is only defined when x>0. Log 0 is undefined. It’s not a real number, let’s say Log (base 10) 0=x, so 10^x=0, if you try to solve this, you will see that no value of x raised to the power of 10 gives you zero. 10⁰ is also 1.

仅在x> 0时定义对数。 日志0未定义。 它不是一个实数 ,比方说对数(以10为底)0 = x,所以10 ^ x = 0,如果尝试解决这个问题,您会发现x的任何数值都不提高到10的幂。 10⁰也是1。

Log transform is also known as variance stabilizing transform, which is useful when dealing with heavy tailed distributions. Log transform can make highly skewed distributions less skewed. So log transform reduces or removes skewness in data.

对数变换也称为方差稳定变换,在处理重尾分布时很有用。 对数变换可以使高度偏斜的分布减少偏斜。 因此,对数变换可以减少或消除数据的偏斜。

Image for post
Log transform reduces or removes skewness and tries to make our distribution normal.
对数变换可减少或消除偏斜,并尝试使分布正常。

使用对数变换作为特征工程技术: (Using Log transform as feature engineering technique:)

To reduce or remove skewness in our data distribution and make it more normal (A.K.A Gaussian distribution) we can use log transformation on our input

  • 0
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值