Ask HN: What is the best way to learn Machine Learning in Python?
I am comfortable in coding, also familiar with python programming.
What approach should i follow to learn machine learning with in SHORT TIME.
Should i start with a book(if yes which one), or with a machine learning library or with a project or with complete machine learning algorithm implementation in python.
Please provide me step by step guide which i should follow (with the source links and references[if possible]) to learn machine learning in one or two months.
49 comments
[ 0.28 ms ] story [ 124 ms ] threadYou might find Andrew Ng's Stanford Coursera course a good place to start. https://www.coursera.org/learn/machine-learning/home/info.
edit: +1 to Andrew Ng's Coursera course though!
I appreciated the challenge of thinking from an array based language, but I felt it held me back from directly comparing my solutions to the tutorials to external sources. (Unless that even in of itself was the reason).
ISL is an excellent, free book, introducing you to ML, you can go deeper, but, to me this is where I wish I'd started. I am taking the Data Science track at Coursera (on Practical Machine Learning now) and I am kicking myself that I didn't start with ISL instead.
Now, I know you specifically asked about Python, but the concepts are bigger than the implementation. All of these techniques are available in Python's ML stack, scikit-learn, NumPy, pandas, etc. I don't know of the equivalent of ISL for Python, but if you learn the concepts and you're a programmer of any worth, you will be able to move from R to Python. Maybe take/read ISL, but do the labs in Python, that might be a fun way to go.
Lastly, to go along with ISL, "Elements of Statistical Learning" also by Hastie et al is available for free to dive deeper [3]
[1] -- http://www-bcf.usc.edu/~gareth/ISL/
[2] -- https://lagunita.stanford.edu/courses/HumanitiesandScience/S...
[3] -- http://statweb.stanford.edu/~tibs/ElemStatLearn/
Also, rather than learning ML in 2 months (which is a very unfocussed and unattainable goal) -- try to narrow it down to some problem domain. You'd get better recommendations if you are more specific.
I don't think that's necessarily something one can (or ought to) expect to order up on Hacker News.
That said, I'm also interested in the topic. As others are acknowledging, it's a broad field and one really needs to focus on well-defined projects in order to learn anything tangible.
"Never attribute to malice that which is adequately explained by stupidity."
Note: "Stupidity" is obviously not the correct word for this situation, but the quote is still relevant.
http://shop.oreilly.com/product/0636920030515.do
http://www.amazon.com/Artificial-Intelligence-Modern-Approac...
Has plenty of examples in Python. You can also look at different Udacity courses. They have a couple dealing with ML with Python.
It's a bit more complex than simply: give someone step-by-step instructions and they have the skill and/or knowledge. If they're still at the level where you have to explain everything, then that's a fairly low level of skill - and it's not clear that instruction on all subjects is appropriate to that level of skill... just as you wouldn't go up to an aeronautics engineer, ask for a step by step instruction guide on how to build a 747, and then call yourself an aeronautics engineer.
You might, if you had a very good memory, be able to build a 747 (waving aside the logistical difficulties of doing so) but you wouldn't understand why it worked, and you wouldn't know how to build any other aircraft. And if, instead, you asked her for a step-by-step guide on how to learn what she knew in a couple of months... Well, the answer would likely be that she knew a lot more than could be communicated in two months, and that you needed a higher level of understanding of physics and so on to ask a more refined question to which she would be able to give some sort of meaningful answer.
How is someone with this little motivation going to learn something so complex? I want to allocate my time helping people who at least try first.
"All exercises will use PySpark, but previous experience with Spark or distributed computing is NOT required. "
https://www.edx.org/course/scalable-machine-learning-uc-berk...
http://www.amazon.com/Machine-Learning-Python-Techniques-Pre...
The main thing to understand though is that machine learning is a big topic, and you aren't going to be able to become an expert in two months.
Narrow down to a specific area, or type of problem, and focus on learning techniques and tools for that.
My guess is that there's something your working on or want to work on which is why want to learn. If that's the case, I'd recommend that read up a bit to give yourself a good understanding of the different kinds of problems out there (classification, prediction, anomaly detection, etc...), and different classes of tools available, and then pick a simple real world problem to try to tackle that is similar.
The best way to really learn is going to be getting hands on with a project and suffering through after you've read up a bit to understand the basics. Then when you hit something can't wrap your head around, search and read articles (or talk to someone with experience and expertise) until it clicks and you can proceed on working through.
By the end you'll have a good grasp of at least one technique, and be in a great place to keep learning more.
https://twitter.com/sfnet_ops?original_referer=http%3A%2F%2F...
http://deeplearning.net/tutorial/contents.html
Has the advantage of a Python framework (Theano) specifically for deep learning.
I don't have any relationship with Kaggle other than being a semi-active user, but I really dig what they've got going. For a step-by-step approach, start with their blog posts and work on their "Getting Started" competitions. Everything you need is there.
I would recommend starting with scikit-learn.
How to apply machine learning using Python? (then scikit learn related materials).
How to tinker with machine learning implementations? (then which one are you trying to tinker with and what problem that isn't solved in the standard libraries is your concern?)
The theory of machine learning? (then "The Elements of Statistical Learning" and "An Introduction to Statistical Learning", but that is in R not in Python)
http://radimrehurek.com/data_science_python/ - Practical Data Science with spam detection example (Machine Learning, NLP, sklearn, Python).
The very first thing I did was take a step back and understand the domain of the data I was working with, and what the best way to present it for machine learning would be. In my case, I had to understand what the best format for presenting my audio would be (slightly modified MFCCs), and what the best library would be to get my data in that format.
Next, I needed to build a data set of proper training data. This mean I had to manually build a (largish) data set that matched exactly what I was looking for. So I went and downloaded a bunch of example audio, and then manually went through it, tagging it into the two bins I was looking to differentiate against.
Once I had this, (which actually took much more time than the learning itself), I was ready to do the actual machine learning itself. I used Theano, and figuring out how to translate my dataset into a format digestible by Theano took another chunk of time. Once I had my data in the proper format for Theano, it came down to basically playing with how I presented my initial data to Theano, and then tweaking my gradient.
Finally, I was able to train and get a net that was about 80% right with my hypothesis. There were a few edge cases I hadn't anticipated that wouldn't necessarily work well, but it gave us enough confidence to go through with more machine learning for our project.
So, takeaway suggestions: find a real project, something you want to learn, and then just do it. Gather knowledge of your data, build a dataset, and test a hypothesis. Most of this isn't machine learning, it's mostly just moving and shaping data, and knowing what in your data is significant. The machine learning algorithms are really just a tiny piece of the whole picture. Good luck.
These are three very good O'Reilly books that all use Python:
- Programming Collective Intelligence: A broad and shallow survey of automated machine learning techniques.
- Data Analysis with Open Source Tools: Also a survey. More focused on manual data exploration.
- Python for Data Analysis: A pandas tutorial (and more). Very helpful to learn the ML tools in the python ecosystem.
Fitting all that into two months sounds challenging.
It doesn't teach you ML with Python but it is extremely important to learn the ML concept without any programming language in mind. In addition to that course, any Google search will help you a lot. There are a lot of good explanations of ML concepts on various websites. If you don't understand how algorithms work, you will end up with copying and pasting example codes without knowing what you're doing. You need to imagine what you want to do in your head before you type any letter.
[2] -- Once you have the initial introduction, you can use Python to implement ML concepts. Fortunately, Python has a very easy to learn ML package: Scikit-learn (http://scikit-learn.org). It's free and is used by various companies such as Spotify and Evernote. Scikit-learn has a great documentation and many examples that will make the whole learning process exciting.
[3] -- After you feel comfortable with ML in Python, if you don't have datasets of your own, you can find a lot of datasets on UC Irvine's machine learning repository: http://archive.ics.uci.edu/ml/
The more you practice, the more comfortable you feel with playing with data. To cover a ML technique very well, play with every single parameter of the scikit-learn functions of that technique by using the same dataset. Also, always try to include visualization of the data (scikit-learn has examples with matplotlib to learn from how to do it) so you can actually see the changes of the implementation when parameters of the function change. This will make everything a lot easier.
Good luck!
There are also another great resources online, like those I list below:
1.) In-depth introduction to machine learning in 15 hours of expert videos[2]
2.) Deep Learning Tutorial (@ ufldl.Stanford.edu/tutorial/, can't post the link because I'm out of mana, I mean, not enough reputation yet)
[1]: https://github.com/josephmisiti/awesome-machine-learning
[2]: https://www.dataschool.io/15-hours-of-expert-machine-learnin...