随笔分类 -  R

摘要:员工离职预测 library(dplyr)library(psych)library(ggplot2) library(randomForest) str(train) #删除 常量 #重编码 #Age 和 Attrition #小结: #Department 和 JobLevel #小结:不同部门 阅读全文
posted @ 2017-10-16 14:35 aongao 阅读(1968) 评论(0) 推荐(0)
摘要:iris数据集预测(对比随机森林和逻辑回归算法) 随机森林 library(randomForest) #挑选响应变量 index <- subset(iris,Species != "setosa")ir <- droplevels(index) set.seed(1) ind<-sample(2 阅读全文
posted @ 2017-10-14 10:25 aongao 阅读(683) 评论(0) 推荐(0)
摘要:加载数据 赋值新数据集 字段值之间的关系 探索缺失值的方法 填补缺失值 使用决策树或随机森林处理缺失值 使用逻辑回归 #加载数据 #注意:字符串要带有双引号 #“Sex”字段类型转换/生成新的字段值(因子类型字段处理) #“Embarked“字段转换/生成新的字段值(因子类型字段处理) #拆分字段" 阅读全文
posted @ 2017-09-11 16:58 aongao 阅读(265) 评论(0) 推荐(0)
摘要:如题,使用insatll.packages("cluster")安装包时,会出现如下错误提示。 Warning: unable to access index for repository https://mirror.lzu.edu.cn/CRAN/src/contrib: cannot open 阅读全文
posted @ 2017-09-03 08:56 aongao 阅读(1534) 评论(0) 推荐(0)