Lesson Rule based Decision Making - Artificial Intelligence - ثالث ثانوي

Lesson 3 Rule-based Decision Making

Rule-Based Systems

Knowledge Base

Expert systems

Table 2.5: Main advantages and disadvantages of rule-based systems

Lesson 3 Rule-based Decision Making

In this lesson, you will be introduced to

Iteration 1

Figure 2.8: Medical diagnosis by Rule-based AI System

Lesson 3 Rule-based Decision Making

This first rule-based system will follow a simple rule:

Lesson 3 Rule-based Decision Making

You can then test this function with three different patients:

Lesson 3 Rule-based Decision Making

Iteration 2

Lesson 3 Rule-based Decision Making

This version has no hard-coded IF statements.

Lesson 3 Rule-based Decision Making

Figure 2.11: Representation of the second iteration

Lesson 3 Rule-based Decision Making

Iteration 3

Lesson 3 Rule-based Decision Making

The threshold-based logic on the number of symptoms

Lesson 3 Rule-based Decision Making

For each possible disease included in the knowledge base,

Lesson 3 Rule-based Decision Making

Iteration 4

Lesson 3 Rule-based Decision Making

The final column includes the diagnosis made by the human expert.

Lesson 3 Rule-based Decision Making

You now have 1,400 data points that will be used for training the

Lesson 3 Rule-based Decision Making

The plot_tree() function is used to visualize a decision tree.

Lesson 3 Rule-based Decision Making

You will now use this decision tree to predict the most likely diagnosis for the patients in the testing set.

Lesson 3 Rule-based Decision Making

Figure 2.14: Confusion matrix of predicted and actual cases

Lesson 3 Rule-based Decision Making

What are some advantages and disadvantages of rule-based systems?

What is an advantage and a disadvantage of the first iteration?

Add a patient to your code in the first iteration of the rule-based

Lesson 3 Rule-based Decision Making

In the second iteration, how many diseases does each patient's

In the third iteration, change both weights to 1 for patients 1 and 2,

Describe briefly how each iteration is enhanced from the previous one (first to second, second to third, third to fourth).