This is the thirty-ninth article in a series dedicated to the various aspects of machine learning (ML). Today’s article will outline the difference between lazy vs. eager learning.
It is the day of the big test, and you feel woefully over-prepared. You have sacrificed enormous amounts of time and squad Dairy Queen trips in favor of absolutely crushing this big vocabulary test. If you do not get at least an A- on this big test, then you can kiss your chances of attending THE Full Sail University goodbye!
It’s safe to say that you are a good learner, possibly even an eager one. After all, you have more or less performed the scholastic equivalent of a hot iron brand on your brain by memorizing the synonyms, antonyms, etymology, use examples, part(s) of speech, definitions, and other trivia related to all 150 vocabulary words that will be on the test. And if the word memorization wasn’t enough, the color-coded notecards you made for each word have also been scanned to your exceptionally photographic memory.
But when you sit down for the big test, you are immediately distracted by Lonnie the Lazy Learner, which is his actual legal birth name.
“Hey, Ezra the Eager Learner”, he whispers hoarsely at high volume across four rows of students (Ezra the Eager Learner is your actual legal birth name, by the way), “what is the definition of ‘Name’? I’m not seeing it anywhere on me!”
You look and, lo and behold, Lonnie the Lazy Learner has Sharpie-tattooed as many vocabulary word definitions as possible on his arms.
“Lonnie the Lazy Learner,” you say, “the test is just asking for your name! You would know that if you actually bothered to learn the vocabulary words in your vocabulary book instead of just storing them via Sharpie on your body!”
“Oh,” he says, then writes his name and proceeds to do actually pretty well on the test, from “And” to “Zebra” he has it all written on himself, which the teacher either does not notice or simply does not care. “By the way,” he whisper-shouts to you, “these aren’t Sharpied on, they’re real tattoos! My aunt, she’s a, she’s a…,” pausing to check his arm, “a tattooist.”
If you have been keeping up with our machine learning series so far, then you very well know that the above introduction was not just written for your entertainment, but education as well. And this slice of edutainment, in its own sly way, has familiarized you with a significant classification of learning algorithms: That between eager and lazy learning algorithms.
Eager and Lazy Learning Algorithms
The difference in how these types of learning algorithms function is illustrated in the above example, with the basic thing being that an eager learning algorithm has an agent learn from a data set as soon as it encounters the data, whereas a lazy learning algorithm simply stores the data encountered, and waits to learn until it is tested.
What does this mean, exactly?
Well, an eager learning agent will typically create a hypothesis from its initial encounter with the data set, which can be a good thing or a bad thing. To do this, let’s bring back our vocabulary test example, but with the added twist that Ezra the Eager Learner and Lonnie the Lazy Learner are actually robots!
Think of Ezra the Eager Learner: if Ezra is asked to give the definition of “trepanation,” Ezra will write exactly what has been memorized from the initial data’s definition. However, if the big test throws a curveball, such as using a synonym for “abacinate” that wasn’t included in the vocabulary book, Ezra might freak out a bit, and search frantically through the scores of memorized synonyms only to not come up with a match.
Now, Lonnie the Lazy Learner might have a different experience. He doesn’t know all of the synonyms for the words, only the definitions that he unfortunately made permanent on his body in preparation for the big test. As a result, when he is confronted with an unknown synonym, he is more likely to take a stab at the dark by referring to definitions that may link up with the synonym.
And, as it turns out, there are plenty of curveballs on the big test, so Lonnie the Lazy Learner actually performed better than Ezra the Eager Learner! Which goes to show that, in the machine learning world, “lazy” is not a bad word, exactly!
Eager learning algorithms lead agents to learn immediately from data sets, while lazy learning algorithms store data and tend to learn when tested. This is not a bad thing, as eager learning agents can sometimes become too restricted.