library(AMORE)
data<-read.table('G:\\dataguru\\ML\\ML09\\基于BP网络的个人信贷信用评估\\基于BP网络的个人信贷信用评估\\german.data-numeric')
for (i in 1:25) {
data[,i] <- as.numeric(as.vector(data)[,i])
}
pos<-data[which(data$V25=='1'),]
neg<-data[which(data$V25=='2'),]
train<-rbind(pos[1:350,],neg[1:150,])
test<-rbind(pos[351:700,],neg[151:300,])
net <- newff(n.neurons=c(24,8,2,1), learning.rate.global=1e-13, momentum.global=0.5,
error.criterium="LMS", Stao=NA, hidden.layer="tansig",
output.layer="purelin", method="ADAPTgdwm")
result <- train(net, train[1:24], train[25], error.criterium="LMS", report=TRUE, show.step=100, n.shows=5 )
y <- sim(result$net, test[1:24])
y[which(y<1.5)] <- 1
y[which(y>=1.5)] <- 2
sum = 0
for(i in 1:500){
if(y[i]==test[i,25]){
sum =sum+1
}
}
cat("正确率", sum/500, "n")

最新文章

  1. git
  2. 玩转Redis之Window安装使用(干货)
  3. ORACLE判别字段是否包含中文
  4. iframe高度调整
  5. 基于Delphi的三层数据库系统的实现方法
  6. data audit on hadoop fs
  7. appFramework在三星某些机型上的兼容问题
  8. Android与服务器端数据交互(转)
  9. Visual Studio 2015的安装与基本使用
  10. css如何让div和页面等高?
  11. Java中的内存分配
  12. CentOS7(64)环境使用rpm命令安装gcc
  13. Oracle系列(二): Oracle表的外键查询
  14. 安装java时,配置环境变量classpath的作用
  15. Nginx服务器报 &quot;Too Many Open Files&quot;
  16. 作业C#程序分析
  17. greenlet 实现手动协程切换
  18. SweetAlert2 弹窗
  19. 着重基础之—Java 8 Comparator: How to Sort a List (List排序)
  20. Regex Golf练习笔记(1)

热门文章

  1. vim使用指北 ---- Global Replacement
  2. 异步等待的 Python 协程
  3. JSP 页面打印
  4. POJ 1419
  5. Peer certificate cannot be authenticated with known CA certificates.
  6. IOS笔记 #pragma mark的用法和作用(方便查找和导航代码)
  7. Good Bye 2015 B. New Year and Old Property 计数问题
  8. UVA 1362 Exploring Pyramids 区间DP
  9. Linux:-bash: ***: command not found
  10. spring PropertyPlaceholderConfigurer 找不到配置文件原因