亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? apriori.java

?? 數據挖掘associations算法
?? JAVA
?? 第 1 頁 / 共 3 頁
字號:
/* *    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. *//* *    Apriori.java *    Copyright (C) 1999 Eibe Frank,Mark Hall * */package weka.associations;import java.io.*;import java.util.*;import weka.core.*;import weka.filters.Filter;import weka.filters.AttributeFilter;/** * Class implementing an Apriori-type algorithm. Iteratively reduces the minimum * support until it finds the required number of rules with the given minimum  * confidence. <p> * * Reference: R. Agrawal, R. Srikant (1994). <i>Fast algorithms for * mining association rules in large databases </i>. Proc * International Conference on Very Large Databases, * pp. 478-499. Santiage, Chile: Morgan Kaufmann, Los Altos, CA. <p> * * Valid options are:<p> *    * -N required number of rules <br> * The required number of rules (default: 10). <p> * * -T type of metric by which to sort rules <br> * 0 = confidence | 1 = lift | 2 = leverage | 3 = Conviction. <p> * * -C minimum confidence of a rule <br> * The minimum confidence of a rule (default: 0.9). <p> * * -D delta for minimum support <br> * The delta by which the minimum support is decreased in * each iteration (default: 0.05). <p> * * -U upper bound for minimum support <br> * The upper bound for minimum support. Don't explicitly look for  * rules with more than this level of support. <p> * * -M lower bound for minimum support <br> * The lower bound for the minimum support (default = 0.1). <p> * * -S significance level <br> * If used, rules are tested for significance at * the given level. Slower (default = no significance testing). <p> * * -R <br> * If set then columns that contain all missing values are removed from * the data. * * -I <br> * If set the itemsets found are also output (default = no). <p> * * @author Eibe Frank (eibe@cs.waikato.ac.nz) * @author Mark Hall (mhall@cs.waikato.ac.nz) * @version $Revision: 1.11 $ */public class Apriori extends Associator implements OptionHandler {    /** The minimum support. */  protected double m_minSupport;  /** The upper bound on the support */  protected double m_upperBoundMinSupport;  /** The lower bound for the minimum support. */  protected double m_lowerBoundMinSupport;  /** Metric types. */  protected static final int CONFIDENCE = 0;  protected static final int LIFT = 1;  protected static final int LEVERAGE = 2;  protected static final int CONVICTION = 3;  public static final Tag [] TAGS_SELECTION = {    new Tag(CONFIDENCE, "Confidence"),    new Tag(LIFT, "Lift"),    new Tag(LEVERAGE, "Leverage"),    new Tag(CONVICTION, "Conviction")      };  /** The selected metric type. */  protected int m_metricType = CONFIDENCE;  /** The minimum metric score. */  protected double m_minMetric;  /** The maximum number of rules that are output. */  protected int m_numRules;  /** Delta by which m_minSupport is decreased in each iteration. */  protected double m_delta;  /** Significance level for optional significance test. */  protected double m_significanceLevel;  /** Number of cycles used before required number of rules was one. */  protected int m_cycles;  /** The set of all sets of itemsets L. */  protected FastVector m_Ls;  /** The same information stored in hash tables. */  protected FastVector m_hashtables;  /** The list of all generated rules. */  protected FastVector[] m_allTheRules;  /** The instances (transactions) to be used for generating       the association rules. */  protected Instances m_instances;  /** Output itemsets found? */  protected boolean m_outputItemSets;  protected boolean m_removeMissingCols;  /** Report progress iteratively */  protected boolean m_verbose;  /**   * Returns a string describing this associator   * @return a description of the evaluator suitable for   * displaying in the explorer/experimenter gui   */  public String globalInfo() {    return "Finds association rules.";  }  /**   * Constructor that allows to sets default values for the    * minimum confidence and the maximum number of rules   * the minimum confidence.   */  public Apriori() {    resetOptions();  }  /**   * Resets the options to the default values.   */  public void resetOptions() {        m_removeMissingCols = false;    m_verbose = false;    m_delta = 0.05;    m_minMetric = 0.90;    m_numRules = 10;    m_lowerBoundMinSupport = 0.1;    m_upperBoundMinSupport = 1.0;    m_significanceLevel = -1;    m_outputItemSets = false;  }  /**   * Removes columns that are all missing from the data   * @param instances the instances   * @return a new set of instances with all missing columns removed   */  private Instances removeMissingColumns(Instances instances)     throws Exception {    int numInstances = instances.numInstances();    StringBuffer deleteString = new StringBuffer();    int removeCount = 0;    boolean first = true;    int maxCount = 0;        for (int i=0;i<instances.numAttributes();i++) {      AttributeStats as = instances.attributeStats(i);      if (m_upperBoundMinSupport == 1.0 && maxCount != numInstances) {	// see if we can decrease this by looking for the most frequent value	int [] counts = as.nominalCounts;	if (counts[Utils.maxIndex(counts)] > maxCount) {	  maxCount = counts[Utils.maxIndex(counts)];	}      }      if (as.missingCount == numInstances) {	if (first) {	  deleteString.append((i+1));	  first = false;	} else {	  deleteString.append(","+(i+1));	}	removeCount++;      }    }    if (m_verbose) {      System.err.println("Removed : "+removeCount+" columns with all missing "			 +"values.");    }    if (m_upperBoundMinSupport == 1.0 && maxCount != numInstances) {      m_upperBoundMinSupport = (double)maxCount / (double)numInstances;      if (m_verbose) {	System.err.println("Setting upper bound min support to : "			   +m_upperBoundMinSupport);      }    }    if (deleteString.toString().length() > 0) {      AttributeFilter af = new AttributeFilter();      af.setAttributeIndices(deleteString.toString());      af.setInvertSelection(false);      af.setInputFormat(instances);      Instances newInst = Filter.useFilter(instances, af);      return newInst;    }    return instances;  }  /**   * Method that generates all large itemsets with a minimum support, and from   * these all association rules with a minimum confidence.   *   * @param instances the instances to be used for generating the associations   * @exception Exception if rules can't be built successfully   */  public void buildAssociations(Instances instances) throws Exception {    double[] confidences, supports;    int[] indices;    FastVector[] sortedRuleSet;    int necSupport=0;    if (instances.checkForStringAttributes()) {      throw new Exception("Can't handle string attributes!");    }    if (m_removeMissingCols) {      instances = removeMissingColumns(instances);    }    // Decrease minimum support until desired number of rules found.    m_cycles = 0;    m_minSupport = m_upperBoundMinSupport - m_delta;    m_minSupport = (m_minSupport < m_lowerBoundMinSupport)       ? m_lowerBoundMinSupport       : m_minSupport;    do {      // Reserve space for variables      m_Ls = new FastVector();      m_hashtables = new FastVector();      m_allTheRules = new FastVector[6];      m_allTheRules[0] = new FastVector();      m_allTheRules[1] = new FastVector();      m_allTheRules[2] = new FastVector();      if (m_metricType != CONFIDENCE || m_significanceLevel != -1) {	m_allTheRules[3] = new FastVector();	m_allTheRules[4] = new FastVector();	m_allTheRules[5] = new FastVector();      }      sortedRuleSet = new FastVector[6];      sortedRuleSet[0] = new FastVector();      sortedRuleSet[1] = new FastVector();      sortedRuleSet[2] = new FastVector();      if (m_metricType != CONFIDENCE || m_significanceLevel != -1) {	sortedRuleSet[3] = new FastVector();	sortedRuleSet[4] = new FastVector();	sortedRuleSet[5] = new FastVector();      }      // Find large itemsets and rules      findLargeItemSets(instances);      if (m_significanceLevel != -1 || m_metricType != CONFIDENCE) 	findRulesBruteForce();      else	findRulesQuickly();            // Sort rules according to their support      supports = new double[m_allTheRules[2].size()];      for (int i = 0; i < m_allTheRules[2].size(); i++) 	supports[i] = (double)((ItemSet)m_allTheRules[1].elementAt(i)).support();      indices = Utils.stableSort(supports);      for (int i = 0; i < m_allTheRules[2].size(); i++) {	sortedRuleSet[0].addElement(m_allTheRules[0].elementAt(indices[i]));	sortedRuleSet[1].addElement(m_allTheRules[1].elementAt(indices[i]));	sortedRuleSet[2].addElement(m_allTheRules[2].elementAt(indices[i]));	if (m_metricType != CONFIDENCE || m_significanceLevel != -1) {	  sortedRuleSet[3].addElement(m_allTheRules[3].elementAt(indices[i]));	  sortedRuleSet[4].addElement(m_allTheRules[4].elementAt(indices[i]));	  sortedRuleSet[5].addElement(m_allTheRules[5].elementAt(indices[i]));	}      }      // Sort rules according to their confidence      m_allTheRules[0].removeAllElements();      m_allTheRules[1].removeAllElements();      m_allTheRules[2].removeAllElements();      if (m_metricType != CONFIDENCE || m_significanceLevel != -1) {	m_allTheRules[3].removeAllElements();	m_allTheRules[4].removeAllElements();	m_allTheRules[5].removeAllElements();      }      confidences = new double[sortedRuleSet[2].size()];      int sortType = 2 + m_metricType;      for (int i = 0; i < sortedRuleSet[2].size(); i++) 	confidences[i] = 	  ((Double)sortedRuleSet[sortType].elementAt(i)).doubleValue();      indices = Utils.stableSort(confidences);      for (int i = sortedRuleSet[0].size() - 1; 	   (i >= (sortedRuleSet[0].size() - m_numRules)) && (i >= 0); i--) {	m_allTheRules[0].addElement(sortedRuleSet[0].elementAt(indices[i]));	m_allTheRules[1].addElement(sortedRuleSet[1].elementAt(indices[i]));	m_allTheRules[2].addElement(sortedRuleSet[2].elementAt(indices[i]));	if (m_metricType != CONFIDENCE || m_significanceLevel != -1) {	  m_allTheRules[3].addElement(sortedRuleSet[3].elementAt(indices[i]));	  m_allTheRules[4].addElement(sortedRuleSet[4].elementAt(indices[i]));	  m_allTheRules[5].addElement(sortedRuleSet[5].elementAt(indices[i]));

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久久久久久久美女| 亚洲色图视频网站| 色婷婷综合久久| 国产一区欧美日韩| 亚洲一区影音先锋| 中文字幕高清不卡| 精品久久久网站| 欧美电影一区二区三区| 不卡大黄网站免费看| 久久se这里有精品| 日韩福利视频网| 一区二区三区在线视频免费观看| 精品国产乱码久久久久久久| 欧美日韩亚洲高清一区二区| 97精品久久久久中文字幕| 国产麻豆精品视频| 精品一区二区三区视频 | 亚洲国产精品久久久久婷婷884| 国产清纯白嫩初高生在线观看91 | 26uuu国产一区二区三区| 欧美日韩综合色| 色综合久久88色综合天天| 国产精品91xxx| 久久精品99久久久| 日韩国产精品91| 亚洲成人一二三| 亚洲一区日韩精品中文字幕| 亚洲女女做受ⅹxx高潮| 国产精品久久久久aaaa樱花| 久久久久久麻豆| 2017欧美狠狠色| 精品国产成人系列| 精品少妇一区二区三区视频免付费 | 久久免费午夜影院| 欧美久久久一区| 欧美人牲a欧美精品| 色婷婷一区二区三区四区| 色综合久久久久综合体| 色综合av在线| 91国产视频在线观看| 色狠狠一区二区| 欧美性受xxxx| 欧美精品色综合| 欧美一区二区视频免费观看| 欧美精品精品一区| 日韩精品影音先锋| 久久久国产午夜精品| 欧美激情一区在线观看| 国产精品超碰97尤物18| 日韩理论电影院| 亚洲精品第1页| 午夜在线成人av| 免费成人深夜小野草| 九九视频精品免费| 国产成人亚洲综合a∨婷婷| 成人av网站在线| 欧洲视频一区二区| 欧美男生操女生| 久久久久久久久久久久久夜| 中文字幕中文字幕一区二区| 亚洲自拍欧美精品| 免费的成人av| 成人天堂资源www在线| 在线看不卡av| 日韩欧美中文字幕公布| 欧美国产在线观看| 亚洲黄色免费网站| 麻豆成人久久精品二区三区红| 国产一区二区三区精品视频| 97久久久精品综合88久久| 欧美日韩一区国产| 欧美精品一区二区精品网| 国产精品久久午夜| 婷婷开心久久网| 国产成人在线视频网址| 欧美在线不卡一区| 久久这里都是精品| 一区二区三区四区在线免费观看| 日韩二区在线观看| 成人精品视频一区二区三区 | 中文字幕精品综合| 亚洲3atv精品一区二区三区| 国产麻豆精品在线观看| 欧美日韩中文国产| 国产日韩欧美亚洲| 亚洲韩国精品一区| 国产69精品久久99不卡| 91麻豆精品国产无毒不卡在线观看| 欧美激情一区二区三区四区| 三级亚洲高清视频| 91丨国产丨九色丨pron| 日韩免费性生活视频播放| 亚洲乱码国产乱码精品精的特点 | 精品国产一区a| 一区二区三区在线视频观看| 国产资源在线一区| 欧美男女性生活在线直播观看| 国产精品国产三级国产a| 日本女优在线视频一区二区| 91亚洲精品乱码久久久久久蜜桃| 日韩欧美国产系列| 亚洲bt欧美bt精品777| 99re亚洲国产精品| 国产欧美一区二区精品秋霞影院| 日本最新不卡在线| 欧美日韩在线播放三区| 亚洲丝袜自拍清纯另类| 国产精品亚洲午夜一区二区三区 | 91在线观看下载| 久久美女艺术照精彩视频福利播放 | 欧美日韩亚洲高清一区二区| 日韩毛片一二三区| 岛国av在线一区| 精品处破学生在线二十三| 天天色天天爱天天射综合| 91视频观看视频| 国产欧美精品日韩区二区麻豆天美| 久久se精品一区精品二区| 欧美一级日韩一级| 天天综合天天综合色| 欧美日韩一区中文字幕| 亚洲精品国产一区二区三区四区在线| 国产91丝袜在线播放0| 久久久久久久久蜜桃| 国产在线视频不卡二| 久久综合一区二区| 久久精品999| 日韩欧美国产成人一区二区| 日韩成人一级片| 91精品国产免费久久综合| 亚洲一区二区三区中文字幕 | 亚洲国产精品国自产拍av| 国产精品自在欧美一区| 久久久久久久性| 国产激情偷乱视频一区二区三区 | 一区二区三区免费网站| 色国产综合视频| 亚洲综合区在线| 欧美日韩精品一区二区三区 | 精品噜噜噜噜久久久久久久久试看 | 久久久国产午夜精品| 国产成人精品一区二区三区四区 | 激情五月婷婷综合网| 精品国免费一区二区三区| 精彩视频一区二区| 亚洲精品一区二区三区福利| 国产乱国产乱300精品| 国产日产亚洲精品系列| 成人av第一页| 一区av在线播放| 欧美日韩大陆一区二区| 日本欧美一区二区三区乱码| 精品日韩一区二区| 成人一区二区在线观看| 亚洲激情av在线| 欧美久久久一区| 激情综合网av| 国产精品美女久久久久aⅴ国产馆 国产精品美女久久久久av爽李琼 国产精品美女久久久久高潮 | 一区二区三区日韩在线观看| 欧美午夜精品免费| 久久精品72免费观看| 国产精品乱码人人做人人爱 | 国产欧美日韩不卡| 一本一本大道香蕉久在线精品| 亚洲一区二区三区四区五区黄 | 久久综合九色综合久久久精品综合| 国产ts人妖一区二区| 亚洲一区二区三区中文字幕| 日韩视频在线观看一区二区| 成人午夜短视频| 午夜成人在线视频| 久久人人爽爽爽人久久久| 色香蕉成人二区免费| 免费在线观看视频一区| 国产精品―色哟哟| 91麻豆精品国产91久久久久| 成人性生交大合| 午夜电影一区二区| 国产精品黄色在线观看| 777a∨成人精品桃花网| 成人av电影在线网| 美国精品在线观看| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆| 91精品婷婷国产综合久久性色| 丁香婷婷综合网| 日日嗨av一区二区三区四区| 中文字幕色av一区二区三区| 欧美日韩成人综合| 99久久国产综合精品麻豆| 精品一区二区三区不卡| 亚洲国产一区二区视频| 亚洲国产精品国自产拍av| 91精品欧美久久久久久动漫| aaa欧美日韩| 国产福利一区二区三区视频在线| 一区二区三区加勒比av| 国产免费观看久久| 精品久久久久99| 6080午夜不卡| 色偷偷成人一区二区三区91|