0
votes

Using H2O DeepLearning and a Tanh activation function, is it acceptable/valid to get a predicted (probability) value greater than 1? If so, doesn't that skew predictions to the first class?

Details: I am using H2O for Deep Learning Artificial Neural Networks in R to predict 2 classes. My y data (actualResults) are the actual classifications of only 0s and 1s. The x independent variables are all numerical and the training frame excludes the y (actualResults). When I do a max on the predicted values, I get values greater than 1, never less than -1, though Tanh is suppose to be limited to [-1, 1].

Questions:

  1. Are these predicted values greater than 1 acceptable/valid?
  2. Why am I getting predicted values greater than 1 for Tanh?
  3. Does this occurrence of values greater than 1 skew/bias positive (class 1) predictions?

Note: In the code below, the training_set and testing_set's first column is the actual classification, so -c(1) removes it for the network's input.

ANN <- h2o.deeplearning(y = "actualResult",
                              x = independentVariableColumns,
                              training_frame = as.h2o(training_set[-c(1)]),
                              activation = "Tanh",
                              hidden = rep(3, 3),
                              epochs = 100)


prediction <- h2o.predict(ANN, newdata = as.h2o(test_set[-c(1)]))
maxPrediction <- max(prediction)
1

1 Answers

0
votes

The first column in prediction is the predicted class. Try max(prediction)[-c(1)] to get the maximum value from the probabilities.