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

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

?? assocrulemining.java

?? java platform java-growth algorithm
?? JAVA
?? 第 1 頁 / 共 4 頁
字號:
/* -------------------------------------------------------------------------- */
/*                                                                            */
/*                      ASSOCIATION RULE DATA MINING                          */
/*                                                                            */
/*                            Frans Coenen                                    */
/*                                                                            */
/*                        Wednesday 9 January 2003                            */
/*   (revised 21/1/2003, 14/2/2003, 2/5/2003, 2/7/2003, 3/2/2004, 8/5/2004,   */
/*                           1/2/2005, 3/2/2005)                              */
/*                                                                            */
/*                    Department of Computer Science                          */
/*                     The University of Liverpool                            */
/*                                                                            */ 
/* -------------------------------------------------------------------------- */



/* To compile: javac.exe AssocRuleMining.java */

// Java packages
import java.io.*;
import java.util.*;

// Java GUI packages
import javax.swing.*;

/** Set of utillities to support various Association Rule Mining (ARM) 
algorithms.
@author Frans Coenen
@version 1 February 2005 */

public class AssocRuleMining extends JFrame {

    /* ------ FIELDS ------ */

    // Inner class for storing linked list of ARs or CARs as appropriate.

    protected class RuleNode {
    	/** Antecedent of AR. */
	protected short[] antecedent;
	/** Consequent of AR. */
	protected short[] consequent;
	/** The confidence value associate with the rule represented by this
	node. */
	double confidenceForRule=0.0;
	/** Link to next node */
	RuleNode next = null;
	
	/** Three argument constructor
	@param ante the antecedent (LHS) of the AR.
    	@param cons the consequent (RHS) of the AR.
    	@param confValue the associated confidence value. */
	
	protected RuleNode(short[] ante, short[]cons, double confValue) {
	    antecedent        = ante;
	    consequent        = cons;
	    confidenceForRule = confValue;
	    }
	}
	
    // Data structures
	
    /** The reference to start of the rule list. */
    protected RuleNode startRulelist = null;	
    /** 2-D aray to hold input data from data file. Note that within the data
    array records are numbered from zero, thus rexcord one has index 0 etc. */
    protected short[][] dataArray = null;
    /** 2-D array used to renumber columns for input data in terms of
    frequency of single attributes (reordering will enhance performance
    for some ARM algorithms). */
    protected int[][] conversionArray   = null;
    /** 1-D array used to reconvert input data column numbers to their
    original numbering where the input data has been ordered to enhance
    computational efficiency. */
    protected short[] reconversionArray = null;
	
    // Constants
    
    /** Minimum support value */
    private static final double MIN_SUPPORT = 0.0;
    /** Maximum support value */
    private static final double MAX_SUPPORT = 100.0;
    /** Maximum confidence value */
    private static final double MIN_CONFIDENCE = 0.0;
    /** Maximum confidence value */
    private static final double MAX_CONFIDENCE = 100.0;	
    
    // Command line arguments with default values and associated fields.
    
    /** Command line argument for data file name. */
    protected String  fileName   = null;
    /** Command line argument for number of columns. */
    protected int     numCols    = 0;
    /** Command line argument for number of rows. */
    protected int     numRows    = 0;
    /** Command line argument for % support (default = 20%). */
    protected double  support    = 20.0;
    /** Minimum support value in terms of number of rows. <P>Set when input
    data is read and the number of records is known,   */
    protected double  minSupport = 0;
    /** Command line argument for % confidence (default = 80%). */
    protected double  confidence = 80.0;
    /** The number of one itemsets (singletons). */
    protected int numOneItemSets = 0;

    // Flags

    /** Error flag used when checking command line arguments (default =
    <TT>true</TT>). */
    protected boolean errorFlag  = true;
    /** Input format OK flag( default = <TT>true</TT>). */
    protected boolean inputFormatOkFlag = true;
    /** Flag to indicate whether system has data or not. */
    private boolean haveDataFlag = false;
    /** Flag to indicate whether input data has been sorted or not. */
    protected boolean isOrderedFlag = false;
    /** Flag to indicate whether input data has been sorted and pruned or
    not. */
    protected boolean isPrunedFlag = false;

    // Other fields

    /** The input stream. */
    protected BufferedReader fileInput;
    /** The file path */
    protected File filePath = null;

    /* ------ CONSTRUCTORS ------ */

    /** Processes command line arguments */

    public AssocRuleMining(String[] args) {

	// Process command line arguments

	for(int index=0;index<args.length;index++) idArgument(args[index]);

	// If command line arguments read successfully (errorFlag set to "true")
	// check validity of arguments

	if (errorFlag) CheckInputArguments();
	else outputMenu();
        }

