Machine Learning Methods for Locomotion Mode Recognition with Application to Active Lower Limb Prosthesis