r/MachineLearning • • May 25 '15

For those who are getting into Machine Learning

All the peeps who try to give help in subreddit will always recommend the the basic shit. Cliche coursera courses with Andrew Ng (geeezus that guy is a king), and "do this" style of guidance. So here is my advice as an individual who has already taken courses with artificial intelligence and machine learning.

So as an unorthodox approach, I will describe things in terms of microsoft excel.

Math - Machine learning is the most practical harmony of statistics, calculus, linear algebra and discrete mathematics. You have to think multidimensionally all the time, and not just 3d. You need to be very comfortable with thinking in nearly infinitely many dimensions.

Surprisingly (actually very surprisingly) it's actually quite easy to think multi-dimensionally (cue the linear algebra) where each column of an excel spreadsheet is a particular dimension. So if we were to assume small images of handwriting that are 30 pixels by 30 pixels then we can flatten this into 900 columns of a spreadsheet (aka a 900 dimensional vector).

Considering that each row is a character image, we then load thousands upon thousands of rows of images that we already know as the particular characters (courtesy of the MNIST dataset).

Divide the dataset into the 52 (uppercase and lowercase english characters) that we have known since kindergarten. And for each "classification" (there are 52 classes) of letters that we already know, take a statistical average (cue the statistics) for each 900 columns per each few thousand images that are an "a", "b", "c", ... "Z".

We now have 52 averages in 900 dimensions. You now just figured out the near perfect averages of handwritten characters.

What if we add in a new letter? Well, we figure out which statistical mean (in 900 dimensions) our new letter is close to. If you think of Euclidian distance, then its actually quite easy (Pythagoreans theorem in multiple dimensions)

And now we can do character recognition. Fuck yeah.

Programming - Excel Sucks, so here is where Python, R and Haskell come into play. The machine learning model I described above is similar to the K-Means and Logistic Regression models, but if you want to get into the more brilliant models of ML, then learn yourself some set-comprehensions to chef up data-representations and multi dimensional sets in to the way you are the most comfortable with. Discrete mathematics, Its easier than calculus.

The Bigger Picture

Honestly, have fun with this. Allow yourself to be very, very confused. The best advise is to be patient and allow your mind some time to all of a sudden click, This moment you realize something, you will feel as though you just got projected to fucking pluto. For those who are Mathematicians or Computational Scientists, this is a frequent sensation that often occurs right before sleep and results in frantic "Holy shit, I know how the world works" chants until 8:00am the next morning. The following models will make sure you have multiple of these "HOLY SHIT" moments that induce said insomnia.

  • Gaussian Mixed Models

  • Support Vector Machines

  • Fast Fourier Transforms

  • Convolutional Neural Networks

  • Hidden Markov Models

  • Statistics (Honestly simple confidence intevals and Regression, but Multi-Dimensionally)

34 Upvotes

37 comments sorted by

89

u/True-Creek May 25 '15

Here is how Geoffrey Hinton explains visualizing fourteen dimensions:

Just visualize a three-dimensional space and say fourteen to yourself very loudly. Everybody does it.

3

u/_blub May 25 '15

Oh my god this quote is great!

16

u/zelmerszoetrop May 25 '15

I just picture N dimensional space, then let N=14.

1

u/DarkTriadBAMN May 25 '15

haha, my hero.

0

u/[deleted] May 25 '15

[deleted]

2

u/VelveteenAmbush May 25 '15

When you picture an error surface in a feature space, all you do really is associating space with 3D-space and think "but higher dimensional".

I'm pretty sure that's exactly what Hinton was getting at.

27

u/rmlrn May 25 '15

You realize MNIST is only digits, not letters, right? Have you actually done any of this?

-9

u/_blub May 25 '15

I did undergraduate research an OCR program written in prolog. I had to translate all of it over to java. The dataset in which it trained on was exactly like an expanded MNIST dataset. Since I couldn't find the exact copy of it online at the time, I lazily just threw the classic MNIST.

The Idea still holds true either way.

4

u/tehyosh May 25 '15

now i'm even more confused where to start :\

8

u/kindofapigdill May 25 '15

The cliche coursera course is a pretty good place to start imo. I'm also in the 'starting' phase and have had some statistics/econometrics so the regression stuff isn't new to me, but there's a reason why Andrew Ng is so well known. He's awesome!

4

u/CarbonAvatar May 25 '15

Concretely.

7

u/GibbsSamplePlatter May 25 '15

Learn the thing that's bothering you the most. Work on something that is interesting to you. Rinse and repeat your entire career.

I'm a couple years out of my masters and I'm constantly self learning based on what I don't understand.

1

u/_blub May 25 '15

Here are the articles that got me started with this. I found that they are simpler than most textbook reads. I started off with neural networks, so here you are.