    /* ------ METHODS ------ */

    /* ---------------------------------------------------------------- */
    /*                                                                  */
    /*                        COMMAND LINE ARGUMENTS                    */
    /*                                                                  */
    /* ---------------------------------------------------------------- */

    /* IDENTIFY ARGUMENT */
    /** Identifies nature of individual command line agruments:
    -C = confidence, -F = file name, -S = support. */

    protected void idArgument(String argument) {

        if (argument.charAt(0) == '-') {
	    char flag = argument.charAt(1);
	    argument = argument.substring(2,argument.length());
	    switch (flag) {
		case 'C':
	            confidence = Double.parseDouble(argument);
		    break;
	        case 'F':
	    	    fileName = argument;
		    break;
	        case 'S':
	            support = Double.parseDouble(argument);
		    break;
	        default:
	            System.out.println("INPUT ERROR: Unrecognise command " +
		    		"line  argument -" + flag + argument);
		    errorFlag = false;
	        }
            }
        else {
	    System.out.println("INPUT ERROR: All command line arguments " +
    				"must commence with a '-' character (" +
							argument + ")");
            errorFlag = false;
            }
	}

    /* CHECK INPUT ARGUMENTS */
    /** Invokes methods to check values associate with command line
    arguments */

    protected void CheckInputArguments() {

	// Check support and confidence input
	checkSupportAndConfidence();

	// Check file name
	checkFileName();

	// Return
	if (errorFlag) outputSettings();
	else outputMenu();
	}

    /* CHECK SUPPORT AND CONFIDANCE */
    /** Checks support and confidence input % values, if either is out of
    bounds then <TT>errorFlag</TT> set to <TT>false</TT>. */

    protected void checkSupportAndConfidence() {

	// Check Support
	if ((support < MIN_SUPPORT) || (support > MAX_SUPPORT)) {
		System.out.println("INPUT ERROR: Support must be specified " +
		 			"as a percentage (" + MIN_SUPPORT +
		 				" - " + MAX_SUPPORT + ")");
	    errorFlag = false;
	    }
	// Check confidence
	if ((confidence < MIN_CONFIDENCE) || (confidence > MAX_CONFIDENCE)) {
		System.out.println("INPUT ERROR: Confidence must be " +
		               "specified as a percentage (" + MIN_CONFIDENCE +
					" - " + MAX_CONFIDENCE + ")");
	    errorFlag = false;
	    }
	}

    /* CHECK FILE NAME */
    /** Checks if data file name provided, if not <TT>errorFlag</TT> set
    to <TT>false</TT>. */

    protected void checkFileName() {
	if (fileName == null) {
	    System.out.println("INPUT ERROR: Must specify file name (-F)");
            errorFlag = false;
	    }
	}

    /* ---------------------------------------------------------------- */
    /*                                                                  */
    /*                     READ INPUT DATA FROM FILE                    */
    /*                                                                  */
    /* ---------------------------------------------------------------- */

    /* INPUT DATA SET */

    /** Commences process of getting input data (GUI version also exists). */

    public void inputDataSet() {
        // Read the file
	readFile();

	// Check ordering (only if input format is OK)
	if (inputFormatOkFlag) {
	    if (checkOrdering()) {
                System.out.println("Number of records = " + numRows);
		countNumCols();
		System.out.println("Number of columns = " + numCols);
		minSupport = (numRows * support)/100.0;
        	System.out.println("Min support       = " +
				twoDecPlaces(minSupport) + " (records)");
		}
	    else {
	        System.out.println("Error reading file: " + fileName + "\n");
	        closeFile();
	        System.exit(1);
		}
	    }
	}

    /* READ FILE */

    /** Reads input data from file specified in command line argument
    <TT>fileName</TT>. <P>Note that it is assumed
    that no empty records are included. Proceeds as follows:
    <OL>
    <LI>Gets number of rows (lines) in file, checking format of each line
    (space separated integers), if incorrectly formatted line found
    <TT>inputFormatOkFlag</TT> set to <TT>false</TT>.
    <LI>Dimensions input array.
    <LI>Reads data
    </OL> */

    protected void readFile() {
        try {
	    // Dimension data structure
	    inputFormatOkFlag=true;
	    numRows = getNumberOfLines(fileName);
	    if (inputFormatOkFlag) {
	        dataArray = new short[numRows][];
	        // Read file
		System.out.println("Reading input file: " + fileName);
	        readInputDataSet();
		}
	    else System.out.println("Error reading file: " + fileName + "\n");
	    }
	catch(IOException ioException) {
	    System.out.println("Error reading File");
	    closeFile();
	    System.exit(1);
	    }
	}

    /* GET NUMBER OF LINES */

