博客
关于我
用线性回归计算缺失值
阅读量:352 次
发布时间:2019-03-04

本文共 2672 字,大约阅读时间需要 8 分钟。

  • Missing data

    Missing data can grocely be classified into three types:

    1. MCAR(Missing Completely At Random), which means that there is nothing systematic about why some date is missing. That is, there is no relationship between the fact that data is missing and either the observed or unobserved covariates.
    2. MAR(Missing At Random), resembles MCAR because there still is an element of randomness.
    3. MNAR(Missing Not At Random), implies that the fact that fata is missing is directly correlated with the value of the misssing data.
  • How to deal with missing data

    1. Just delete missing entries
    2. Replaceing missing values with the mean or median
    3. Linear Regression

      First, several predictors of the variable with missing values are identified using a correlation matrix. The best predictors are selected and used as independent variables in a regression equation.

      The variable with missing data is used as the dependent variable.

      Second, cases with complete data for the predictor variables are used to generate the regression equation;

      Third, the equation is then used to predict missing values for incomplete cases in an iterative process.

      以上是单变量线性回归

    4. 多元线性回归

      Linear regression has signigicant limits like:

      • It can’t easily match any data set that is non-linear
      • It can only be used to make predictions that fit within the range of the training data set
      • It can only be fit to data sets with a single dependent variables and a single independent variable

      This is where multiple regression comes in. It is specifically designed to create regressions on models with a single dependent variable and multiple independent variables.

      Equation for multiple regpression takes the form:

      y = b 1 ∗ x 1 + b 2 ∗ x 2 + . . . + b n ∗ x n + a y=b_1*x_1+b_2*x_2+...+b_n*x_n+a y=b1x1+b2x2+...+bnxn+a
      b i b_i bi coefficients;

      x i x_i xi independent variables; also called predictor variables

      y i y_i yi dependent vairables; also called criterion variable

      a a a a constant stating the value of the depnedent variable;

      How to fit a multiple regression model ?

      Similarly to minimized the sum of squared errors to find B in the linear regression, we minimize the sum of squared errors to find all the B terms in multiple regression.

      Exactly we use stochastic gradient descent(随机梯度下降).

      How to make sure the model fits the data well ?

      Use the same r 2 r^2 r2 value that was used for linear regression.

      r 2 r^2 r2 which is called the coefficient of determination, states the portion of change in the data set that is predicted by the model. It’s a value ranging from 0 to 1. With 0 stating that the model has no ability to predict the result and 1 stating that the model predicts the result perfectly.

  • References

转载地址:http://pjge.baihongyu.com/

你可能感兴趣的文章
MySQL 是怎样运行的 - InnoDB数据页结构
查看>>
mysql 更新子表_mysql 在update中实现子查询的方式
查看>>
MySQL 有什么优点?
查看>>
mysql 权限整理记录
查看>>
mysql 权限登录问题:ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: YES)
查看>>
MYSQL 查看最大连接数和修改最大连接数
查看>>
MySQL 查看有哪些表
查看>>
mysql 查看锁_阿里/美团/字节面试官必问的Mysql锁机制,你真的明白吗
查看>>
MySql 查询以逗号分隔的字符串的方法(正则)
查看>>
MySQL 查询优化:提速查询效率的13大秘籍(避免使用SELECT 、分页查询的优化、合理使用连接、子查询的优化)(上)
查看>>
mysql 查询数据库所有表的字段信息
查看>>
【Java基础】什么是面向对象?
查看>>
mysql 查询,正数降序排序,负数升序排序
查看>>
MySQL 树形结构 根据指定节点 获取其下属的所有子节点(包含路径上的枝干节点和叶子节点)...
查看>>
mysql 死锁 Deadlock found when trying to get lock; try restarting transaction
查看>>
mysql 死锁(先delete 后insert)日志分析
查看>>
MySQL 死锁了,怎么办?
查看>>
MySQL 深度分页性能急剧下降,该如何优化?
查看>>
MySQL 深度分页性能急剧下降,该如何优化?
查看>>
MySQL 添加列,修改列,删除列
查看>>