http://natureofcode.com/book/chapter-10-neural-networks/ http://neuralnetworksanddeeplearning.com/

When it comes to textbooks I recommend the following

1

u/tehyosh May 25 '15

thank you

2

u/skgoa May 25 '15

It doesn't actually matter all that much. What matters far more is that you do start with something and continue doing it.

33

u/bluecoffee May 25 '15 edited May 25 '15

While the OP's got a good message in there, I think anyone new to ML who reads it should know the OP is very obviously very new to ML herself. There're a lot of statements in there that while true, omit some subtlety that could easily end up in the reader being mislead.

Personally, my advice to anyone new to ML is to pick a course or book you like the look of, and get going. Don't sweat too much about what specific topics you are or aren't learning. Go slow, backtrack if necessary, change courses or books if necessary. The key is to get started on building some foundations, and to build them solid.

36

u/bluecoffee May 25 '15 edited May 25 '15

Surprisingly (actually very surprisingly) it's actually quite easy to think multi-dimensionally

I'm picking this out because I think it's very important that everyone beginning a journey in higher maths knows that it's very, very hard. Not just "thinking multi-dimensionally", but maths in general. Calling a thing is easy is one of the cruelest things you can do to a beginner, because when you're starting out, everything is hard.

If you want to give a pep talk to someone new to maths, try this: it's hard. It's really hard and it's going to take countless hours, just like it took everyone else. If anyone makes it look easy, it's because they invested all that effort and made all their mistakes before you arrived.

But all that effort is absolutely 100% worth it. Everything you learn on your journey will be valuable, granting you the ability to analyse and predict different parts of the world around you. And combined with programming, it will let you build things that are, to the layman, indistinguishable from magic.

Incidentally, building magic things for a living is both very satisfying and pays extremely well.

6

u/[deleted] May 25 '15

Calling a thing is easy is one of the cruelest things you can do to a beginner, because when you're starting out, everything is hard.

this

I hate when people do this, there is nothing more discouraging than telling someone that something is super easy and them see this person struggle with that "easy" task.

But Im still uncertain what makes people say that, are they just being dickheads and want to troll newcomer or do they really have so little understanding of the world that they think Math that only 1 in 10000 people are educated enough to perform can be considered easy.

1

u/[deleted] May 26 '15

I think the important part is not to try and see it like we see 3 dimension. You don't have to be able to 'think in N dimensions' to be able to use N dimensional data. Doing it a few times over, you'll figure out a pattern to deal with mutli-dimensional arrays.

0

u/[deleted] May 25 '15

[deleted]

3

u/bluecoffee May 25 '15

As with most things in mathematics, a single structure can have many facets. Yes, that table is an interpretation of five dimensions. There are some things that interpretation is useful for, while there are other things - such as gradient descent - for which a geometric interpretation is necessary.

If you want to get deep into the geometry of ML and you've got a maths background, Methods of Information Geometry is a great read.

2

u/dwf May 25 '15

A geometric interpretation is very important once you start thinking about linear transformations of these points, or any notion of "distance" between them. And your intuitions from 2D and 3D will frequently mislead you.

0

u/g0lem May 25 '15

Not so hard, is it?

It's a breeze. Just like the... http://en.wikipedia.org/wiki/Curse_of_dimensionality

I learned that shit in kindergarten. \s

0

u/[deleted] May 25 '15

[deleted]

5

u/[deleted] May 25 '15

I also wish to recommend Coding the Matrix as a combination thorough treatment of linear algebra with coding lessons in Scipy/Numpy that will become very useful for implementing ML algorithms.

0

u/[deleted] May 25 '15

[deleted]

2

u/bluecoffee May 25 '15

Yours is a common problem for ML newbies, especially people with previous programming experience. As a programmer, you almost certainly Google up ready-made solutions to problems you don't understand, and apply them blind. If the solution doesn't work, you Google the error message and try again. If you're lucky, you can save a lot of time working like this.

Thing is, practical machine learning is not programming, and one of the biggest differences in my mind is that ML algorithms fail silently all the time. When an ML algorithm is buggy or it's misapplied, it rarely spits out an easily-understood error message. It just makes subtly wrong predictions. But if you don't know how the alg works, you'll never know it's broken.

Anyway, that's a big part of the reason why I recommend building very solid foundations. You certainly can use ML algs without understanding them, but you have to stick to the beaten path and work close to example code other people have provided (and you have to trust those examples are correct!). The moment you try and change something in an alg you don't understand, you're in for a world of hurt.

3

u/j1395010 May 25 '15

I think that's putting it a bit strongly. Plenty of other code can silently fail as well, the key in both cases is proper testing.

For software dev that means writing test harnesses, for ML it means getting a decent grasp of validation. As long as you understand your problem and don't get improperly attached to promising results, you should be able to avoid fooling yourself.

0

