C语言实现的Apriori关联规则算法
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Collections;
namespace Apriori
{
//事务
struct trans
{
public string tID;
public ArrayList items;
}
//项集和支持度计数
struct itemAndSup
{
public ArrayList items;
public int sup;
}
public partial class Form1 : Form
{
private ArrayList tData = new ArrayList(); //事务数据
private int minSup = 2; //最小支持度计数阀值
private ArrayList C0 = new ArrayList(); //L的超集
private ArrayList L0 = new ArrayList(); //频繁k项集
- 1
- 2
前往页