关于R中我们的预测神经网络模型有多好的信息

时间:2018-06-09 22:45:56

标签: r neural-network

我使用neuralnet库来构建培训模型。

> head(TotalOutl3)
Pitch DurationZ PitchMax PitchMin PitchSlope IntenMax IntenMin IntenRange
2 0 4.4210608047 128.171 87.603 206.420 79.796 51.201 28.595
3 1 1.9639750830 144.710 70.306 347.554 79.598 63.265 16.333
4 0 1.8887772119 127.355 78.851 253.465 79.130 62.583 16.547
5 0 0.6150222368 107.059 81.724 142.582 76.373 66.946 9.427
6 0 0.4860850476 83.086 78.247 66.740 77.008 68.090 8.918
7 0 0.4124633847 107.224 81.429 452.779 77.134 75.483 1.651
IntenSd
2 8.552
3 4.933
4 5.092
5 2.625
6 3.109
7 0.433

> head(TotalOutlScaled4)
Pitch DurationZ PitchMax PitchMin PitchSlope IntenMax
2 0 0.5156214819 0.26383106571 0.12644500960 0.21674138308 0.7402924016
3 1 0.3560825287 0.33481694493 0.04953937540 0.36512355544 0.7336530078
4 0 0.3511999194 0.26032876948 0.08753201252 0.26620245765 0.7179598954
5 0 0.2684948133 0.17321773467 0.10030589742 0.14962487594 0.6255113674
6 0 0.2601229018 0.07032490665 0.08484651775 0.06988788332 0.6468043726
7 0 0.2553426359 0.17392591957 0.09899427332 0.47575256110 0.6510294414
IntenMin IntenRange IntenSd
2 0.4678259409 0.45404692269 0.37103165963
3 0.6705141129 0.25913975076 0.21343030092
4 0.6590557796 0.26254132757 0.22035448330
5 0.7323588710 0.14936737030 0.11292078561
6 0.7515793011 0.14127670397 0.13399817097
7 0.8757896505 0.02576614954 0.01746287506

index = sample(1:nrow(TotalOutl3),round(0.70*nrow(TotalOutl3)))
train_data <- as.data.frame(TotalOutlScaled4[index,])
test_data <- as.data.frame(TotalOutlScaled4[-index,])
n = names(TotalOutlScaled4)
f = as.formula(paste("Pitch ~", paste(n[!n %in% "Pitch"],
collapse = " + ")))
NNRModel<-neuralnet(f,data=train_data,hidden=1,linear.output=TRUE)
PredNetTest <- compute(NNRModel,test_data[,2:9])
MSE.net <- sum((test_data$Pitch - PredNetTest$net.result)^2)/nrow(test_data)
MSE.net

我们能否获得有关敏感性和特异性的更多信息?类似confusionMatrix()的内容,而不只是MSE

0 个答案:

没有答案