Make learning process more clear by seperate convert matrix and learning algorithm.
Rearrange regression example to fit this change.