• Tidak ada hasil yang ditemukan

Rule Generation from DIS in SQL (No.1)

N/A
N/A
Protected

Academic year: 2024

Membagikan "Rule Generation from DIS in SQL (No.1)"

Copied!
6
0
0

Teks penuh

(1)

August 2016

Rule Generation from DIS in SQL (No.1)

A Case: Lenses data set in UCI Machine Learning Repository (Experiment environment: Windows note PC 2.8GHz)

Lichman, M. (2013). UCI Machine Learning Repository [http://archive.ics.uci.edu/ml]. Irvine, CA: University of California, School of Information and Computer Science.

(1) Lenses data set consists of the following.

24 objects, 4 attributes

1. age of the patient: (1) young, (2) pre-presbyopic, (3) presbyopic 2. spectacle prescription: (1) myope, (2) hypermetrope

3. astigmatic: (1) no, (2) yes

4. tear production rate: (1) reduced, (2) normal 1 decision attribute

1. hard contact lenses: 4 2. soft contact lenses: 5

3. no contact lenses: 15

(2) CSV format: Table 1 in dis(lense2_test) We store the table in

the following at first.

(2)

(3) Translation procedure: lense_rdf

By using lense_rdf procedure, we generate a file in the rdf format.

(4) RDF format: rdf

The following is the file in the rdf format

(3)

(5) Rule generation by Apriori in SQL

The procedure Apriori in SQL generates rules defined by support>=ALPHA and accuracy>=BETA in the following.

Step 1: con_{1}=>decision

Step 2: con_{1}&con_{2}=>decision

Step 3: con_{1}&con_{2}&con_{3}=>decision

In the following apri(‘class’,12,0.1,1.0), we specified that the decision attribute is ‘class’, 24 objects, support>=0.1, and accuracy>=1.0. Then, 11 new files are generated, and rules in Step 1 are stored in rule1, rules in Step 2 are stored in rule2, rules in Step 3 are stored in rule3.

(4)

(6) Obtained rules

We obtained one implication in Step 1 and two implications in Step 3.

(7) Rule generation in Prolog: lense0110.rs

We have implemented a software tool named RNIA in Prolog. Here, we show the results by RNIA in Prolog is equal to Apriori in SQL. The following is the execution log in Prolog.

(5)

The following is the obtained rules by RNIA in Prolog. The lower system and the upper system generate the same rules, because there is no non-deterministic information.

File = [lense0110|rs] Support= 0.1, Accuracy = 1.0

#### 1st STEP ############################################################

===== Lower System ==========================================

[24] [tear,1] ==> [class,3] (0.5, 1.0) Objects: [1,3,5,7,9,11,13,15,17,19,21,23]

The Rest Candidates:

[[[1,1],[5,3]],[[1,2],[5,3]],[[1,3],[5,3]],[[2,1],[5,1]],[[2,1],[5,3]],[[2,2],[5,2]],[[2,2],[5,3]],[[3,1],[5,2]], [[3,1],[5,3]],[[3,2],[5,1]],[[3,2],[5,3]],[[4,2],[5,1]],[[4,2],[5,2]],[[4,2],[5,3]]]

(Next Candidates are Remained)

===== Upper System ==========================================

[24] [tear,1] ==> [class,3] (0.5, 1.0) Objects: [1,3,5,7,9,11,13,15,17,19,21,23]

The Rest Candidates:

[[[1,1],[5,3]],[[1,2],[5,3]],[[1,3],[5,3]],[[2,1],[5,1]],[[2,1],[5,3]],[[2,2],[5,2]],[[2,2],[5,3]],[[3,1],[5,2]], [[3,1],[5,3]],[[3,2],[5,1]],[[3,2],[5,3]],[[4,2],[5,1]],[[4,2],[5,2]],[[4,2],[5,3]]]

(Next Candidates are Remained) EXEC_TIME = 0.0 (sec)

#### 2nd STEP ##########################################################

===== Lower System ==========================================

The Rest Candidates:

[[[1,2],[2,2],[5,3]],[[1,2],[3,2],[5,3]],[[1,3],[2,1],[5,3]],[[1,3],[2,2],[5,3]],[[1,3],[3,1],[5,3]],[[1,3],[3, 2],[5,3]],[[2,1],[3,1],[5,3]],[[2,1],[3,2],[5,1]],[[2,1],[3,2],[5,3]],[[2,1],[4,2],[5,1]],[[2,2],[3,1],[5,2]],[[

2,2],[3,1],[5,3]],[[2,2],[3,2],[5,3]],[[2,2],[4,2],[5,2]],[[3,1],[4,2],[5,2]],[[3,2],[4,2],[5,1]]]

(Next Candidates are Remained)

===== Upper System ==========================================

The Rest Candidates:

[[[1,2],[2,2],[5,3]],[[1,2],[3,2],[5,3]],[[1,3],[2,1],[5,3]],[[1,3],[2,2],[5,3]],[[1,3],[3,1],[5,3]],[[1,3],[3, 2],[5,3]],[[2,1],[3,1],[5,3]],[[2,1],[3,2],[5,1]],[[2,1],[3,2],[5,3]],[[2,1],[4,2],[5,1]],[[2,2],[3,1],[5,2]],[[

2,2],[3,1],[5,3]],[[2,2],[3,2],[5,3]],[[2,2],[4,2],[5,2]],[[3,1],[4,2],[5,2]],[[3,2],[4,2],[5,1]]]

(Next Candidates are Remained) EXEC_TIME = 0.0 (sec)

(6)

#### 3rd STEP ############################################################

===== Lower System ==========================================

[13] [spec,2]&[asti,1]&[tear,2] ==> [class,2] (0.125, 1.0) Objects: [6,14,22]

[18] [spec,1]&[asti,2]&[tear,2] ==> [class,1] (0.125, 1.0) Objects: [4,12,20]

The Rest Candidates: []

(Lower System Terminated)

===== Upper System ==========================================

[13] [spec,2]&[asti,1]&[tear,2] ==> [class,2] (0.125, 1.0) Objects: [6,14,22]

[18] [spec,1]&[asti,2]&[tear,2] ==> [class,1] (0.125, 1.0) Objects: [4,12,20]

The Rest Candidates: []

(Upper System Terminated) EXEC_TIME = 0.0 (sec)

(8) Comments

Even though Lenses data set is small, the procedure apri in SQL and the program in prolog is uniformly applicable any data set. We have obtained the same results. We think the both programs in SQL and Prolog are simulating the Apriori process correctly.

Referensi

Dokumen terkait