# Case-based reasoning

Artificial Intelligence[1]

In case-based reasoning, the cognitive agent addresses new problems by tweaking solutions to existing problems.

Case-based reasoning (CBR), broadly construed, is the process of solving new problems based on the solutions of similar past problems. An auto mechanic who fixes an engine by recalling another car that exhibited similar symptoms is using case-based reasoning.[2]

The problem we are trying to solve here is what happens when you are confronted with a new situation and you don't have a good past-case to solve the new problem.

## The basic process

Process Description
Retrieval Retrieve a case from memory similar to the current problem
Adaptation Adapt the solution to that case to fit the current problem
Storage Storing the problem and solution as a case

## Assumptions

Assumptions of case-based reasoning are:

1. there are patterns to problems in the world (the same type of problem repeats again and again)
2. similar problems have similar solutions (not always but mostly)

When we solve a new problem, we are remembering a problem and slightly modifying (adapting it) to solve our new problem.

### Using models for case-based reasoning

We can use models (or previous patterns) of a problem to solve a new problem.

### Using recursive reasoning

In this approach, I break my problem in to parts. I first find a solution to MOST of my problem. I then go back into memory and look for a solution which most closely matches the other part of my problem. I might do this again and again.

### UseApply knowledge or rules to put theory into practice. case-based reasoning by rules

The key point here is use heuristics. A heuristic is a rule of thumb that works often but not always.

## Evaluation

We imagine a candidate solution has emerged from our efforts to solve a new problem. We now must test if this candidate solution works. How do we do this? Simulation can be an effective way of testing (evaluating a solution). The key point here is we must test if a candidate solution solves a problem.

## Case Storage

Once we have a solution, we store it in memory as a solution to a problem. This is a key point as AI agent is constantly assimilating and storing cases.

We only store new or interesting cases, and we also store failures.

### Case storage by index

An index is like a table. We can also imagine an index as being a tag-based method of indexing aspects of a solution or problem. Indexical structure of problems allow us to then look for similar problems.

### Case storage by discrimination

We build a tree in which each root is a question and each leaf is an answer. This image is used with gratitude from Udacity.