当前位置:网站首页>R language universalbank CSV "data analysis
R language universalbank CSV "data analysis
2022-06-22 20:53:00 【Mrrunsen】
(10 branch ) Take the data set used in the second operation ( flight delay Flightdelayscsv And loan receipt Universal Bank. csv Choose any one of ) For example , Comprehensive use of a variety of classification supervised learning methods , Include ,kNN, glmnet, Regression classification tree , Random forest and so on , Set your own training set ( Estimate the optimal model ) And test set ( Evaluation model ), Compare the classification accuracy of different methods ( Or misclassification error rate, and give the selection results of important characteristic variables by different model methods .
set.seed(123)
df = read.csv("UniversalBank.csv",stringsAsFactors = TRUE)
# Remove ID
df = df[,-1]
df$CreditCard <- as.factor(df$CreditCard )
# Divide the training set and the test set
train <- sample(nrow(df), 0.9*nrow(df))
df.train <- df[train,]
df.validate <- df[-train,]
# kNN
library(kknn)
knn <- kknn(CreditCard ~ .,df.train,df.validate)
# Predict on the test set
pre_knn <- fitted(knn)
# Output obfuscation matrix
library(caret)
confusionMatrix(df.validate$CreditCard, pre_knn)

be based on KNN Model Of The accuracy is 0.698
Logical regression
log <- glm(CreditCard ~ ., data = df.train, family=binomial())
prob <- predict(log, df.validate, ty边栏推荐
猜你喜欢

R语言midwest数据集可视化

智能计算之神经网络(Hopfield网络-DHNN,CHNN )介绍

Security policy and NAT (easy IP) of firewall Foundation

AAAI 2022 | traditional Gan can be interpreted after modification, and the interpretability of convolution kernel and the authenticity of generated image are guaranteed

Teach you how to create SSM project structure in idea

Containerd容器运行时(2):yum安装与二进制安装,哪个更适合你?

科技云报道:东数西算不止于“算”,更需“新存储”

怎样实现网页端im即时通讯中的@人功能

Classic interview question: a page from entering URL to rendering process

天,靠八股文逆袭了啊
随机推荐
80-分页查询,不止写法
软件压力测试有哪些方法,如何选择软件压力测试机构?
Oracle system/用户被锁定的解决方法
如何使用Feign构造多参数的请求
Several common MySQL commands
CVPR 2022 oral | video text pre training new SOTA, HKU and Tencent arc lab launched excuse task based on multiple-choice questions
完全背包如何考慮排列問題
79-不要看到有order by xxx desc就创建desc降序索引-文末有赠书福利
Teach you how to create SSM project structure in idea
Unityeditor editor script execution menu
[proteus simulation] 8x8LED dot matrix digital cyclic display
70-根因分析-oracle数据库突发性能问题,谁来背这个锅
从感知机到Transformer,一文概述深度学习简史
深度学习常用损失函数总览:基本形式、原理、特点
EasyClick更新图库
An IPFs enabled email - skiff
跨域 CORS/OPTIONS
Introduction to async profiler
Introduction of Neural Network (BP) in Intelligent Computing
73-找到业务高峰时段的sql示例(报表开发类)