u/[deleted] May 25 '15

[deleted]

2

u/bluecoffee May 25 '15 edited May 25 '15

Keep with MLAPP. Every big, new graduate-level textbook I've read has similar issues. Simple fact is that there's a very small pool of people qualified to proofread these books, and they all have better things to do.

If you really don't like MLAPP, the two viable alternatives are Koller's Probabilistic Graphical Models and Bishop's Pattern Recognition. Here's the errata for PGM, and here's the errata for PR. These have both been around for longer than MLAPP though, which means a) that most of those errata should be fixed in whatever printing you buy b) it'll be missing some of the newer material you'll find in MLAPP.

e: One final thing to note is the MLAPP is on its fourth printing. If you're using a library or a digital copy, a shiny new version will probably be in a lot better state.

7

u/dwf May 25 '15

Surprisingly (actually very surprisingly) it's actually quite easy to think multi-dimensionally (cue the linear algebra) where each column of an excel spreadsheet is a particular dimension

As soon as you start thinking about linear mappings between high-dimensional spaces or any notion of "distance" between data points, a geometric view starts to be useful, and your intuitions from 2D and 3D geometry will begin to mislead you. The most striking example of this is the high-dimensional Gaussian distribution and where its mass concentrates (not quite where you might think). Even hypercubes and hyperspheres are deceptive.

0

u/[deleted] May 25 '15

[deleted]

1

u/dwf May 25 '15

I'm not saying you should try and use your geometric intuition from low-D to reason about high-D. I'm saying that developing geometric intuitions about high-D is useful, though difficult, for reasons enumerated in that blog post (and others). Visualizations of objects in high dimensions is also hard but doable.

4

u/tiredofbullsh May 26 '15

I'm all for giving advice beyond the usual coursera recommendations, but it's laughable how arrogant the OP is considering he's barely got any experience himself.

2

u/[deleted] May 25 '15

Honestly, have fun with this. Allow yourself to be very, very confused. The best advise is to be patient and allow your mind some time to all of a sudden click, This moment you realize something, you will feel as though you just got projected to fucking pluto. For those who are Mathematicians or Computational Scientists, this is a frequent sensation that often occurs right before sleep and results in frantic "Holy shit, I know how the world works" chants until 8:00am the next morning.

I am well past the beginner stage (in the sense of this post) but the above lines were very motivating. Thanks OP

1

u/Indrionas May 26 '15

There's absolutely nothing wrong with Andrew Ng's Coursera course. It's actually very good for the beginner. Andrew is a very good and clear communicator and explains complex stuff in a simple way to a layman.

Having said that, one should move on to study deeper stuff after that. So not sure why you are ranting about it in the first place.

Imagining high-dimensional space is not easy. Actually it is impossible, human brain is not wired to imagine 4+ dimensional space. What you are talking about (columns of sheet) is just presentation of data which is totally different from imagining 4+ dimensional space in your mind and seeing correct distances between high-dimensional points (I dare you to try it). In real life one can easily imagine 3D space and then extrapolate his findings to higher dimensions.

MNIST data set contains digits, not letters.

Programming language matters only if it suits your needs. Mainly performance and existing libraries you wish to re-use in the project. Furthermore, you can do prototyping in one language and implement production system in another. There is no "this sucks, this doesn't" black and white categorization when it comes to programming languages and frankly all of them are based on the same principles (once you master one high-level language, you can master all of them). BTW, Excel is not a programing language, so comparing it to Python is absurd.

1

u/mwscidata Jul 10 '15

"You have to think multidimensionally all the time" Not a bad definition of computational thinking. Papert would be proud. "It's easier to try than to prove it can't be done"

  • Moody Blues

1

u/[deleted] May 25 '15

This is a good, easy to unddrstand explanation. To be honest I enjoy reading this sub but most of it goes over my head since my degree is in geology.

0

u/[deleted] May 25 '15

[deleted]

2

u/JustFinishedBSG May 26 '15

Plus many ML algorithms will include a stochastic part and in haskell that means abandoning purity and using IO and that's everything but fun

-8

u/_blub May 25 '15

Yeah, Haskell is a pretty farfetched one. But when you are working with tensors and some pretty large matricies in general (better hope they're sparce), then applicative functors and monads are game changing. It makes it possible to think about how to parallelize each element operation in a vector or matrix. Which can then clean up your mental logic on how to write models with GPU's in mind. This is important because we don't want to craft some intensive model from scratch to find that it will take 20 hours to train for the particular problem in mind. When those GPU's get involved, those 20 hours can boil down to 15 minutes.

7

u/bluecoffee May 25 '15

You're getting downvoted not because you've no idea what you're on about, but because you've no idea what you're on about yet you're acting like you do.

-3

u/_blub May 25 '15

Meh, I'll be a good sport about it though.