Imports System.Data Imports System.Data.SqlClient Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim i As Integer Dim minsup = 20 Dim minconfid = 40 Dim mycon As SqlConnection Dim mycommand As SqlCommand Dim dr As SqlDataReader Dim da As New SqlDataAdapter Dim q(50) As Integer Dim q1(50), bn(50), bn1(50) As Integer mycon = New SqlConnection("Data Source=CSESAP04\SQLEXPRESS;Initial Catalog=novel;Integrated Security=True") mycon.Open() mycommand = New SqlCommand("select * from apriori", mycon) ' dr = mycommand.ExecuteReader Dim itemcount As Integer = 9 'for item count.... For i = 1 To itemcount cal1(i) Next Dim j, h, n As Integer Dim m(8) As Integer Dim totrans As Integer = 15 'for single item support For j = 0 To ListBox1.Items.Count - 1 h = (ListBox1.Items(j) / totrans) * 100 m(j) = h Next For i = 0 To m.Length - 1 If m(i) > minsup Then ListBox2.Items.Add(i + 1) End If Next 'for 2 candidate generation Dim v, firstvar, nextvar As Integer Dim w As Integer Dim h1(50) As Integer For v = 0 To ListBox2.Items.Count - 1 For w = 0 To ListBox2.Items.Count - 1 firstvar = ListBox2.Items(v) nextvar = ListBox2.Items(w) ListBox3.Items.Add(firstvar & " ," & nextvar) cndsup(firstvar, nextvar) 'q(v) = firstvar 'q1(w) = nextvar 'ListBox3.Items.Add(q(v) & "," & q1(w)) Next Next Dim c, t, k, g(100) As Integer For c = 0 To ListBox4.Items.Count - 1 k = (ListBox4.Items(c) / totrans) * 100 g(c) = k Next For t = 0 To g.Length - 1 If g(t) > minsup Then 'MessageBox.Show("pos is" & t) ListBox5.Items.Add(ListBox3.Items(t)) 'tcand(t) End If Next 'MessageBox.Show("count is" & ListBox7.Items.Count) 'for 3 itemset generation Dim kf As Integer Dim kf1(1000) As Integer For kf = 0 To ListBox7.Items.Count - 1 n = (ListBox7.Items(kf) / totrans) * 100 kf1(kf) = n Next For t = 0 To kf1.Length - 1 If kf1(t) > minsup Then 'MessageBox.Show("pos is" & t) ListBox8.Items.Add(ListBox6.Items(t)) 'tcand(t) End If Next End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)