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

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

?? aprioriall.java

?? 一個數據挖掘軟件ALPHAMINERR的整個過程的JAVA版源代碼
?? 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一区二区三区免费野_久草精品视频
国产日产欧美一区二区视频| 亚洲va在线va天堂| 国产精品国产三级国产普通话蜜臀 | 欧美羞羞免费网站| 在线不卡a资源高清| 欧美精品一区在线观看| 亚洲免费观看在线视频| 日韩精品高清不卡| 成人不卡免费av| 欧美日韩免费在线视频| 2023国产一二三区日本精品2022| 亚洲国产高清aⅴ视频| 亚洲电影第三页| 国产精品一二三在| 欧美性猛交xxxx黑人交| 久久人人97超碰com| 亚洲综合清纯丝袜自拍| 国产风韵犹存在线视精品| 在线中文字幕一区二区| 亚洲精品一区二区在线观看| 亚洲男人的天堂在线aⅴ视频| 美女被吸乳得到大胸91| 色综合中文字幕国产 | 免费看欧美女人艹b| 豆国产96在线|亚洲| 欧美嫩在线观看| 国产精品电影院| 美女一区二区三区在线观看| 91九色02白丝porn| 国产调教视频一区| 日韩精品高清不卡| 91福利国产精品| 国产精品每日更新在线播放网址| 天堂av在线一区| 91视频在线看| 中文字幕高清一区| 久久99精品视频| 欧美在线|欧美| 国产精品久久久久国产精品日日| 久久精品国产一区二区三区免费看| 色婷婷综合久久久久中文一区二区 | 亚洲色图20p| 国产在线不卡一区| 欧美一区二区三区播放老司机| 一区二区三区日韩欧美精品| 风间由美一区二区三区在线观看 | 国产精品99久久久久久宅男| 欧美丰满美乳xxx高潮www| 一色桃子久久精品亚洲| 国产精品69毛片高清亚洲| 欧美成人免费网站| 日韩avvvv在线播放| 在线观看免费一区| 中文字幕亚洲区| 懂色av噜噜一区二区三区av| 久久女同性恋中文字幕| 狠狠色狠狠色综合| 日韩欧美成人激情| 秋霞国产午夜精品免费视频| 欧美日韩精品欧美日韩精品| 亚洲综合在线视频| 色综合天天天天做夜夜夜夜做| 中文字幕免费观看一区| 国产精品1区2区| 久久精品视频一区| 国产精品99久| 中文无字幕一区二区三区| 国产精品一级在线| 国产日本欧美一区二区| 岛国精品一区二区| 国产午夜亚洲精品不卡| 国产高清精品在线| 国产人成一区二区三区影院| 国产一区二区三区观看| www日韩大片| 国产福利91精品一区二区三区| 国产夜色精品一区二区av| 丰满白嫩尤物一区二区| 国产精品家庭影院| 91麻豆免费看片| 亚洲精品久久7777| 日本高清不卡aⅴ免费网站| 一区二区三区国产| 欧美视频在线观看一区二区| 视频一区视频二区中文| 日韩欧美亚洲一区二区| 精品一区二区综合| 欧美国产97人人爽人人喊| 成人动漫一区二区在线| 亚洲欧美一区二区三区国产精品| 色乱码一区二区三区88| 婷婷综合久久一区二区三区| 日韩视频一区二区| 国产激情视频一区二区在线观看| 中文字幕亚洲综合久久菠萝蜜| 日本乱人伦aⅴ精品| 日本不卡不码高清免费观看| 精品99999| 91丝袜高跟美女视频| 午夜精品福利在线| 久久午夜老司机| 99久久精品情趣| 三级成人在线视频| 久久久久久久久久久黄色| 91一区一区三区| 免费看黄色91| 国产精品视频麻豆| 欧美日韩国产大片| 国产福利一区二区三区视频| 亚洲免费观看在线视频| 日韩欧美www| 91在线免费播放| 男男gaygay亚洲| 国产精品久久久久7777按摩| 51精品视频一区二区三区| 国产美女久久久久| 亚洲国产一区视频| 久久精品亚洲精品国产欧美| 欧美专区在线观看一区| 国产一区二区三区四| 亚洲人精品午夜| 欧美成人激情免费网| 91在线免费看| 韩日av一区二区| 一区二区视频在线看| 欧美videos中文字幕| 色狠狠桃花综合| 国产九色sp调教91| 午夜激情一区二区| 中文字幕+乱码+中文字幕一区| 欧美日本一区二区三区四区| 国产高清不卡一区| 日本午夜精品一区二区三区电影| 国产精品久久国产精麻豆99网站 | 国产精品自拍三区| 午夜精品久久久久久久久| 国产精品久久三| 日韩欧美黄色影院| 日本道精品一区二区三区| 精品一区二区三区香蕉蜜桃| 亚洲制服欧美中文字幕中文字幕| 久久久综合九色合综国产精品| 欧美最猛性xxxxx直播| 国产精品18久久久久| 日韩av一区二区三区| 亚洲欧美aⅴ...| 国产精品狼人久久影院观看方式| 欧美一区二区黄| 欧美性videosxxxxx| 91视频在线观看| 国产.欧美.日韩| 国内精品免费在线观看| 日本vs亚洲vs韩国一区三区二区| 亚洲亚洲精品在线观看| 亚洲品质自拍视频网站| 中文av一区二区| 国产欧美日韩另类视频免费观看| 日韩欧美二区三区| 在线播放日韩导航| 欧美日韩亚洲丝袜制服| 色悠久久久久综合欧美99| 国产成人在线影院| 久久 天天综合| 捆绑调教美女网站视频一区| 视频一区在线视频| 午夜精品久久久久久久99樱桃 | 91精品久久久久久久91蜜桃| 欧美综合一区二区| 色综合久久精品| 91丝袜美腿高跟国产极品老师| www.欧美色图| 成人美女在线观看| 成人黄色电影在线| www.66久久| 99国产精品久久久久久久久久久| 成人看片黄a免费看在线| 成人一区在线观看| 国产91丝袜在线播放九色| 国产91丝袜在线观看| 成人深夜视频在线观看| 成人综合在线视频| 不卡的电影网站| 91婷婷韩国欧美一区二区| 91丨九色porny丨蝌蚪| 色欧美日韩亚洲| 在线视频欧美区| 欧美日韩视频在线第一区| 欧美体内she精高潮| 欧美精品v国产精品v日韩精品| 69久久夜色精品国产69蝌蚪网| 91精品国产欧美一区二区| 日韩欧美一区二区不卡| 26uuu欧美| 国产日韩欧美a| 亚洲日本中文字幕区| 亚洲综合在线视频| 日韩福利电影在线| 久久国产精品99久久久久久老狼| 国产一区二区网址| 成人免费毛片高清视频|