trainclass function added which will learn feature parameters for a particular class