I think this depends greatly.
Generally, I would say to definitely choose the professor you TA'd for, because he will speak genuinely about his experiences with you and his faith in you moving forward.
However, if the machine learning professor is a world-renowned researcher, then this might give you a huge boost in your application (given he writes a decent letter that doesn't sound generic).
That said, my suggestion is that unless the ML professor is a big name guy, I would go with the professor you TA'd for -- he will write a great letter for you since he knows you well and you have worked hard for him.