apriori算法求频繁项集和关联规则 mvc架构 java版

  • q6_419012
    了解作者
  • 33.8KB
    文件大小
  • rar
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-06-09 04:45
    上传日期
完整代码Java版,mvc架构,优美的界面。置信度和关联规则一并解决
apriori.rar
  • apriori
  • .project
    383B
  • bin
  • apriori
  • FileOpr.class
    758B
  • MyApp.class
    2.2KB
  • MyApp$1.class
    662B
  • Output.class
    1.6KB
  • FastVector$FastVectorEnumeration.class
    1.3KB
  • GetSource.class
    2.4KB
  • FastVector.class
    4.1KB
  • Item.class
    388B
  • Copyable.class
    143B
  • Apriori.class
    8.3KB
  • Apriori.jar
    12.7KB
  • src
  • apriori
  • FileOpr.java
    418B
  • Output.java
    1.1KB
  • MyApp.java
    1KB
  • Item.java
    188B
  • GetSource.java
    2.4KB
  • Copyable.java
    1.2KB
  • Apriori.java
    9.7KB
  • FastVector.java
    10.3KB
  • .classpath
    232B
内容介绍
package apriori; //Container Interface /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* * FastVector.java * Copyright (C) 1999 Eibe Frank * */ import java.util.*; import java.io.*; /** * d Implements a fast vector class without synchronized methods. Replaces * java.util.Vector. (Synchronized methods tend to be slow.) * * @author Eibe Frank (eibe@cs.waikato.ac.nz) * @version $Revision: 1.7 $ */ public class FastVector implements Copyable, Serializable { private static final long serialVersionUID = 1L; /** * Class for enumerating the vector's elements. */ public class FastVectorEnumeration implements Enumeration { /** The counter. */ private int m_Counter; /** The vector. */ private FastVector m_Vector; /** Special element. Skipped during enumeration. */ private int m_SpecialElement; /** * Constructs an enumeration. * * @param vector * the vector which is to be enumerated */ public FastVectorEnumeration(FastVector vector) { m_Counter = 0; m_Vector = vector; m_SpecialElement = -1; } /** * Constructs an enumeration with a special element. The special element * is skipped during the enumeration. * * @param vector * the vector which is to be enumerated * @param special * the index of the special element */ public FastVectorEnumeration(FastVector vector, int special) { m_Vector = vector; m_SpecialElement = special; if (special == 0) { m_Counter = 1; } else { m_Counter = 0; } } /** * Tests if there are any more elements to enumerate. * * @return true if there are some elements left */ public final boolean hasMoreElements() { if (m_Counter < m_Vector.size()) { return true; } return false; } /** * Returns the next element. * * @return the next element to be enumerated */ public final Object nextElement() { Object result = m_Vector.elementAt(m_Counter); m_Counter++; if (m_Counter == m_SpecialElement) { m_Counter++; } return result; } } /** The array of objects. */ private Object[] m_Objects; /** The current size; */ private int m_Size; /** The capacity increment */ private int m_CapacityIncrement; /** The capacity multiplier. */ private double m_CapacityMultiplier; /** * Constructs an empty vector with initial capacity zero. */ public FastVector() { m_Objects = new Object[0]; m_Size = 0; m_CapacityIncrement = 1; m_CapacityMultiplier = 2; } /** * Constructs a vector with the given capacity. * * @param capacity * the vector's initial capacity */ public FastVector(int capacity) { m_Objects = new Object[capacity]; m_Size = 0; m_CapacityIncrement = 1; m_CapacityMultiplier = 2; } /** * Constructs a vector with the given capacity, capacity increment and * capacity mulitplier. * * @param capacity * the vector's initial capacity */ public FastVector(int capacity, int capIncrement, double capMultiplier) { m_Objects = new Object[capacity]; m_Size = 0; m_CapacityIncrement = capIncrement; m_CapacityMultiplier = capMultiplier; } /** * Adds an element to this vector. Increases its capacity if its not large * enough. * * @param element * the element to add */ public final void addElement(Object element) { Object[] newObjects; if (m_Size == m_Objects.length) { newObjects = new Object[(int) m_CapacityMultiplier * (m_Objects.length + m_CapacityIncrement)]; System.arraycopy(m_Objects, 0, newObjects, 0, m_Size); m_Objects = newObjects; } m_Objects[m_Size] = element; m_Size++; } /** * Returns the capacity of the vector. * * @return the capacity of the vector */ public final int capacity() { return m_Objects.length; } /** * Produces a shallow copy of this vector. * * @return the new vector */ public final Object copy() { FastVector copy = new FastVector(m_Objects.length, m_CapacityIncrement, m_CapacityMultiplier); copy.m_Size = m_Size; System.arraycopy(m_Objects, 0, copy.m_Objects, 0, m_Size); return copy; } /** * Clones the vector and shallow copies all its elements. The elements have * to implement the Copyable interface. * * @return the new vector */ public final Object copyElements() { FastVector copy = new FastVector(m_Objects.length, m_CapacityIncrement, m_CapacityMultiplier); copy.m_Size = m_Size; for (int i = 0; i < m_Size; i++) { copy.m_Objects[i] = ((Copyable) m_Objects[i]).copy(); } return copy; } /** * Returns the element at the given position. * * @param index * the element's index * @return the element with the given index */ public final Object elementAt(int index) { return m_Objects[index]; } /** * Returns an enumeration of this vector. * * @return an enumeration of this vector */ public final Enumeration elements() { return new FastVectorEnumeration(this); } /** * Returns an enumeration of this vector, skipping the element with the * given index. * * @param index * the element to skip * @return an enumeration of this vector */ public final Enumeration elements(int index) { return new FastVectorEnumeration(this, index); } /** * Returns the first element of the vector. * * @return the first element of the vector */ public final Object firstElement() { return m_Objects[0]; } /** * Searches for the first occurence of the given argument, testing for * equality using the equals method. * * @param element * the element to be found * @return the index of the first occurrence of the argument in this vector; * returns -1 if the object is not found */ public final int indexOf(Object element) { for (int i = 0; i < m_Size; i++) { if (element.equals(m_Objects[i])) { return i; } } return -1; } /** * Inserts an element at the given position. * * @param element * the element to be inserted * @param index * the element's index */ public final void insertElementAt(Object element, int index) { Object[] newObjects; if (m_Size < m_Objects.length) { System.arraycopy(m_Objects, index, m_Objects, index + 1, m_Size - index); m_Objects[index] = element; } else { newObjects = new Object[(int) m_CapacityMultiplier * (m_Objects.length + m_CapacityIncrement)]; System.arraycopy(m_Objects, 0, newObjects, 0, index); newObjects[index] = element; System.arraycopy(m_Objects, index, newObjects, index + 1, m_Size - index); m_Objects = newObjects; } m_Size++; } /** * Returns the last element of the vector. * * @return the last element of the vector */ public final Object lastElement() { return m_Objects[m_Size - 1]; } /** * Deletes an element from this vector. * * @param
评论
    相关推荐
    • MVC架构模式详解
      通过一个动态计算单元格高度的工程代码,教你快速理解MVC架构模式,正确理解MVC结构模式
    • PureMVC架构
      一个自己学习PureMVC后做的ppt。 这个图应该对pureMVC架构做了一个很直白的描述。 希望对大家有所帮助。
    • MVC架构网站
      此项目使用VS2012编写运行 MVC架构 界面采用EXT类库实现之 js递归调用后台大量数据 代码编写经典 注释说明详细
    • pureMVC架构详细讲解
      公司内部培训文档,关于pureMVC架构的详细讲解,对于软件架构设计有一定指导意义。
    • flex_mvc架构
      flex mvc例子源码,非常不错,简单易懂。易于扩展。
    • MVC架构学士实例
      学习MVC架构的实例代码,有兴趣的朋友大家可以一起研究研究
    • JAVAEE MVC架构
      希望这个项目可以帮到大家,也很感谢这个平台能够给我们彼此互相学习,互相交流的机会!!!
    • MVC架构模板
      MVC架构模板,分层模板,包含数据库操作类
    • mvc架构网店jsp
      jsp mvc架构jsp mvc架构jsp mvc架构jsp mvc架构jsp mvc架构jsp mvc架构jsp mvc架构jsp mvc架构jsp mvc架构jsp mvc架构jsp mvc架构
    • MVC架构demo
      MVC架构demo