1. summary 、str、names、table -》 大体数据

2. mean、sum 、complete.cases、aggr(xxx,prop=false,numbers=true)  -》 缺失值 

引用:

library(lattice)

library(grid)

library(mice) : md.pattern

library(VIM)

查看缺失值比重

填充中位数:median(xxx)

移除缺失值:na.omit(xxx)

查看缺失值比重

3. 填充 

KNN邻近算法填充

install.PACKAGES("DMwR")

library(DMwR)

查看缺失值

填充

xxx <- knnImputation(xxx,k=10,meth="weighAvg")

4. 异常值处理

margin(t=1)

as.numeric(xxx字段)

unique(xxx字段)

boxplot(xxx)  箱图

xxx$out 查看异常值

异常值处理

盖帽法:

1.函数盖帽法

2.手动盖帽法

block(xxx字段) 对数据修正

boxplot 查看异常值

xx#out

5.查看相关程度

library(corrplot)

cor(xxx) 计算相关系数矩阵 

corrplot(cor) 图形展示

corrplot(cor,method='number') 以数字展现相关系数

相关文章:

  • 2022-12-23
  • 2022-01-03
  • 2022-12-23
  • 2021-11-23
  • 2021-11-29
  • 2021-05-27
猜你喜欢
  • 2021-12-01
  • 2022-12-23
  • 2021-09-17
  • 2021-11-30
  • 2021-12-08
  • 2021-08-26
  • 2021-07-01
相关资源
相似解决方案