r/dailyprogrammer • u/Elite6809 1 1 • Apr 09 '15
[Weekly #22] Machine Learning
Asimov would be proud!
Machine learning is a diverse field spanning from optimization and data classification, to computer vision and pattern recognition. Modern algorithms for detecting spam email use machine learning to react to developing types of spam and spot them quicker than people could!
Techniques include evolutionary programming and genetic algorithms, and models such as artificial neural networks. Do you work in any of these fields, or study them in academics? Do you know something about them that's interesting, or have any cool resources or videos to share? Show them to the world!
Libraries like OpenCV (available here) use machine learning to some extent, in order to adapt to new situations. The United Kingdom makes extensive use of automatic number plate recognition on speed cameras, which is a subset of optical character recognition that needs to work in high speeds and poor visibility.
Of course, there's also /r/MachineLearning if you want to check out even more. They have a simple questions thread if you want some reading material!
This post was inspired by this challenge submission. Check out /r/DailyProgrammer_Ideas to submit your own challenges to the subreddit!
IRC
We have an IRC channel on Freenode, at #reddit-dailyprogrammer. Join the channel and lurk with us!
Previously...
The previous weekly thread was Recap and Updates.
View all comments
Show parent comment
3
u/[deleted] Apr 10 '15 edited Apr 12 '15
Yeah you can make the problem as hard or easy as you wanted!
Harder Problem
Here is a more challenging problem! Find the maximum of the function described by:
f(x,y) = (e-x2 - y^2+sqrt(5) sin2 (x3 )+2 cos2 (2x+3 y))/(1 + x2 + y2 )
where -3<=x<=3 and -3<=y<=3
or you can check out the function On Wolfram Here
My solution
My solution is a Genetic Algorithm where the genome is encoded as binary so that we can perform more interesting evolutionary functions to the data easily!
Every part of my algorithm except the binary conversion function is vectorized so that the algorithm runs much more quickly than an implementation using for loops would.
If anyone sees a way to easily vectorize the conversion function please let me know ;)
Can also be found on my Github if you see anything you can help with
Main code
Fitness Function
Binary to Integer Conversion
Function to Normalize Range of Population Members