You say that companies should train mediocre programmers to be excellent programmers. This is not as straight-forward as it sounds, (a) the mediocre programmers might have already reached the limit of their capability (i.e no matter how much time they'll spend learning, the improvements will only be marginal), (b) it could take long time and as we all know, time is money.
I like to think of it as a simple exponential graph. Programming Skill on X-axis vs Time Spent Learning on Y-axis. In the beginning the progress will be fast for everybody, but at some point the progress will slow down indefinitely (i.e you've reached your maximum capacity). The point at which this will happen varies from person to person and there is unfortunately no way you can determine where that is. The only hint of the maximum capacity you can get is to compare how long the guy has been programming for and how skilled he is at given time.
As a result, it is more cost-effective to search for very good candidates for longer than to take handful on mediocre ones, take the risks, and train them.
It should be noted that a programming is without exceptions self-thought. Therefore there is no need for training per se, you will just need to take your time and do it yourself, as programming can not be taught, it can only be learned.