Ex: 2 Association Analysis 17/7/2012 AIM: J.Yamuna 10i454 1

You might also like

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 3

Ex: 2 ASSOCIATION ANALYSIS

17/7/2012
AIM
To perform association analysis using Apriori Algorithm.
ALGORITHM
1) Getting the input from the user.
2) Forming bit-matrix from the received data.
) Find occurrence of single element.
!) Find the occurrence of associated elements and display the result.
CODE
"##
# $author 1%i!&!
#"
import 'ava.io.(ata)nput*tream+
import 'ava.io.),-xception+
public class apriori
.
public static void main/*tring ar01) thro2s ),-xception
.
int matrix01013..%4%4%4%4%54.%4%4%4%4%54.%4%4%4%4%54.%4%4%4%4%54.%4%4%4%4%54.%4%4%4%4%55 +
int match013.%4%4%4%4%4%5+
int i4'4a4b4 input4 n3+
int count013.%4%4%4%4%5+
(ata)nput*tream din3ne2 (ata)nput*tream/*ystem.in)+
*ystem.out.println/6-nter the numbers7 6)+
for/i31+i83n+i99)
.
for/'31+'83n+'99)
.
input3)nteger.parse)nt/din.read:ine/))+
matrix0i10input131+
5
5
*ystem.out.println/6###;it matrix###6)+
for/i31+i83n+i99)
.
for/'31+'83n+'99)
J.Yamuna
10i454
1
.
*ystem.out.print/matrix0i10'196<t6)+
5
*ystem.out.println/6<n6)+
5
for/i31+i83n+i99)
.
for/'31+'83n+'99)
.
if/matrix0'10i1331)
.
count0i199+
5
5
5
*ystem.out.println/6,ccurances---==6)+
*ystem.out.println/61<t2<t6)+
for/i31+i83n+i99)
.
*ystem.out.print/count0i199)+
*ystem.out.print/6<t6)+
5
*ystem.out.println/6<n-------------------6)+
for/i31+i83n+i99)
.
b31+
for/'31+'83n+'99)
.

for/a3'91+a83n+a99)
.
if/matrix0i10'1331 >> matrix0i10a1331)
.
match0b199+
5
b99+

if/i33n >> a33n)
.
a99+
J.Yamuna
10i454
2
5
5
5
5
*ystem.out.println/61 2 <t 1 <t 2 6)+
for/i31+i83n+i99)
.
*ystem.out.print/6 69match0i196<t6)+
5
5
5
OUTPUT
RESULT
Thus Association analysis 2as performed using Apriori algorithm.
J.Yamuna
10i454
3

You might also like