Linear Regression

  • models relationship between one dependent variable (numerical target variable) and explanatory variables (other variables)
    • Input: independent, explanatory, predictor variables
    • Output: one dependent, target, response variable
  • provides a way to predict a numerical variable given other variables. The other variables are typically numeric too. 提供了一种用数字来预测数字对方法。Ordinal variables can be mapped to numeric values if required. 序号变量也可以映射到数值变量上。Other categorical variables can also be mapped to numeric values but be very careful to assess the effect of such variables on results as they may obscure more informative relationships.其他类别变量也可以映射到数值,但要非常小心地评估这些变量对结果的影响,因为它们可能会掩盖更多的信息关系。、

Regression is different from classification 回归和分类的差异

  • Classification predicts categorical class labels 分类预测类别标签
  • Regression models continuous-valued functions and is a _numerical prediction _method because the values for explanatory variables of an unseen object can be plugged in to the model to predict the value of the dependent variable. 回归模型是连续值函数,是一种数值预测方法,因为一个看不见的对象的解释变量的值可以插入到模型中来预测因变量的值。

Types of relationships considered in regression

Deterministic relationship 确定关系**

  • Relationship between explanatory and dependent variables is deterministic 解释变量与因变量之间的关系是确定性的
  • If we know the value of an explanatory variable then we can predict dependent variable without error
  • For example:
    • Linear Regression 线性回归 - 图1
    • Linear Regression 线性回归 - 图2

Statistical relationship 统计关系

  • Relationship between explanatory and dependent variable is not perfect
  • For example:
    • Height and weight: as height increases, you’d expect weight to increase, but not perfectly
  • Another example of a statistical relationship:
  • image.png
    • Dependent variable is the mortality due to skin cancer (number of deaths per 10 million people)
    • Explanatory variable is the latitude of State (measured at the centre of the State in US)
    • Living in a northern area may reduce the mortality ratio but the relationship is not perfect.