Recognition and learning in a mathematical model for immune response against cancer