mod的对数残差调整

2024-05-13 01:00:45 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图预测悉尼的房价,在我处理数据之后,我发现价格不能用对数来正常化。但我仍然在构建推进模型。问题是: 如何调整日志后的残差?这意味着我认为日志会使残差/错误变大。 谢谢

# normal distribution of train response value
log=np.log(training_data["price"])
skew = stats.skew(log)
print(skew)
k2, p = stats.normaltest(log)
alpha = 1e-3
print("p = {:g}".format(p))
if p < alpha:  # null hypothesis: x comes from a normal distribution
    print("The null hypothesis can be rejected")
else:
     print("The null hypothesis cannot be rejected")

结果为p=4.07145e-07 无效假设可以被拒绝


Tags: the数据alphalogstatsbenulldistribution