trainclass function added to learn rule about a class