Homonym Confusion Matrix
Purpose: to illustrate how C4.5 may be used to produce a confusion matrix.
Problem: apply the rules generated for the homonym pair bare/bear in the previous example to a set of unseen sentences to test their fitness.
Downloadable Files
The data used in bare.test were determined from the following fourteen sentences:
Bare (as an adjective)
- The cupboard was completely bare, spare a thin layer of dust.
(none,article,noun,verb,adverb,bare)
- The judge wanted nothing but bare facts.
(article,noun,verb,adverb,connective,bare)
- Soon, frostbite was sure to affect his bare skin.
(verb,adjective,preposition,verb,possessive,bare)
- They decided the bare corner in the living room was an ideal location for the new house plant.
(none,none,pronoun,verb,article,bare)
- The walls of her studio were bare.
(noun,preposition,pronoun,noun,verb,bare)
Bare (as a verb)
- The school counselor asked him to bare his feelings.
(adjective,noun,verb,pronoun,preposition,bare)
- The doctor asked his sick patient if he could bare his back for him so that he could examine his breathing.
(adjective,noun,connective,pronoun,modal,bare)
Bear (as a noun)
- The park ranger spotted the bear fifty meters from the camp site.
(article,adjective,noun,verb,article,bear)
- I once tranquilized a polar bear during a research expedition in the arctic.
(pronoun,adverb,verb,article,adjective,bear)
Bear (as a verb)
- Her supervisor told her to bear in mind that sometimes the optimal solution is not always the best solution.
(pronoun,noun,verb,pronoun,preposition,bear)
- She could not bear the suspense any longer.
(none,none,pronoun,modal,adverb,bear)
- If he could bear the strain for another ten seconds, he could break the old record.
(none,none,connective,pronoun,modal,bear)
- I bear grudges against all types of pollutants.
(none,none,none,none,pronoun,bear)
- They were forced to stay behind and bear witness.
(verb,preposition,verb,adverb,connective,bear)
Summary of Results
Running C4.5 with the -u switch
i.e., % c4.5 -f bare -u
generates this grid from the test data:
Predicted |
bare |
bear |
2 |
5 |
bare |
Actual |
1 |
6 |
bear |
This grid is called a confusion matrix, and the results shown are interpreted as follows:
- 2 sentences of class bare were correctly classified,
- 5 sentences of class bare were misclassified as bear,
- 1 sentence of class bear was misclassified as bare, and
- 6 sentences of class bear were correctly classified.