Menu
×
   ❮     
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS R TYPESCRIPT ANGULAR GIT POSTGRESQL MONGODB ASP AI GO KOTLIN SASS VUE DSA GEN AI SCIPY AWS CYBERSECURITY DATA SCIENCE
     ❯   

数据科学 - 回归表 - 系数


回归表中的“系数部分”

Regression Table - Coefficients
  • Coef 是系数的缩写。它是线性回归函数的输出。

线性回归函数可以用数学方式改写为

卡路里消耗 = 0.3296 * 平均脉搏 + 346.8662

这些数字意味着

  • 如果平均脉搏增加1,卡路里消耗增加0.3296(或0.3四舍五入)。
  • 如果平均脉搏 = 0,则卡路里消耗等于346.8662(或346.9四舍五入)。
  • 请记住,截距用于调整模型的预测精度!

你认为这是一个好的模型吗?


在Python中定义线性回归函数

在Python中定义线性回归函数以进行预测。

如果平均脉搏为:120、130、150、180,卡路里消耗是多少?

示例

def Predict_Calorie_Burnage(Average_Pulse)
 return(0.3296*Average_Pulse + 346.8662)

print(Predict_Calorie_Burnage(120))
print(Predict_Calorie_Burnage(130))
print(Predict_Calorie_Burnage(150))
print(Predict_Calorie_Burnage(180))
自己尝试 »

×

Contact Sales

If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail:
[email protected]

Report Error

If you want to report an error, or if you want to make a suggestion, send us an e-mail:
[email protected]

W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookie and privacy policy.

Copyright 1999-2024 by Refsnes Data. All Rights Reserved. W3Schools is Powered by W3.CSS.