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

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

?? assocrulemining.java

?? java platform java-growth algorithm
?? JAVA
?? 第 1 頁 / 共 4 頁
字號:
	String line = fileInput.readLine();
	for (int index=startRowIndex;index<endRowIndex;index++) {
	    // Process line
	    processInputLine(line,index);
	    // get next line
            line = fileInput.readLine();
	    }

	// Close file
	closeFile();
	}

    /* PROCESS INPUT LINE */

    /**	Processes a line from the input file and places it in the
    <TT>dataArray</TT> structure.
    @param line the line to be processed from the input file
    @param rowIndex the index to the current location in the
    <TT>dataArray</TT> structure.
    @rerturn true if successfull, false if empty record. */

    private boolean processInputLine(String line, int rowIndex) {
        // If no line return false
	if (line==null) return(false);

	// Tokenise line
	StringTokenizer dataLine = new StringTokenizer(line);
        int numberOfTokens = dataLine.countTokens();

	// Empty line or end of file found, return false
	if (numberOfTokens == 0) return(false);

	// Convert input string to a sequence of short integers
	short[] code = binConversion(dataLine,numberOfTokens);

	// Dimension row in 2-D dataArray
	int codeLength = code.length;
	dataArray[rowIndex] = new short[codeLength];
	// Assign to elements in row
	for (int colIndex=0;colIndex<codeLength;colIndex++)
				dataArray[rowIndex][colIndex] = code[colIndex];

	// Return
	return(true);
	}

    /* CHECK DATASET ORDERING */
    /** Checks that data set is ordered correctly.
    @return true if appropriate ordering, false otherwise. */

    protected boolean checkOrdering() {
        boolean result = true;

	// Loop through input data
	for(int index=0;index<dataArray.length;index++) {
	    if (!checkLineOrdering(index+1,dataArray[index])) {
		haveDataFlag = false;
		result=false;
		}
	    }

	// Return
	return(result);
	}

    /* CHECK LINE ORDERING */
    /** Checks whether a given line in the input data is in numeric sequence.
    @param lineNum the line number.
    @param itemSet the item set represented by the line
    @return true if OK and false otherwise. */

    protected boolean checkLineOrdering(int lineNum, short[] itemSet) {
        for (int index=0;index<itemSet.length-1;index++) {
	    if (itemSet[index] >= itemSet[index+1]) {
		JOptionPane.showMessageDialog(null,"FILE FORMAT ERROR:\n" +
	       		"Attribute data in line " + lineNum +
			" not in numeric order");
		return(false);
		}
	    }

	// Default return
	return(true);
	}

    /* COUNT NUMBER OF COLUMNS */
    /** Counts number of columns represented by input data. */

    protected void countNumCols() {
        int maxAttribute=0;

	// Loop through data array
        for(int index=0;index<dataArray.length;index++) {
	    int lastIndex = dataArray[index].length-1;
	    if (dataArray[index][lastIndex] > maxAttribute)
	    		maxAttribute = dataArray[index][lastIndex];
	    }

	numCols        = maxAttribute;
	numOneItemSets = numCols; 	// default value only
	}

    /* OPEN FILE NAME */
    /** Opens input file using fileName (instance field).
    @param nameOfFile the filename of the file to be opened. */

    protected void openFileName(String nameOfFile) {
	try {
	    // Open file
	    FileReader file = new FileReader(nameOfFile);
	    fileInput = new BufferedReader(file);
	    }
	catch(IOException ioException) {
	    JOptionPane.showMessageDialog(this,"Error Opening File",
			 "Error: ",JOptionPane.ERROR_MESSAGE);
	    System.exit(1);
	    }
	}

    /* OPEN FILE PATH */
    /** Opens file using filePath (instance field). */

    protected void openFilePath() {
	try {
	    // Open file
	    FileReader file = new FileReader(filePath);
	    fileInput = new BufferedReader(file);
	    }
	catch(IOException ioException) {
	    JOptionPane.showMessageDialog(this,"Error Opening File",
			 "Error: ",JOptionPane.ERROR_MESSAGE);
	    System.exit(1);
	    }
	}

    /* CLOSE FILE */
    /** Close file fileName (instance field). */

    protected void closeFile() {
        if (fileInput != null) {
	    try {
	    	fileInput.close();
		}
	    catch (IOException ioException) {
		JOptionPane.showMessageDialog(this,"Error Closeing File",
			 "Error: ",JOptionPane.ERROR_MESSAGE);
	        System.exit(1);
		}
	    }
	}

    /* BINARY CONVERSION. */

    /** Produce an item set (array of elements) from input
    line.
    @param dataLine row from the input data file
    @param numberOfTokens number of items in row
    @return 1-D array of short integers representing attributes in input
    row */

    protected short[] binConversion(StringTokenizer dataLine,
    				int numberOfTokens) {
        short number;
	short[] newItemSet = null;

	// Load array

	for (int tokenCounter=0;tokenCounter < numberOfTokens;tokenCounter++) {
            number = new Short(dataLine.nextToken()).shortValue();
	    newItemSet = realloc1(newItemSet,number);
	    }

	// Return itemSet

	return(newItemSet);
	}

    /* ---------------------------------------------------------------- */
    /*                                                                  */
    /*        REORDER DATA SET ACCORDING TO ATTRIBUTE FREQUENCY         */
    /*                                                                  */
    /* ---------------------------------------------------------------- */

    /* REORDER INPUT DATA: */

    /** Reorders input data according to frequency of
    single attributes. <P> Example, given the data set:
    <PRE>
    1 2 5
    1 2 3
    2 4 5
    1 2 5
    2 3 5
    </PRE>
    This would produce a countArray (ignore index 0):
    <PRE>
    +---+---+---+---+---+---+
    |   | 1 | 2 | 3 | 4 | 5 |
    +---+---+---+---+---+---+
    |   | 3 | 5 | 2 | 1 | 4 |
    +---+---+---+---+---+---+
    </PRE>
    Which sorts to:
    <PRE>
    +---+---+---+---+---+---+
    |   | 2 | 5 | 1 | 3 | 4 |
    +---+---+---+---+---+---+
    |   | 5 | 4 | 3 | 2 | 1 |
    +---+---+---+---+---+---+
    </PRE>
    Giving rise to the conversion Array of the form (no index 0):
    <PRE>
    +---+---+---+---+---+---+
    |   | 3 | 1 | 4 | 5 | 2 |
    +---+---+---+---+---+---+
    |   | 3 | 5 | 2 | 1 | 4 |
    +---+---+---+---+---+---+
    </PRE>
    Note that the second row here are the counts which no longer play a role
    in the conversion exercise. Thus to the new column number for column 1 is 
    column 3 (i.e. the first vale at index 1). The reconversion array of the 
    form:
    <PRE>
    +---+---+---+---+---+---+
    |   | 2 | 5 | 1 | 3 | 4 |
    +---+---+---+---+---+---+		
    </PRE> */
    
    public void idInputDataOrdering() {
	
	// Count singles and store in countArray;	     
        int[][] countArray = countSingles();
        
	// Bubble sort count array on support value (second index)	
	orderCountArray(countArray);
       
        // Define conversion and reconversion arrays      
	defConvertArrays(countArray);
	
	// Set sorted flag
	isOrderedFlag = true;
	}
	   
    /* COUNT SINGLES */
    
    /** Counts number of occurrences of each single attribute in the
    input data.
    @return 2-D array where first row represents column numbers
    and second row represents support counts. */
    
    protected int[][] countSingles() {
        
	// Dimension and initialize count array
	
	int[][] countArray = new int[numCols+1][2];
	for (int index=0;index<countArray.length;index++) {
	    countArray[index][0] = index;
	    countArray[index][1] = 0;
	    }
	    	    
	// Step through input data array counting singles and incrementing
	// appropriate element in the count array
	
	for(int rowIndex=0;rowIndex<dataArray.length;rowIndex++) {
	     if (dataArray[rowIndex] != null) {
		for (int colIndex=0;colIndex<dataArray[rowIndex].length;
					colIndex++) 
		    	countArray[dataArray[rowIndex][colIndex]][1]++;
		}
	    }
	
	// Return
	
	return(countArray);
	}
	
    /* ORDER COUNT ARRAY */
    
    /** Bubble sorts count array produced by <TT>countSingles</TT> method
    so that array is ordered according to frequency of single items. 
    @param countArray The 2-D array returned by the <TT>countSingles</TT> 
    method. */
       
    private void orderCountArray(int[][] countArray) {
        int attribute, quantity;	
        boolean isOrdered;
        int index; 
               
        do {
	    isOrdered = true;
            index     = 1; 
            while (index < (countArray.length-1)) {
                if (countArray[index][1] >= countArray[index+1][1]) index++;
	        else {
	            isOrdered=false;
                    // Swap
		    attribute              = countArray[index][0];
		    quantity               = countArray[index][1];
	            countArray[index][0]   = countArray[index+1][0];
	            countArray[index][1]   = countArray[index+1][1];
                    countArray[index+1][0] = attribute;
	            countArray[index+1][1] = quantity;
	            // Increment index
		    index++;  
	            }
	  	}     
	    } while (isOrdered==false);
    	}
    
    /* ORDER FIRST N ELEMENTS IN COUNT ARRAY */

    /** Bubble sorts first N elements in count array produced by
    <TT>countSingles</TT> method so that array is ordered according to
    frequency of single items. <P> Used when ordering classification input
    data.
    @param countArray The 2-D array returned by the <TT>countSingles</TT>
    method.
    @param endIndex the index of the Nth element. */

    protected void orderFirstNofCountArray(int[][] countArray, int endIndex) {
        int attribute, quantity;
        boolean isOrdered;
        int index;

        do {
	    isOrdered = true;
            index     = 1;
            while (index < endIndex) {
                if (countArray[index][1] >= countArray[index+1][1]) index++;
	        else {
	            isOrdered=false;
                    // Swap
		    attribute              = countArray[index][0];
		    quantity               = countArray[index][1];
	            countArray[index][0]   = countArray[index+1][0];
	            countArray[index][1]   = countArray[index+1][1];
                    countArray[index+1][0] = attribute;
	            countArray[index+1][1] = quantity;
	            // Increment index
		    index++;
	            }
	  	}
	    } while (isOrdered==false);
    	}

    /* DEFINE CONVERSION ARRAYS: */

    /** Defines conversion and reconversion arrays.
    @param countArray The 2-D array sorted by the <TT>orderCcountArray</TT>
    method.*/

    protected void defConvertArrays(int[][] countArray) {

	// Dimension arrays

	conversionArray   = new int[numCols+1][2];
        reconversionArray = new short[numCols+1];

	// Assign values

	for(int index=1;index<countArray.length;index++) {
            conversionArray[countArray[index][0]][0] = index;
            conversionArray[countArray[index][0]][1] = countArray[index][1];
	    reconversionArray[index] = (short) countArray[index][0];
	    }

	// Diagnostic ouput if desired
	//outputConversionArrays();
	}

    /* RECAST INPUT DATA. */

    /** Recasts the contents of the data array so that each record is ordered
    according to conversion array.
    <P>Proceed as follows:

    1) For each record in the data array. Create an empty new itemSet array.
    2) Place into this array attribute/column numbers that correspond to the
       appropriate equivalents contained in the conversion array.
    3) Reorder this itemSet and return into the data array. */

    public void recastInputData() {
        short[] itemSet;
	int attribute;

	// Step through data array using loop construct

        for(int rowIndex=0;rowIndex<dataArray.length;rowIndex++) {
	    itemSet = new short[dataArray[rowIndex].length];
	    // For each element in the itemSet replace with attribute number
	    // from conversion array
	    for(int colIndex=0;colIndex<dataArray[rowIndex].length;colIndex++) {
	        attribute = dataArray[rowIndex][colIndex];
		itemSet[colIndex] = (short) conversionArray[attribute][0];
		}
	    // Sort itemSet and return to data array
	    sortItemSet(itemSet);
	    dataArray[rowIndex] = itemSet;
	    }
	}

    /* RECAST INPUT DATA AND REMOVE UNSUPPORTED SINGLE ATTRIBUTES. */

    /** Recasts the contents of the data array so that each record is
    ordered according to ColumnCounts array and excludes non-supported
    elements. <P> Proceed as follows:

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
●精品国产综合乱码久久久久| 日韩欧美一区在线| 国产91精品一区二区麻豆亚洲| 蜜桃在线一区二区三区| 日韩高清在线不卡| 日本成人中文字幕| 久久精品国产在热久久| 另类小说视频一区二区| 久久精品国产亚洲a| 久久99久久99精品免视看婷婷| 美女视频一区在线观看| 久久69国产一区二区蜜臀| 精品一区精品二区高清| 福利一区二区在线| 91亚洲精品一区二区乱码| 欧美无人高清视频在线观看| 欧美日韩一区二区三区在线| 欧美成人精品高清在线播放| 久久久精品国产免费观看同学| 国产色产综合色产在线视频| 中文字幕色av一区二区三区| 亚洲一区视频在线| 狠狠色丁香婷婷综合| 99精品国产热久久91蜜凸| 欧美三级视频在线| 久久久久久久久久久久久久久99| 中文字幕亚洲欧美在线不卡| 午夜精品一区二区三区免费视频| 卡一卡二国产精品| 色狠狠一区二区三区香蕉| 欧美一级高清片在线观看| 国产精品美女一区二区| 天天做天天摸天天爽国产一区| 国产精品1区2区3区在线观看| 色婷婷综合激情| 久久综合狠狠综合久久激情| 亚洲欧美aⅴ...| 国产在线不卡一区| 欧美日韩一区小说| 国产精品伦理在线| 久久国产精品第一页| 日本道精品一区二区三区 | 亚洲欧美日本韩国| 免播放器亚洲一区| 99国产精品久久久久| 久久免费的精品国产v∧| 亚洲狠狠爱一区二区三区| 国产宾馆实践打屁股91| 91精品免费在线| 玉足女爽爽91| voyeur盗摄精品| 久久久亚洲午夜电影| 午夜精彩视频在线观看不卡| 91在线免费播放| 久久精品人人爽人人爽| 天堂久久久久va久久久久| 成人国产精品免费观看动漫 | 国产成人在线视频免费播放| 欧美日韩久久一区二区| 亚洲欧美欧美一区二区三区| 国产91高潮流白浆在线麻豆 | 亚洲丝袜另类动漫二区| 精品一二三四区| 欧美一级久久久| 亚洲第一电影网| 色94色欧美sute亚洲线路二| 国产精品久久三区| 成av人片一区二区| 国产精品污www在线观看| 国产精品中文字幕日韩精品| 久久人人97超碰com| 国产精品一卡二卡在线观看| 日韩欧美成人一区二区| 欧美a一区二区| 日韩欧美在线观看一区二区三区| 亚洲高清免费在线| 欧美日韩二区三区| 日本系列欧美系列| 日韩欧美在线综合网| 久88久久88久久久| 久久久国产精品麻豆| 成人性生交大片免费看中文| 亚洲欧美综合网| 在线观看成人免费视频| 亚洲一级二级三级| 欧美精品一二三四| 精品一区二区在线免费观看| 久久精品视频免费观看| av一二三不卡影片| 亚洲午夜电影网| 91精品国产综合久久精品性色| 老司机午夜精品99久久| 国产欧美一二三区| 在线精品视频免费播放| 免费欧美日韩国产三级电影| 久久日一线二线三线suv| 丰满放荡岳乱妇91ww| 亚洲欧美福利一区二区| 在线不卡中文字幕| 国产成人免费视| 一区二区三区高清在线| 欧美tickling挠脚心丨vk| 99综合影院在线| 日本亚洲最大的色成网站www| 久久久久国产精品麻豆ai换脸 | 精品久久一二三区| 高清国产一区二区| 亚洲成av人片观看| 亚洲国产精品精华液ab| 欧美日韩精品一区二区| 国产精品99久久久久久似苏梦涵| 18欧美乱大交hd1984| 日韩精品专区在线影院重磅| 国产成人超碰人人澡人人澡| 亚洲bt欧美bt精品| 欧美国产日韩一二三区| 日韩一区二区三区免费观看| 成人av在线资源网| 国产资源精品在线观看| 亚洲精品伦理在线| 久久精品日韩一区二区三区| 欧美日韩国产一级二级| 高清免费成人av| 裸体健美xxxx欧美裸体表演| 尤物av一区二区| 国产日韩欧美不卡| 精品精品国产高清a毛片牛牛| 91蜜桃免费观看视频| 懂色中文一区二区在线播放| 奇米精品一区二区三区在线观看一| 亚洲欧美日韩国产成人精品影院| 亚洲精品一区二区三区影院| 欧美日韩国产在线播放网站| 91免费看片在线观看| 激情六月婷婷久久| 蜜桃免费网站一区二区三区| 亚洲一区免费在线观看| 亚洲欧美日韩精品久久久久| 国产精品国产精品国产专区不片| 日韩久久免费av| 欧美精品一二三四| 欧美日韩mp4| 欧美日韩一本到| 精品视频在线看| 欧美性猛交xxxx乱大交退制版| 91在线视频18| 91久久精品一区二区| 91久久线看在观草草青青| 一本大道久久a久久综合| 96av麻豆蜜桃一区二区| 97久久超碰国产精品| 丁香婷婷综合五月| 国产大陆精品国产| 成人动漫中文字幕| 91丝袜国产在线播放| 欧美专区在线观看一区| 欧美性受xxxx黑人xyx性爽| 欧美丝袜丝交足nylons| 欧美日韩小视频| 日韩欧美国产三级电影视频| 日韩女优电影在线观看| 久久精品日产第一区二区三区高清版| 精品国产百合女同互慰| 久久久久久**毛片大全| 国产精品免费av| 一个色综合av| 日韩黄色在线观看| 国产电影一区在线| 色婷婷av一区二区三区之一色屋| 欧美日韩亚洲综合| 精品日本一线二线三线不卡| 久久久久久9999| 亚洲欧美日本韩国| 麻豆精品在线视频| 成人18视频日本| 欧美日高清视频| 国产亚洲欧美日韩在线一区| 一区在线观看视频| 午夜精品久久久久久久99樱桃 | 亚洲欧美另类小说| 天天影视涩香欲综合网| 激情五月婷婷综合| 91一区二区在线| 欧美成人一区二区三区| 亚洲手机成人高清视频| 日韩在线一区二区三区| 成人性色生活片| 欧美一区二区免费观在线| 久久精品日产第一区二区三区高清版| 国产精品乱人伦| 日本不卡在线视频| 91久久国产最好的精华液| 精品国产乱码久久久久久老虎 | 国产成人精品一区二| 欧美在线观看视频一区二区三区| 精品久久久网站| 亚洲国产日韩a在线播放性色| 精品一区二区免费| 欧美在线免费播放| 中文字幕欧美激情|