These are three abilities that make a system flexible. Learning lets it improve, planning lets it decide on a course of action, and understanding lets it deal with human language.
Types of Learning
Machine learning is the ability of a system to improve its performance on a task from experience, without being programmed for every case. In supervised learning, the system is given examples with the correct answers, called labels, and learns to predict the label of new examples. Classification predicts a category, such as spam or not spam, and regression predicts a number, such as a price. In unsupervised learning, there are no labels, and the system finds structure in the data, such as groups, which is called clustering. In reinforcement learning, an agent learns by trial and error, receiving rewards and penalties. Other forms are rote learning, which simply stores facts, learning by being told, learning from examples and learning by analogy.
Definition: Machine learning. The ability of a system to improve its performance on a task through experience, instead of being explicitly programmed for every situation.
Planning
Planning is the task of finding a sequence of actions that will take an agent from an initial state to a goal. A planning problem is stated by the initial state, the goal and the actions. Each action has preconditions, which must be true before it is done, and effects, which are the changes that it causes. In STRIPS, the classic planner, a state is a set of facts, and an action has a precondition list, an add list and a delete list. Forward planning searches from the initial state, and backward planning works back from the goal. Means-ends analysis finds the difference between the present state and the goal and picks an action that reduces it. A plan may be partial-order, leaving the order of independent steps open.
Understanding
Understanding here refers chiefly to natural language understanding, which is getting the meaning of text or speech. The stages are lexical analysis, of the words, syntactic analysis or parsing, of the grammar, semantic analysis, of the meaning, and pragmatic analysis, which uses context and the intent of the speaker. It is difficult because of ambiguity: the sentence "I saw the man with the telescope" has two readings. The system may use grammars, knowledge bases and, at present, large neural language models.
Table 4.1: Types of learning
| Type | Data | Example |
|---|---|---|
| Supervised | Labelled examples | Spam filter |
| Unsupervised | Unlabelled data | Customer clusters |
| Reinforcement | Rewards and penalties | Game-playing agent |
Example 4.1: A planning problem
Problem: A robot is in room A and a box is in room A. The goal is to have the box in room B. Actions: Move(x, y), with precondition robot at x and effect robot at y; Push(box, x, y), with precondition robot and box at x, and effect robot and box at y. Find the plan.
Solution:
- The goal needs the box at B, which is given by Push(box, A, B).
- Its precondition is that the robot and the box are both at A, which is already true.
Result: The plan has one action: Push(box, A, B).
state = {"robot": "A", "box": "A"}
def push(s, x, y):
assert s["robot"] == x and s["box"] == x
s["robot"], s["box"] = y, y
push(state, "A", "B")
print(state)
Output
{'robot': 'B', 'box': 'B'}
Common mistakes
- Using supervised learning when there are no labelled examples.
- Ignoring the preconditions of an action when making a plan.
- Believing that a system understands language because it matches words.
Key takeaways
- Learning may be supervised, unsupervised or reinforcement.
- A plan is a sequence of actions from the initial state to the goal.
- Actions have preconditions and effects.
- Natural language understanding has lexical, syntactic, semantic and pragmatic stages.
Practice questions
- What is supervised learning?
- What are the preconditions of an action?
- Name the stages of language understanding.
Answers to the practice questions
- Learning from examples that come with the correct answers.
- The conditions that must be true before the action can be done.
- Lexical, syntactic, semantic and pragmatic analysis.
Sources
- Official BCA syllabus Artificial Intelligence and Expert Systems, course code 25BCA405DS02, Unit IV
