R语言AMORE包实现BP神经网络——German数据集
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")
最新文章
- git
- 玩转Redis之Window安装使用(干货)
- ORACLE判别字段是否包含中文
- iframe高度调整
- 基于Delphi的三层数据库系统的实现方法
- data audit on hadoop fs
- appFramework在三星某些机型上的兼容问题
- Android与服务器端数据交互(转)
- Visual Studio 2015的安装与基本使用
- css如何让div和页面等高?
- Java中的内存分配
- CentOS7(64)环境使用rpm命令安装gcc
- Oracle系列(二): Oracle表的外键查询
- 安装java时,配置环境变量classpath的作用
- Nginx服务器报 ";Too Many Open Files";
- 作业C#程序分析
- greenlet 实现手动协程切换
- SweetAlert2 弹窗
- 着重基础之—Java 8 Comparator: How to Sort a List (List排序)
- Regex Golf练习笔记(1)
热门文章
- vim使用指北 ---- Global Replacement
- 异步等待的 Python 协程
- JSP 页面打印
- POJ 1419
- Peer certificate cannot be authenticated with known CA certificates.
- IOS笔记 #pragma mark的用法和作用(方便查找和导航代码)
- Good Bye 2015 B. New Year and Old Property 计数问题
- UVA 1362 Exploring Pyramids 区间DP
- Linux:-bash: ***: command not found
- spring PropertyPlaceholderConfigurer 找不到配置文件原因