fuzzy expert system a simple tutorial by paco, wong pak kan

28
Fuzzy Expert System A Simple Tutorial By Paco, WONG Pak Kan

Upload: karen-caitlin-barker

Post on 17-Jan-2016

228 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Fuzzy Expert System A Simple Tutorial By Paco, WONG Pak Kan

Fuzzy Expert System

A Simple TutorialBy Paco, WONG Pak Kan

Page 2: Fuzzy Expert System A Simple Tutorial By Paco, WONG Pak Kan

2

Outline

• Overview of the fuzzy expert system shell• Installation guide

Page 3: Fuzzy Expert System A Simple Tutorial By Paco, WONG Pak Kan

3

FUZZY EXPERT SYSTEM SHELL

Page 4: Fuzzy Expert System A Simple Tutorial By Paco, WONG Pak Kan

4

Installati on ( Re a d t h e Re a d m e fi l e )

1. Install JRE x86 http://www.oracle.com/technetwork/java/javase/downloads/jre7-downloads-1880261.html

2. Download and unzip the zip file3. Run xampp/setup_xampp.bat4. Run xampp/xampp_start.exe5. Access http://localhost/system6. Login as Tester:Tester7. To stop the system, run xampp/xampp_stop.exe

Page 5: Fuzzy Expert System A Simple Tutorial By Paco, WONG Pak Kan

5

System Overview

PHP

Apache 2

MySQL

Modern Web Browser

(mainly Chrome and Firefox)

Java

Knowledge Base (XML files in folders)

For multiple user management

Provide UI page + Interaction with Java

Main Fuzzy Inference Engine

Storing the Fuzzy sets, Objects and

Rules

User Interface

Page 6: Fuzzy Expert System A Simple Tutorial By Paco, WONG Pak Kan

6

Main Screen

Page 7: Fuzzy Expert System A Simple Tutorial By Paco, WONG Pak Kan

7

Create a New Project

Project Name

CMSC5707

Page 8: Fuzzy Expert System A Simple Tutorial By Paco, WONG Pak Kan

8

Open Project

Then select your new project.Click on the name, NOT the cross X

CMSC5707

Page 9: Fuzzy Expert System A Simple Tutorial By Paco, WONG Pak Kan

9

Overview of Knowledge Base

ObjectsName

Type

Ask-first Flag

Prompt

Expected limits

...

Rules

name

antecedent part

weight

threshold

consequent part

certainty factorFuzzy Types

Definition

Fuzzy Classes

...

The implementation

Page 10: Fuzzy Expert System A Simple Tutorial By Paco, WONG Pak Kan

10

Fuzzy Type

Item Definition Example

Fuzzy Type Fuzzy concept definition windy

Fuzzy Class(3 classes)

Three basic terms to describe the fuzzy type which is defined in the fuzzy type definition strong, normal, weak

Fuzzy Term(in rules)

Term composing of fuzzy class and hedge to describe the fuzzy set

If the wind is very strong, rather slim

• A variable type• Define a fuzzy concept (e.g. windy)

Page 11: Fuzzy Expert System A Simple Tutorial By Paco, WONG Pak Kan

11

Fuzzy Type

Page 12: Fuzzy Expert System A Simple Tutorial By Paco, WONG Pak Kan

12

Fuzzy Type

Name of fuzzy type

Name of the 3 levels

Membership functions of the 3 levels

Use the default if you are lazy

Page 13: Fuzzy Expert System A Simple Tutorial By Paco, WONG Pak Kan

Fuzzy Type

Visualization of the membership functions

Edit or Delete

Page 14: Fuzzy Expert System A Simple Tutorial By Paco, WONG Pak Kan

14

Objects

• Work like variable names• Various built-in types (e.g. numeric, single-valued), and also

the fuzzy type• Used in formulating rules

Page 15: Fuzzy Expert System A Simple Tutorial By Paco, WONG Pak Kan

15

Type of Objects

• Fuzzy Type: Object which can be described in fuzzy term• Logical Type: Object which is either TRUE (YES) or FALSE (NO)

– Availability of Wi-Fi service• Single Type: Object which can have one value chosen from a

list of choices – Gender: either male or female

• Multiple Type: Object which can have several values chosen from a list of choices – Hostel: YC Sunshine, B&B London…,

• Numeric Type: Numeric data – BMI: body mass index

Page 16: Fuzzy Expert System A Simple Tutorial By Paco, WONG Pak Kan

16

Feature of Objects

Item DescriptionObject Name The name of the object

Ask First YES/NO. If yes, the value of this object is inputted by the user. Otherwise, it is inferenced.

Prompt Prompt question

Type Variable type

Fuzzy Term Corresponding fuzzy term (if the type if fuzzy)

Page 17: Fuzzy Expert System A Simple Tutorial By Paco, WONG Pak Kan

17

Goal Object

Page 18: Fuzzy Expert System A Simple Tutorial By Paco, WONG Pak Kan

Rules

( RULE rule_name

IF ( antecedent_part )THEN consequent_part

) CERTAINTY IS certainty_factor

( RULE R_wind_temp1 IF ((temperature >25) AND (wind is strong))THEN weather is bad

) CERTAINTY is about 0.85

strongnormalslim

deepshallowzero

Any unique name easy to remember for you– but no space or system keyword

Page 19: Fuzzy Expert System A Simple Tutorial By Paco, WONG Pak Kan

19

Rule

Page 20: Fuzzy Expert System A Simple Tutorial By Paco, WONG Pak Kan

20

Edit in XML It does not check your syntax.

Page 21: Fuzzy Expert System A Simple Tutorial By Paco, WONG Pak Kan

21

5 Rules

Page 22: Fuzzy Expert System A Simple Tutorial By Paco, WONG Pak Kan

22

Inference Structure

Temperature

Wind

Feel Feel

Try this:1. Temperature = hot, Wind = slim2. Temperature = cold, Wind = strong3. Temperature = regular, Wind = regular

Anything wrong?If yes, how to fix?

Page 23: Fuzzy Expert System A Simple Tutorial By Paco, WONG Pak Kan

Consultati on

Page 24: Fuzzy Expert System A Simple Tutorial By Paco, WONG Pak Kan

24

Backup

Download for backup

Page 25: Fuzzy Expert System A Simple Tutorial By Paco, WONG Pak Kan

25

Warnings and Suggesti ons

• Some features may not work in some browsers.• If you find bugs or have feature request

– Please report to me, and I will forward to the developers.– Your bug reports are greatly appreciated.

• Backup by downloading the XML files from time to time• If you mistakenly deleted your project (pressed the little red cross)

– The corresponding folder in knowledge_base is in fact NOT deleted so just copy it back

– Add back an entry to the database

• I will re-upload the system whenever a new and stable version is available (see the version number in the zip file).

Page 26: Fuzzy Expert System A Simple Tutorial By Paco, WONG Pak Kan

26

Restore an Old Project

Page 27: Fuzzy Expert System A Simple Tutorial By Paco, WONG Pak Kan

27

Restore an Old Project (cont.)

Page 28: Fuzzy Expert System A Simple Tutorial By Paco, WONG Pak Kan

28

Summary

• Expert system shell– System architecture– Installation