Github user tolgap commented on the pull request:
https://github.com/apache/spark/pull/1290#issuecomment-70637578
I gave a shot at trying out the ANN with the MNIST dataset. I find it
difficult to get the correct error rate from the output of the predictor.
Given an output `RDD[(Vector, Vector)]`, with both `Vector` being 10
dimensional (0..9), how do I get the error rate out of it? I've tried:
```Scala
val errRate = output.map {
T =>
val p = T._2.toArray
val l = T._1.toArray
(p(0) - l(0)) * (p(0) - l(0)) +
(p(1) - l(1)) * (p(1) - l(1)) +
(p(2) - l(2)) * (p(2) - l(2)) +
(p(3) - l(3)) * (p(3) - l(3)) +
(p(4) - l(4)) * (p(4) - l(4)) +
(p(5) - l(5)) * (p(5) - l(5)) +
(p(6) - l(6)) * (p(6) - l(6)) +
(p(7) - l(7)) * (p(7) - l(7)) +
(p(8) - l(8)) * (p(8) - l(8)) +
(p(9) - l(9)) * (p(9) - l(9))
}.reduce((u,v) => u + v)
```
But this gives me an error rate > `1`, namely `1708.46666263`. I am
expecting an error rate between 0 and 1. This same error rate calculation
(Squared error) is also used in the `ANNSuite` example.
p.s: I am still researching Machine Learning/Neural Network, so I am not
very knowledgable. I would very much appreciate the help.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]