我使用neuralnet
构建神经网络,所有变量都是二进制(0,1),但是在工作之后,我得到了低质量的神经网络。
mydata=read.csv("C:/Users/synthex/Downloads/mydata.csv",sep=";",dec=",")
View(mydata)
index <- sample(1:nrow(mydata),round(0.75*nrow(mydata)))
train <- mydata[index,]
test <- mydata[-index,]
library(neuralnet)
r <- neuralnet(isOneDay~digestGreenList+courtPracticeList
+linkedEntitiesByCeoNumList
+profitValueList
+sizeList
+gosWinnerSumList
+gosPlacerSumList
+inspectionsNoViolationsNumList
+linkedEntitiesChildrenNumList
+licensesList
+inspectionsNoViolationsNumList
+revenueValueList
+gosWinnerNumList
+gosPlacerNumList
+inspectionsHasViolationsNumList
+inspectionsHasViolationsFailsList
,
data=train, hidden=35, err.fct="ce", linear.output=FALSE,threshold=0.1,
stepmax = 1e6, rep = 3)
mypredict=pr.nn <- compute(r,test[,3:17])$net.result
table(round(mypredict), test[,2])
和结果
0 1
0 314 141
1 58 29
这很糟糕。如何建立具有更好分类的模型,这非常重要。 这里的数据 mydata