    /** Gets number of lines/records in input file and checks format of each
    line.
    @param nameOfFile the filename of the file to be opened.
    @return the number of rows in the given file. */

    protected int getNumberOfLines(String nameOfFile) throws IOException {
        int counter = 0;

	// Open the file
	if (filePath==null) openFileName(nameOfFile);
	else openFilePath();

	// Loop through file incrementing counter
	// get first row.
	String line = fileInput.readLine();
	while (line != null) {
	    checkLine(counter+1,line);
	    StringTokenizer dataLine = new StringTokenizer(line);
            int numberOfTokens = dataLine.countTokens();
	    if (numberOfTokens == 0) break;
	    counter++;
            line = fileInput.readLine();
	    }

	// Close file and return
        closeFile();
	return(counter);
	}

    /* CHECK LINE */

    /** Check whether given line from input file is of appropriate format
    (space separated integers), if incorrectly formatted line found
    <TT>inputFormatOkFlag</TT> set to <TT>false</TT>.
    @param counter the line number in the input file.
    @param str the current line from the input file. */

    protected void checkLine(int counter, String str) {

        for (int index=0;index <str.length();index++) {
            if (!Character.isDigit(str.charAt(index)) &&
	    			!Character.isWhitespace(str.charAt(index))) {
		JOptionPane.showMessageDialog(null,"FILE INPUT ERROR:\n" +
					"charcater on line " + counter +
					" is not a digit or white space");
		inputFormatOkFlag = false;
		haveDataFlag = false;
		break;
		}
	    }
	}

    /* READ INPUT DATA SET */
    /** Reads input data from file specified in command line argument. */

    public void readInputDataSet() throws IOException {
        readInputDataSet(fileName);
	}

    /* READ INPUT DATA SET */
    /** Reads input data from given file.
    @param fName the given file name.  */

    protected void readInputDataSet(String fName) throws IOException {
	int rowIndex=0;

	// Open the file
	if (filePath==null) openFileName(fName);
	else openFilePath();

	// Get first row.
	String line = fileInput.readLine();

	// Preocess rest of file
	while (line != null) {
	    // Process line
	    if (!processInputLine(line,rowIndex)) break;
	    // Increment first (row) index in 2-D data array
	    rowIndex++;
	    // get next line
            line = fileInput.readLine();
	    }

	// Close file
	closeFile();
	}

    /* READ INPUT DATA SEGMENT */
    /** Reads input data segment from a given file and places content into to
    the data array structure commencing at the given row index, continues until
    the end index is rerached.
    @param fName the given file name.
    @param startRowIndex the given row strat index.
    @param endRowIndex the given row end index. */

