x = as.matrix(iris[,1:4])
y = as.vector(as.numeric(iris[,5]))
y = replace(y, y == 2, 0)
y = replace(y, y == 3, 0)
model = DeepNetworkTrain (x, y, nHidden1 = 32, nHidden2 = 32)
results = DeepNetworkPredict (x, model)
networkPrediction = apply (results$prediction, 1, which.max) - 1
errors = sum(abs(y - networkPrediction))/length(y)
cat("Network produced ", errors, "errors.\n")
Run the code above in your browser using DataLab