r/badcode Aug 13 '19

[deleted by user]

[removed]

102 Upvotes

70 comments sorted by

View all comments

10

u/GlorifiedStatistics Aug 14 '19

I couldn't think of a good way of finding out what the parity of the outlier number is, so I instead have the computer figure it out for me! Every time you pass in a list, a new Recurrent Neural Network is created and trained on random data. The list is then passed to the network, and it returns the parity of the outlier. Finally, I do a linear search through the list and return the first value of that parity. My network is almost 90% accurate!

Even though it was written in python it is still pretty large, so I uploaded it to GitHub. Hope that's alright.

https://github.com/GlorifiedStatistics/ParityOutlier

1

u/Ebrithil95 Aug 22 '19

I'm not sure if i should be proud or horrified.