    protected void readInputDataSetSeg(String fName, int startRowIndex,
    					int endRowIndex) throws IOException {
	int rowIndex=startRowIndex;

	// Open the file
	if (filePath==null) openFileName(fName);
	else openFilePath();

	// get first row.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区三区国产精品| 91在线一区二区| 91在线视频网址| 欧美一级日韩不卡播放免费| 国产精品免费看片| 久久99精品视频| 欧美影院一区二区| 亚洲欧美另类久久久精品| 国内成人精品2018免费看| 欧美私模裸体表演在线观看| 国产精品色一区二区三区| 麻豆精品一区二区| 在线综合视频播放| 亚洲va国产va欧美va观看| 91日韩在线专区| 国产精品久久久久精k8| 懂色av一区二区三区免费观看| 欧美一区二区三区免费在线看 | 久久欧美一区二区| 男人的天堂亚洲一区| 在线不卡的av| 亚洲第一主播视频| 欧美久久久一区| 亚洲福利一二三区| 欧美美女视频在线观看| 夜色激情一区二区| 欧美午夜精品免费| 亚洲成人综合在线| 欧美理论电影在线| 欧美96一区二区免费视频| 91精品国产91久久久久久最新毛片| 亚洲视频精选在线| 欧美性猛交一区二区三区精品| 亚洲精品写真福利| 欧美午夜不卡视频| 天堂成人免费av电影一区| 91精品国产手机| 精品在线你懂的| 国产欧美视频一区二区| 北条麻妃国产九九精品视频| 成人免费小视频| 一本大道久久a久久精二百 | 97aⅴ精品视频一二三区| 国产精品欧美精品| 色综合久久中文字幕综合网| 亚洲男人天堂一区| 69堂精品视频| 国产美女主播视频一区| 欧美国产综合一区二区| 91视频91自| 午夜电影网一区| 中文字幕一区av| 91免费观看国产| 日韩二区在线观看| 久久综合九色综合欧美98| 成人激情av网| 视频一区二区中文字幕| 久久亚洲综合色| 99riav久久精品riav| 偷拍日韩校园综合在线| 精品国产亚洲在线| 色综合天天视频在线观看| 无码av免费一区二区三区试看| 精品成a人在线观看| 91理论电影在线观看| 男人的天堂久久精品| 国产欧美一区视频| 欧美日韩国产一区二区三区地区| 精品影院一区二区久久久| 国产精品理伦片| 欧美日韩精品三区| 风间由美性色一区二区三区| 亚洲国产精品久久人人爱蜜臀| 久久综合狠狠综合| 欧美午夜电影一区| 高清不卡一区二区| 蜜臀av性久久久久蜜臀aⅴ四虎| 中文字幕av一区 二区| 欧美一区在线视频| 色综合久久久久综合体| 久久成人免费网| 一区二区三区**美女毛片| 国产亚洲一区二区三区在线观看 | 国产成人免费av在线| 午夜私人影院久久久久| 中文字幕中文在线不卡住| www精品美女久久久tv| 欧美亚洲日本一区| 99久久99久久免费精品蜜臀| 韩日欧美一区二区三区| 午夜精品福利一区二区三区av | 欧美精品一区二区三| 欧美无砖专区一中文字| 99re亚洲国产精品| 国产99久久久国产精品潘金网站| 日韩av一区二| 亚洲成人在线免费| 国产精品国产精品国产专区不片| 欧美成人精品1314www| 欧美情侣在线播放| 欧美性高清videossexo| 一本一本大道香蕉久在线精品| 国产一区二区主播在线| 奇米影视在线99精品| 天堂精品中文字幕在线| 亚洲成人动漫精品| 亚洲第一会所有码转帖| 亚洲国产欧美日韩另类综合| 亚洲天堂成人在线观看| 中文字幕一区二区三区在线观看| 久久精品在线观看| 国产三级精品视频| 欧美国产视频在线| 国产精品国产自产拍高清av | 精品第一国产综合精品aⅴ| 日韩一级片在线播放| 日韩一级在线观看| 精品999在线播放| 国产午夜精品一区二区| 日本一区二区免费在线| 中文字幕一区免费在线观看| 亚洲精品欧美激情| 亚洲国产精品嫩草影院| 青青草原综合久久大伊人精品优势| 日韩影院精彩在线| 精一区二区三区| 国产成人在线免费观看| 97久久人人超碰| 在线免费观看不卡av| 欧美高清你懂得| 精品久久国产老人久久综合| 2020国产精品久久精品美国| 国产喷白浆一区二区三区| 亚洲欧美一区二区在线观看| 一区二区三区在线观看网站| 日韩精品视频网站| 国产成人综合在线播放| bt7086福利一区国产| 欧美日韩视频一区二区| 日韩精品一区在线观看| 国产日韩精品一区二区浪潮av | 秋霞电影一区二区| 国产91精品露脸国语对白| 一本大道av一区二区在线播放| 欧美日韩电影在线播放| 精品国产乱码久久| 一区二区三区av电影| 精品一区二区影视| 色婷婷av久久久久久久| 欧美mv日韩mv国产| 亚洲激情自拍视频| 国产一区二区三区免费看| 91浏览器打开| 久久久久久久久伊人| 亚洲综合成人网| 国产一区二区主播在线| 欧美在线免费播放| 久久综合精品国产一区二区三区| 一区二区三区自拍| 国产高清不卡一区| 欧美精品少妇一区二区三区| 国产精品欧美久久久久一区二区| 日韩在线a电影| 99re热这里只有精品免费视频| 精品少妇一区二区三区| 一区二区三区中文字幕精品精品| 久久国产精品99久久久久久老狼| 色香蕉久久蜜桃| 国产欧美日韩亚州综合 | 亚洲福利视频三区| 成人av电影在线播放| 精品国产一区二区三区不卡 | 欧美高清性hdvideosex| 国产精品成人网| 韩国欧美国产一区| 欧美精品免费视频| 亚洲黄色片在线观看| zzijzzij亚洲日本少妇熟睡| 欧美成人精品二区三区99精品| 亚洲国产精品久久艾草纯爱 | 亚洲一区二区三区四区在线免费观看 | 五月综合激情网| 99国产欧美另类久久久精品 | 91亚洲大成网污www| 久久精品男人的天堂| 免费观看在线色综合| 91精品国产美女浴室洗澡无遮挡| 亚洲品质自拍视频网站| 97精品久久久久中文字幕| 国产精品色呦呦| av欧美精品.com| 亚洲欧美在线aaa| 91欧美一区二区| 亚洲人成影院在线观看| 99精品1区2区| 亚洲黄色免费网站| 91成人网在线| 爽爽淫人综合网网站| 欧美日韩电影一区| 日本欧美大码aⅴ在线播放|