Fundamentals of learning