Orientation, Vocabulary, Examples
I. Artificial Intelligence
The modern development of artificial intelligence—aspects of intelligence as exhibited by a machine, program, or algorithm—has been around since the mid-1900s, and was around long before that in various philosophical and literary forms.
Alan Turing (1912-1954), the noted British computer scientist, did much formal development of artificial intelligence theory during his brief life. He also proposed "the Imitation Game"—the name also of a 2014 film biography of Turing starring Benedict Cumberbatch)—which offers one possible diagnostic for recognizing artificial intelligence. In this game, an interviewer is placed in a room and given the means to exchange messages with two isolated subjects, one of them a human and one of them a machine. If the interviewer, conversing via messages, is unable to identify which subject is the human and which one is the machine, then we can say that the machine exhibits artificial intelligence.
The Imitation Game has since come to be known as "the Turing Test."
For a deep dive into another notable Turing accomplishment check out the Turing Machine, with a nice explanation at Computerphile [YouTube].
Alan Turing was hugely influential in the development of computer science, artificial intelligence, and cryptography. He was also homosexual, a crime under British law at the time, and when he was prosecuted in 1952, he was given the option of drug-induced "chemical castration" as an alternative to going to prison. He committed suicide in 1954.
II. Machine Learning
Machine learning is a subfield of AI that is specifically interested in pattern recognition and learning from data. Specifically, a piece of software called a model is trained with data so that we can make predictions using that data.
Two different ways to program
Writing a program to perform machine learning is fundamentally different from the standard computer programming.
To calculate a student's Pass/Not Pass grade for a class, for example, a classical programming strategy might use a series of if-else
conditional statements based on work performed, assessments completed, daily attendance, class participation, "citizenship," etc.
A machine-learning approach, however, would take the teacher's past records of data, including what grade each student had been given, and develop a mathematical relationship between the various bits of data and the grade. Knowing those mathematical relationships would allow one to determine the grade.
III. Types of Machine Learning
There are a variety of machine learning strategies that one can employ, depending on the nature of the problem one is trying to solve.
A. Supervised learning
In supervised learning, the data used to train the algorithm has the expected result or outcome included with it.
Using our student-grading example, if you think of the data as being entries in a spreadsheet:
- "Example" = one row in the spreadsheet with a given set of student data
- "Features" = the cells in that row that describe the work performed, assessments completed, daily attendance, etc.
- "Label" = the target output: did the student pass or not?
The relationship that we're trying to understand—the model that we're trying to develop—will be one of two types.
1. Regression model
A regression model predicts a numeric value in a continuous range.
Example: How long will my commute to work take? Input data might include historical traffic conditions, distance from work, weather conditions, the day of week....
2. Classification model
A classification model predicts likelihood that something belongs to a given category. Example: Is this picture a cat or a dog? Is this email spam or not? Is this thing in the ocean fish or junk? Is this a penny, a nickel, a dime, or a quarter?
Classification can be binary (only two choices) or multiclass (multiple possibilities).
Labeling data for binary classification
Go to Is this a fish? and follow the tutorial to see how labeled data trains an algorithm.
Did the algorithm make any mistakes after you'd trained it? Did you experiment with mislabeling the data to skew the algorithm?
B. Unsupervised learning
In unsupervised learning, unlabeled data is presented to the algorithm to identify patterns that can be used to discriminate data. One common model uses "clustering" to group data points.
C. Reinforcement Learning
Reinforcement learning takes predictions made by the algorithm and then rewards or penalizes the algorithm based on the results of predictions. The reinforcement system generates a policy that defines optimal strategy for getting most rewards. Example: robots walking in a room, computer playing Go.
IV. Training and Testing a Model
For the purposes of this unit, we'll be focusing on supervised machine learning: we'll be providing data sets and labels to our algorithms, and asking them to learn to classify things based on those examples.
We'll be doing some fairly intensive coding in the next few lessons. For now, let's just use a machine learning library (Tensorflow) running in a web interface to become familiar with the concepts of training and testing.
Teachable Machine
Let's try a more sophisticated example of giving labeled data to an algorithm using our own data.
- Go to Teachable Machine and use your webcam and a series of objects (or your microphone and a series of sounds?) to see how labeled data trains an algorithm. You might consider using a binary classifier with two different categories of data, or a multiclass classifier with different types of coins, or different types of playing cards, or different colors.
- More data is better! If you show the algorithm the Queen of Hearts and the 8 of Spades, are you asking it to distinguish the color of the card? the suit of the card? face cards versus numeric cards? or the rank (ie value, A, 2, 3, ... J, Q, K) of the card? You'll need to label your data and give it lots of examples to learn from.
- After training, you'll test your algorithm, and the website will display confidence values as a percent. Is this a regression model or a classification model?
- Try exporting the data to a Tensorflow file. What does that file look like? Does it have your data encoded in it? Do you recognize any of the commands in there?
Homework
Watch Computer Scientist Explains Machine Learning in 5 Levels of Difficulty. [YouTube, 26 min]