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

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

?? aprioriall.java

?? 為了下東西 隨便發了個 datamining 的源代碼
?? JAVA
?? 第 1 頁 / 共 4 頁
字號:
   *
   * @param array input data
   * @param value for search
   * @return pos in array
   * @author Alexey Grinyuk
   */
  private int findInArray(int array[][], int value) {
    int start = 0;
    int end = array.length-1;
    int pos;

    if(end == -1) return -1;

    while(start + 1 < end) {
      pos = (end - start) / 2 + start;

      if(array[pos][0] < value) {
        start = pos + 1;
      } else if(array[pos][0] > value) {
        end = pos - 1;
      } else return pos;
    }

    if(array[start][0] == value) return start;
    if(array[end][0] == value) return end;
    return -1;
  }


  /**
   * Compare 2 integer arrays
   *
   * @param array1 input data
   * @param array2 input data
   * @param length number items for compare
   * @return array1 == array2
   * @author Alexey Grinyuk
   */
  private boolean arrayCompare(int array1[], int array2[], int length) {
    int i;
    for(i=0; i<length; i++) {
      if(array1[i] != array2[i]) return false;
    }
    return true;
  }


  /**
   * Global variable L[][]  And  TidTable[][] are parameters this recursive function
   */
  private void createAllLk() {
    int i, j, counter, numberOfAllChildren;

    int LLength = L.length;
    if(LLength < 2) return;
    int LWidth = L[0].length;

    int firstChild[] = new int[LLength];
    int lastChild[] = new int[LLength];
    int childSupp[];
    int toLargeChild[];
    int largeChildren[][];
    int largeChildSupp[];

    numberOfAllChildren = createFirstAndLastChildArrays(L, /*Out*/ firstChild, /*Out*/ lastChild);

    // Allocate memory...
    childSupp = new int[numberOfAllChildren];     // ...for Support of all children
    toLargeChild = new int[numberOfAllChildren];  // ...for associate table  (All Children -> Large Children)
    for(i=0; i<numberOfAllChildren; i++) { // Initialize memeory childLastCustomer
      //childSupp[i] = 0;
      toLargeChild[i] = -1;
    }

    TIDTable = calculateSupportAndBuildNewTIDTable(TIDTable, firstChild, lastChild, /*Out*/ childSupp);

    // Calculate number of large children and
    // build associate table (All Children -> Large Children)
    counter = 0;
    for(i=0; i<childSupp.length; i++)
      if(childSupp[i] >= m_minSuppInt) toLargeChild[i] = counter++;

    // Allocate memory...
    largeChildren = new int[counter][];  //...for array of large children
    largeChildSupp = new int[counter]; //...for supports of large children

    buildArrayOfLargeChildren(L, firstChild, lastChild, childSupp, /*Out*/ largeChildren, /*Out*/ largeChildSupp);

    // Mark little itemsets in TIDTable as removed
    for(i=0; i<TIDTable.length; i++) {
      if(TIDTable[i] != null)
        for(j=0; j<TIDTable[i].length; j++)
          TIDTable[i][j] = toLargeChild[ TIDTable[i][j] ];
    }

    // Add Lk to general result
    allLargeItemsets.add(largeChildren);
    allLargeItemsetsSupp.add(largeChildSupp);
    allTIDs.add(TIDTable);

    L = largeChildren;

    firstChild = null;
    lastChild = null;
    childSupp = null;
    toLargeChild = null;
    largeChildren = null;
    largeChildSupp = null;

    System.out.println("|L" + (LWidth + 1) + "| = " + L.length);
    if( m_maxItemSize == LWidth + 1 ) return;
    createAllLk(); // recursive call
  }


  /**
   * @param L large itemsets
   * @param firstChild array of first children
   * @param lastChild array of last children
   * @return number of all children
   * @author Alexey Grinyuk
   */
  private int createFirstAndLastChildArrays(int L[][], /*Out*/ int firstChild[], /*Out*/ int lastChild[]) {
    int i, j;
    int counter;
    int LLength = L.length;
    if(LLength < 2) return 0;
    int LWidth = L[0].length;

    for(i=0; i < LLength; i++) {
      firstChild[i] = -1;
      lastChild[i] = -1;
    }

    // Generate ordinal numbers for first and last child of each item L (firstChild and lastChild)
    counter = 0;
    for(i=0; i < LLength-1; i++) { // for each itemset in L (parent1)
      for(j=i+1; j < LLength; j++) { // for each itemset in L (parent2)
        if( arrayCompare(L[i], L[j], LWidth-1) ) { // if parent1 and parent2 can bear a child
          if(firstChild[i] == -1) firstChild[i] = counter; // first child of parent1
          lastChild[i] = counter; // last child of parent1
          counter++;
        } else break;
      }
    }

    return counter;
  }


  /**
   * @param TIDTable association table: Transaction ID -> large itemsets list
   * @param firstChild array of first children
   * @param lastChild array of last children
   * @param childSupp supports for all children
   * @return new TIDTable
   * @author Alexey Grinyuk
   */
  private int[][] calculateSupportAndBuildNewTIDTable(int TIDTable[][],
                                                      int firstChild[],
                                                      int lastChild[],
                                                      int childSupp[])
  {
    int i, TID, pos1, pos2;
    int parent1, parent2;
    int lastParent;
    int child;

    IntVector temp = new IntVector();
    int tempSize;
    int newTIDTable[][] = new int[TIDTable.length][];
    int newTIDTableCounter = 0;
    int rezult[][];
    int childLastCustomer[];

    // Allocate and initialize memory for last customers which increments child supp
    childLastCustomer = new int[childSupp.length];
    for(i=0; i<childLastCustomer.length; i++) childLastCustomer[i] = -1;

    for(TID=0; TID<TIDTable.length; TID++) {  // for each transaction in TIDTable
      if(TIDTable[TID] == null) continue;

      // for each itemset associated with transaction (for each parent1)
      for(pos1=0; pos1 < TIDTable[TID].length-1; pos1++) {
        parent1 = TIDTable[ TID ][ pos1 ];

        if( parent1 == -1 ) continue;
        if( firstChild[ parent1 ] == -1 ) continue;

        //  ordinal number (index in L[]) of last parent2
        lastParent = parent1 + (lastChild[ parent1 ] - firstChild[ parent1 ] + 1);

        // for each parent2
        for(pos2 = pos1+1; pos2 < TIDTable[TID].length && TIDTable[TID][pos2] <= lastParent; pos2++) {
          parent2 = TIDTable[ TID ][ pos2 ];

          if(parent2 != -1) {  // if cell of TIDTable[TID] not marked as removed
            // ordinal number (index in childSupp[]) of child that born parent1 and parent2:
            child = firstChild[ parent1 ] + (parent2 - parent1 - 1);
            if(childLastCustomer[child] != CustomerID[TID]) {
              childSupp[child]++;
              childLastCustomer[child] = CustomerID[TID];
            }
            temp.addElement(child); // build row of new TIDTable
          }
        }

      }
      tempSize = temp.size(); // number of itemsets assosiated with transaction
      if(tempSize > 0) {
        // allocate memory for new row of new TIDTable
        newTIDTable[TID] = new int[tempSize];
        for(i=0; i<tempSize; i++) newTIDTable[TID][i] = temp.IntegerAt(i);
        temp.clear();
      }
    }

    return newTIDTable;
  }


  /**
   * @param L large itemsets
   * @param firstChild array of first children
   * @param lastChild array of last children
   * @param childSupp support for all children
   * @param largeChildren array of large children
   * @param largeChildSupp support for large children
   * @author Alexey Grinyuk
   */
  private void buildArrayOfLargeChildren(int L[][],
                                         int firstChild[],
                                         int lastChild[],
                                         int childSupp[],
                                         int largeChildren[][],
                                         int largeChildSupp[])
  {
    int parent1, parent2;
    int child;
    int counter;

    int LLength = L.length;
    int LWidth = L[0].length;

    counter = 0;
    // for each itemset in L (for each parent1)
    for(parent1=0; parent1<LLength; parent1++) {
      // if this itemset have children
      if(firstChild[parent1] != -1) {
        // for all children of itemset
        for(child = firstChild[parent1]; child <= lastChild[parent1]; child++) {

          if(childSupp[child] >= m_minSuppInt) { // if itemset is large
            largeChildSupp[counter] = childSupp[child];
            largeChildren[counter] = new int[LWidth + 1];

            // get parent2 of child
            parent2 = parent1 + (child - firstChild[parent1] + 1);
            // create child itemset
            System.arraycopy(L[parent1], 0, largeChildren[counter], 0, LWidth);
            largeChildren[counter][LWidth] = L[parent2][LWidth - 1];

            counter++;
          }
        }
      }
    }
  }



  //               << By Victor Borichev>>

  private CustomTransSet convertMiningminingInputStream() throws MiningException {
    
    fireMiningEvent(new ReadingBeginMessage(getAlgorithmLevel()));
    
    CustomTransSet cts = new CustomTransSet();
    Hashtable customers = new Hashtable();

    int rows = 0;
    
    while(miningInputStream.next())
    {
      MiningVector vector = miningInputStream.read();
// +++++++++ Invalid vector => ignore:
      if (vector == null)
        continue;
// --------- Invalid vector, ignore.

      double custId = vector.getValue(customerId);
      double transPos = vector.getValue(transactionPosition);
      double itId = vector.getValue(itemId);

      // Missing value => ignore line:
      if ( Category.isMissingValue(custId) || Category.isMissingValue(transPos) || Category.isMissingValue(itId) )
        continue;

      Double value = new Double(custId); // customer id
      Hashtable sequence = (Hashtable)customers.get(value);  // its transactions
      if(sequence == null)
      {
        sequence = new Hashtable();
        customers.put(value,sequence);
      }
      Integer pos = new Integer((int)transPos);
      ItemSet transaction = (ItemSet)sequence.get(pos);
      if(transaction == null)
      {
        transaction = new ItemSet();
        sequence.put(pos,transaction);
      }
      int item = (int)itId;
      transaction.addItem(item);
      
      rows++;
    }
    Enumeration cids = customers.keys();
    while(cids.hasMoreElements()) {
      Double cid = (Double)cids.nextElement();
      Hashtable sequence = (Hashtable)customers.get(cid);
      int size = sequence.size();
      int[] poss = new int[size];
      ItemSet[] itemsets = new ItemSet[size];
      Enumeration em = sequence.keys();
      int i = 0;
      while(em.hasMoreElements()) {
        Integer pos = (Integer)em.nextElement();
        poss[i] = pos.intValue();
        itemsets[i++] = (ItemSet)sequence.get(pos);
      }
      // sorting transactions by position
      int j,min,element;
      for(i=0;i<size;i++)
      {
        min = poss[i]; element = -1;
        for(j=i+1;j<size;j++)
          if(poss[j]<min)
          {
            min = poss[j];
            element = j;
          }
        if(element!=-1)
        {
          int iswap = poss[i];
          poss[i] = poss[element];
          poss[element] = iswap;
          ItemSet oswap = itemsets[i];
          itemsets[i] = itemsets[element];
          itemsets[element] = oswap;
        }
      }
      TransactionSet ts = new TransactionSet();
      for(i=0;i<size;i++)
        ts.addTransaction(itemsets[i]);
      cts.addCustomerTransSet(ts);
    }

    fireMiningEvent(new ReadingEndMessage(rows, getAlgorithmLevel()));
    
    return cts;
  }

  /**
   * AprioriAll. If a customerId, transactionPosition, or itemId has
   * a missing value, the (customerId, transactionPosition, itemId)-tuple
   * is ignored.
   */
  public void runAlgorithm() throws MiningException
  {
    int i,j,k,l,m,n,q,w;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品国产免费视频| 日韩欧美一二三区| 国产精品1区2区| 青青草国产精品亚洲专区无| 国产精品国产三级国产普通话99| 欧美一区二区日韩一区二区| 97se亚洲国产综合自在线不卡| 九九在线精品视频| 亚洲不卡在线观看| 亚洲电影一级黄| 中文字幕亚洲不卡| 国产精品萝li| 国产精品三级视频| 国产亚洲婷婷免费| 欧美精品一区二区三区蜜桃 | 国产精品一二三四| 久久精品999| 国产精品资源在线观看| 国产一区二区三区免费观看| 麻豆精品一区二区三区| 奇米色一区二区| 久久99久久精品| 久久精品噜噜噜成人av农村| 久久se精品一区二区| 美脚の诱脚舐め脚责91| 国产美女娇喘av呻吟久久| 国产精品一区二区男女羞羞无遮挡| 青娱乐精品视频在线| 国产精品一区免费视频| caoporn国产精品| 欧美中文一区二区三区| 91精品国产91久久久久久一区二区| 欧美一区二区免费视频| 国产亚洲欧美日韩俺去了| 国产精品日日摸夜夜摸av| 亚洲一区欧美一区| 麻豆专区一区二区三区四区五区| 国产成+人+日韩+欧美+亚洲| 91免费观看在线| 日韩女优毛片在线| 亚洲日本中文字幕区| 天堂成人免费av电影一区| 国产伦精品一区二区三区视频青涩 | 久久久综合九色合综国产精品| 国产三级精品三级| 亚洲一区自拍偷拍| 国产综合久久久久久鬼色| 92精品国产成人观看免费| 欧美一级高清片在线观看| 亚洲欧美偷拍卡通变态| 久久99精品久久久久婷婷| 色哟哟一区二区三区| 久久综合九色综合欧美就去吻| 一区二区不卡在线视频 午夜欧美不卡在| 亚洲sss视频在线视频| 成人av手机在线观看| 精品国产一区二区三区久久影院| 亚洲素人一区二区| 成人久久久精品乱码一区二区三区| 欧日韩精品视频| 亚洲男帅同性gay1069| 国内国产精品久久| 日韩精品一区二区三区老鸭窝 | 玉足女爽爽91| 制服丝袜在线91| 亚洲综合av网| 日韩制服丝袜av| 国产91精品入口| 911国产精品| 亚洲电影一区二区| 懂色av一区二区三区免费看| 五月天久久比比资源色| 国产精品一品视频| 国产精品灌醉下药二区| 成人一区二区在线观看| 中文字幕在线免费不卡| 波多野结衣一区二区三区| 亚洲欧美日韩国产综合在线| 99re6这里只有精品视频在线观看| 国产精品麻豆欧美日韩ww| 99精品国产99久久久久久白柏| 国产精品久久福利| 在线一区二区视频| 久久av中文字幕片| 国产精品免费视频观看| 欧美日韩在线综合| 国产乱码精品一区二区三区av| 国产香蕉久久精品综合网| 成人国产精品免费观看| 亚洲精选在线视频| 日韩一区二区三区三四区视频在线观看| 美女视频一区在线观看| 国产日韩欧美高清| 欧美影片第一页| 久久er精品视频| 亚洲情趣在线观看| 欧美大片顶级少妇| 91视频在线看| 国产精品一区二区三区99| 成人欧美一区二区三区黑人麻豆 | 国产iv一区二区三区| 欧美不卡在线视频| aa级大片欧美| 国产高清久久久| 视频一区中文字幕| 一级中文字幕一区二区| 精品国产91洋老外米糕| 欧美性色黄大片| 国产成a人亚洲精| 国模冰冰炮一区二区| 亚洲激情自拍视频| 综合激情网...| 久久美女艺术照精彩视频福利播放 | 综合激情成人伊人| 国产欧美日韩亚州综合 | 1区2区3区国产精品| 久久久99久久精品欧美| 精品剧情在线观看| 91精品国产aⅴ一区二区| 欧美日韩精品福利| 欧美综合久久久| 欧美在线你懂得| 在线成人av网站| 欧美日韩中字一区| 欧美日韩国产综合草草| 在线视频一区二区三| 欧美视频一二三区| 欧美视频在线观看一区二区| 欧美日韩在线一区二区| 欧美高清你懂得| 欧美成人综合网站| 久久嫩草精品久久久精品一| 一二三四区精品视频| 亚洲狠狠丁香婷婷综合久久久| 一区二区三区日韩欧美精品| 午夜精品视频一区| 老汉av免费一区二区三区| 国产精品69久久久久水密桃| 成人aaaa免费全部观看| 欧洲亚洲国产日韩| 26uuu国产日韩综合| 国产精品久久久久久久久免费桃花| 国产精品久99| 亚洲狠狠爱一区二区三区| 国产乱子伦视频一区二区三区| 丰满白嫩尤物一区二区| 91精品在线观看入口| 国产欧美日韩精品一区| 洋洋av久久久久久久一区| 国产呦萝稀缺另类资源| 在线观看免费视频综合| 久久久不卡影院| 免费在线一区观看| 91福利社在线观看| 国产精品全国免费观看高清 | 久久99国产精品久久99果冻传媒| 成人免费毛片a| 精品嫩草影院久久| 亚洲成人高清在线| 在线欧美小视频| 综合久久给合久久狠狠狠97色| 国内成+人亚洲+欧美+综合在线| 欧美性猛交xxxxxx富婆| 777亚洲妇女| 国产精品成人在线观看| 韩国精品免费视频| 日韩美一区二区三区| 亚洲国产aⅴ成人精品无吗| 99re这里只有精品视频首页| 国产精品看片你懂得| 国产精品夜夜嗨| 久久久久久久久久久久久久久99 | 色婷婷av一区二区三区之一色屋| 欧美tickle裸体挠脚心vk| 舔着乳尖日韩一区| 欧美三级午夜理伦三级中视频| 亚洲精品免费在线| 色网站国产精品| 亚洲综合一区二区| 欧美精品久久一区二区三区| 一区二区三区资源| 欧美性受xxxx黑人xyx性爽| 亚洲国产乱码最新视频| 欧美日韩色综合| 免播放器亚洲一区| 欧美第一区第二区| 国产成人精品影视| 亚洲激情欧美激情| 91精品国产综合久久久久久| 国产一区中文字幕| 国产精品伦一区| 欧美肥大bbwbbw高潮| 国产专区综合网| 亚洲色图制服丝袜| 欧美一级艳片视频免费观看| 国模娜娜一区二区三区| 亚洲欧美激情在线| 26uuu精品一区二区在线观看| 成人激情免费电影网址| 午夜亚洲福利老司机|