The activity is suitable as a conclusion to studying animal groups (mammals, reptiles, birds, fish, etc.), as it allows students to thoroughly review the characteristics of different groups and individual animals (Are dolphins fish? Do penguins have fur?).
Students will see and understand a simple machine learning algorithm. Due to the interesting topic, they may become very engaged—sometimes even a little too much — if we let them.
Download the file animals.xlsx and open it in Excel. (Lines 2 and 3 are hidden. Their content is not important to us here; it is described in the additional material for teachers.)
Ask the students to suggest two animals that belong to different animal groups. Let’s say they choose a frog as an example of an amphibian, and a swallow as a representative of birds. We fill in the names of these animals in the first column.
We ask the students to tell us which trait we are going to use to distinguish them by. Let’s say we have decided to distinguish the animals based on whether they fly or not. (It would be more appropriate to use feathers as a trait; hens are not known as good fliers, and penguins even less so. However, we follow the students’ suggestions.) We add the column »flies« to the table, and for the frog, we put in a »no«, while for the swallow, we enter »yes«.
We will probably use different animals and traits in the classroom - we follow the students’ suggestions.
We download the workflow for Orange from the website and open it.
Click on the button for opening a file (to the right of the file name input line) and open the Excel file that we have just created.
Double-click on the Tree Viewer. The computer has come to an obvious conclusion: if an animal flies, it is a bird; otherwise, it is an amphibian. We make sure that the students understand the meaning of the tree.
Ask the students to suggest two new animals from these two groups (in our case, an amphibian and a bird). Let’s say they suggest a salamander and a sparrow.
We open the Prediction widget. It shows all four animals. In the right part we see the data, and the column on the left shows the computer’s predictions. The salamander is classified as an amphibian, while the sparrow is a bird.
We ask the students for more animals. They are likely to suggest some of their favorite animals, or some interesting ones. Choose one that is not a bird or an amphibian. Sometimes they will ask themselves what would happen if we added an animal that belongs to a completely different group. If they don’t, we try to nudge them in that direction.
Suppose they want to see the computer’s prediction of a cow. We add it to Excel: we enter its name and the information that it doesn’t fly (consider the earthquakes it would cause when landing). Leave the second column empty! Save.
Before reloading the data in Orange, ask the students to predict where the cow will end up. They will probably figure out on their own that the computer cannot classify it under mammals, since it only knows amphibians and birds. In which of these two groups will it then place the cow? If they already forgot the tree, show it again. They must realize that the cow will be classified as an amphibian.
Reload the data in the File widget. Open the Prediction widget. The cow is classified as an amphibian, as we expected.
We ask the students what to do to teach the computer to classify cows as mammal. Hopefully, they will suggest adding another feature. With cow, this will most likely be “gives milk”. Add a column, fill in the data (“yes” for cow, “no” for all other animals). Keep the second column empty. Save, reload in Orange.
If they instead suggest adding a new mammal into the data - great, let’s do so (otherwise, this would come two steps later). Afterwards we’d have to add another feature to distinguish between mammals and amphibians.
If they suggest telling the computer that cow is a mammal, resist and tell them we want the computer to discover this on its own. This is the essence of machine learning.
Open the Tree Viewer. It is unchanged. Open the Prediction widget. No change. Why?
The computer still doesn’t know about mammals because it hasn’t seen any. If students suggest telling the computer that cows are mammals, resist and tell them we want the computer to discover this on its own, but we can help it by adding another mammal to the data.
We can add, for example, a bear. This is great because we can joke about the fact that bears (actually she-bears) do give milk in principle, but both bear milk and bear cheese are less known than goat milk, because it is too dangerous to milk she-bears.
V Excelu torej dodamo medveda, povemo, da je sesalec, ki ne leti (samo še tega, da nas napade leteči medved se nam manjka) in da daje mleko (vsaj teoretično). Shranimo.
In Excel we therefore add a bear, describe it as mammal that doesn’t fly (imaging being attack by a flying bear…) and gives milk (at least in theory). Save.
Reload the data in the File widget in Orange. Open the Tree Viewer. We see that the tree now distinguishes non-flying animals based on whether they give milk or not.
Open the Prediction widget. The computer has learned that cows (like bears) are mammals.
Make sure that the students understand what the emerging classification tree means: flying animals are birds, for others it is necessary to determine whether they give milk not. If they do, they are mammals, otherwise they are amphibians.
We continue the lesson by adding new groups of animals, for example fish, and appropriate variables to describe them. (Does it have scales? Or: does it breathe with gills?) Insects are even more interesting, as they fly but are not birds. How to distinguish insects from birds?
The activity can be very interesting and we need to be prepared for different scenarios. For example, students can suggest a fact about whether an animal has fins. This will become interesting if we add dolphins. We can reiterate that dolphins are mammals; when we add mammals with fins, fins are suddenly no longer a good feature to identify fish (and in fact they are not).
Students can add penguins and start arguing about whether they are fish (not: birds) and whether they have hair (not: feathers).
The lesson can be really fun. We have encountered all sorts of absurd situations in the classroom. We not only milked the bears, but also discussed whether snails fly and found that if they do, they most certainly fly at a snail’s pace, so very slowly.
Students will perhaps add more data than is necessary, or data that will not say anything that cannot already be seen from the others.
Students may find it interesting to know what would happen if there was a “yes” or a “no” everywhere. They will already be able to answer such questions for themselves, with the help of the tree. However, it is instructive to show this by example. We called a flying animal that gives milk and is hairy, scaly and slimy at the same time a leocorn and found out (first by using the tree manually and then also in the Predictions widget that the leocorn must be some kind of an insect).
Finally, we tell the students that, in a similar way to what we have been learning about animal groups, we could collect information about the ingredients of different dishes and try to predict whether a particular student will like or dislike the dish.
Or information about symptoms to try to diagnose diseases. Not only “could”, but actually do.