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

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

?? instancereader.java

?? 本程序是用java語言編寫的數(shù)據(jù)挖掘分類算法中的決策樹分類方法c4.5程序代碼
?? JAVA
?? 第 1 頁 / 共 3 頁
字號:
package shared;
import java.io.*;

/** Provide a set of functions for reading a list of instances from a source which
 * provides a single instance at a time, attribute by attribute. Supports the
 * exclusion of nominal attributes which have more than a set limit on the number
 * of values.
 * @author James Louis Java Implmentation.
 * @author Dan Sommerfield 5/03/96 Initial revision (.h, .c)
 *
 */
public class InstanceReader {
    /** The InstanceList in which are stored Instances that are read.
     */
    private InstanceList instList;
    /** TRUE if unknown values for attributes are possible, FALSE otherwise.
     */
    private boolean makeUnknowns;
    /** TRUE if unknown labels are possible, FALSE otherwise.
     */
    private boolean allowUnknownLabels;
    /** The FileSchema detailing the data being read by this InstanceReader.
     */
    private FileSchema fileSchema;
    
    /** Values possible for the attributes.
     */
    private AttrValue[] vals;
    private boolean[] setAttr;
    private boolean anySet;
    private int attrValueLimit;
    /** The total weight of Instances.
     */
    private double weight;
    private boolean warnOnSetComplete;
    private int[] assimMap;
    private boolean[] projMap;
    /**
     */
    private boolean[] listProjMap;
    //private QuarkTable[] quarkTables;
    
    /** Special value for mapping operations. Any integer value is valid.
     */
    public static final int unmapped = -1;
    /** Special value for mapping operations. Any integer value is valid.
     */
    public static final int mapToLabel = -2;
    
    /** Constructor. Builds an InstanceReader which can be used to construct instances
     * for ownerList. OwnerList MUST have a FileSchema associated with it; this
     * defines the form of all incoming data. The data will be ASSIMILATED to the form
     * of ownerList's schema as it is read.                                        <BR>
     * The limit parameter specifies an optional limit on the number of distinct
     * attribute values which are allowed on any given attribute.  If this limit is
     * exceeded, the attribute in question will be projected out, and future incoming
     * data for that attribute will be ignored.                                    <BR>
     * The makeUnknown parameter, if TRUE, will cause all attribute values not present
     * in ownerList's schema to be converted to UNKNOWN.                           <BR>
     * NOTE: for reading test data, limit should be set to 0 and makeUnknown should be
     * TRUE.
     * @param ownerList The InstaceList in which Instances will be stored.
     */
    public InstanceReader(InstanceList ownerList){	//ADDED BY JL
        this(ownerList,0,false,false);}
    /** Constructor. Builds an InstanceReader which can be used to construct instances
     * for ownerList. OwnerList MUST have a FileSchema associated with it; this
     * defines the form of all incoming data. The data will be ASSIMILATED to the form
     * of ownerList's schema as it is read.                                        <BR>
     * The limit parameter specifies an optional limit on the number of distinct
     * attribute values which are allowed on any given attribute.  If this limit is
     * exceeded, the attribute in question will be projected out, and future incoming
     * data for that attribute will be ignored.                                    <BR>
     * The makeUnknown parameter, if TRUE, will cause all attribute values not present
     * in ownerList's schema to be converted to UNKNOWN.                           <BR>
     * NOTE: for reading test data, limit should be set to 0 and makeUnknown should be
     * TRUE.
     * @param ownerList The InstaceList in which Instances will be stored.
     * @param limit The limit number of how many attribute values are possible.
     */
    public InstanceReader(InstanceList ownerList, int limit){	//ADDED BY JL
        this(ownerList,limit,false,false);}
    /** Constructor. Builds an InstanceReader which can be used to construct instances
     * for ownerList. OwnerList MUST have a FileSchema associated with it; this
     * defines the form of all incoming data. The data will be ASSIMILATED to the form
     * of ownerList's schema as it is read.                                        <BR>
     * The limit parameter specifies an optional limit on the number of distinct
     * attribute values which are allowed on any given attribute.  If this limit is
     * exceeded, the attribute in question will be projected out, and future incoming
     * data for that attribute will be ignored.                                    <BR>
     * The makeUnknown parameter, if TRUE, will cause all attribute values not present
     * in ownerList's schema to be converted to UNKNOWN.                           <BR>
     * NOTE: for reading test data, limit should be set to 0 and makeUnknown should be
     * TRUE.
     * @param ownerList The InstaceList in which Instances will be stored.
     * @param limit The limit number of how many attribute values are possible.
     * @param makeUnknown TRUE if unknown values for attributes are possible, FALSE otherwise.
     */
    public InstanceReader(InstanceList ownerList, int limit, boolean makeUnknown){	//ADDED BY JL
        this(ownerList,limit,makeUnknown,false);}
    
    /** Constructor. Builds an InstanceReader which can be used to construct instances
     * for ownerList. OwnerList MUST have a FileSchema associated with it; this
     * defines the form of all incoming data. The data will be ASSIMILATED to the form
     * of ownerList's schema as it is read.                                        <BR>
     * The limit parameter specifies an optional limit on the number of distinct
     * attribute values which are allowed on any given attribute.  If this limit is
     * exceeded, the attribute in question will be projected out, and future incoming
     * data for that attribute will be ignored.                                    <BR>
     * The makeUnknown parameter, if TRUE, will cause all attribute values not present
     * in ownerList's schema to be converted to UNKNOWN.                           <BR>
     * NOTE: for reading test data, limit should be set to 0 and makeUnknown should be
     * TRUE.
     * @param ownerList The InstaceList in which Instances will be stored.
     * @param limit The limit number of how many attribute values are possible.
     * @param makeUnknown TRUE if unknown values for attributes are possible, FALSE otherwise.
     * @param allowUnknownLab TRUE if unknown labels are possible, FALSE otherwise.
     */
    public InstanceReader(InstanceList ownerList, int limit, boolean makeUnknown, boolean allowUnknownLab) {
        instList = ownerList;
        makeUnknowns = makeUnknown;
        allowUnknownLabels = allowUnknownLab;
        
        setAttr = new boolean[ownerList.get_original_schema().num_attr()];
        for(int i=0;i<setAttr.length;i++)setAttr[i]=false;
        
        anySet = false;
        attrValueLimit = limit;
        weight = 1.0;
        fileSchema = ownerList.get_original_schema();
        
        vals = new AttrValue[ownerList.get_original_schema().num_attr()];
        for(int j=0;j<vals.length;j++)vals[j]=new AttrValue();///ADDED BY JL
        
        assimMap = new int[ownerList.get_original_schema().num_attr()];
        for(int i=0;i<assimMap.length;i++)assimMap[i]=-1;
        
        projMap = new boolean[ownerList.get_original_schema().num_attr()];
        listProjMap = new boolean[ownerList.get_original_schema().num_attr()];
        //quarkTables(0,ownerList.get_original_schema().num_attr(),null)
        warnOnSetComplete = true;
        
        //fileSchema.OK();
        if(attrValueLimit < 0)
            Error.err("InstanceReader::InstanceReader: negative"
            + " value is not allowed for attrValueLimit->fatal_error");
        
        //construct the assimilation map to be used during set functions
        construct_assim_map();
        
        //take ownership of the list we're building
        ownerList = null;
        //OK();
    }
    
    /** Attempts to match values for two fixed value set nominals. Prints an error
     * message on failure.
     * @param name The name of the attribute.
     * @param a1 The first nominal being compared.
     * @param a2 The second nominal being compared.
     */
    public void match_values(String name, NominalAttrInfo a1, NominalAttrInfo a2) {
        boolean error = false;
        //ASSERT(a1.is_fixed());
        //ASSERT(a2.is_fixed());
        if(a1.num_values() != a2.num_values())
            error = true;
        else{
            //         for(int i = 0;i<a1.num_values();i++) //CHANGED FOR ZOO TESTSET -JL
            for(int i = Globals.FIRST_NOMINAL_VAL; i < a1.num_values();i++)
                if(a1.get_value(i) != a2.get_value(i))
                    error = true;
        }
        if(error){
            Error.err("InstanceReader::match_values: mismatch"
            +" in fixed nominals for attribute \"" + name + "\": ");
            Error.err("taining version: ");
            a1.display_attr_values();
            Error.err("testing version: ");
            a2.display_attr_values();
            Error.err(" -->fatal_error");
        }
    }
    
    /** Constructs the assimilation map used to map attribute numbers used in the
     * assimilation schema (set functions) into numbers used in the list's schema.
     *
     */
    private void construct_assim_map() {
        //mark the label column as mapped to the label
        if(fileSchema.get_label_column() != unmapped)
            assimMap[fileSchema.get_label_column()] = mapToLabel;
        
        //for each attribute name in the file schema (test data), find the
        //same name in the list's schema(training data) and establish the mapping
        //No attributes in the list's schema may be left unaccounted for.
        
        int numDestAttr = get_schema().num_attr();
        boolean[] checklist = new boolean[numDestAttr];
        for(int i=0;i<checklist.length;i++)checklist[i]=false;
        int checkCount = 0;
        for(int i=0;i<fileSchema.num_attr();i++){
            for(int j=0;j<numDestAttr;j++){
                String name = fileSchema.attrInfos[i].name();
                if(name.equals(get_schema().attr_name(j))) {
                    //make sure the column is not mapped to some other column.
                    //if it is mapped to the label or weight, then ignore it.
                    //ASSERT(assimMap[i] != false);
                    if(assimMap[i] == unmapped){
                        assimMap[i] = j;
                        checkCount++;
                        checklist[j] = true;
                        
                        //assimilate attribute infos. Thre are some rules here:
                        // 1. if the types don't match, it is an error.
                        // 2. if both are fixed nominals, the exact values must match
                        // 3. if the list's schema is an unfixed nominal, use it
                        // 4. if the list's schema is a fixed nominl, but the file
                        //    schema specifies an unfixed noinal, create an unfixed
                        //    nominal with the values from the list's schema's
                        //    fixed nominal.
                        AttrInfo testAI = fileSchema.attrInfos[i];
                        AttrInfo trainAI = get_schema().attr_info(j);
                        if(trainAI.can_cast_to_nominal()) {
                            //make sure the nominal types match
                            if(!testAI.can_cast_to_nominal())
                                Error.err("InstanceReader::constuct_"
                                + "assim_map: training schema requires a nominal "
                                + "for attribute \"" +name+"\" -->fatal_error");
                            
                            // other nominal checks
                            NominalAttrInfo testNAI = testAI.cast_to_nominal();
                            NominalAttrInfo trainNAI = trainAI.cast_to_nominal();
                            
                            //check fixed/unfixed status
                            if(trainNAI.is_fixed()) {
                                if(testNAI.is_fixed()) {
                                    //by rule#2, the exact values must match
                                    match_values(name, trainNAI, testNAI);
                                }
                                else{
                                    //replace attribute info for test data with the
                                    //training version, but make unfixed(rule #4)
                                    fileSchema.set_attr_info(i,trainAI);
                                    fileSchema.attrInfos[i].cast_to_nominal().fix_values(false);
                                }
                            }
                            else {
                                //just use the training version (rule #3)
                                fileSchema.set_attr_info(i,trainAI);
                            }
                        }
                        else if(trainAI.can_cast_to_real()) {
                            if(!testAI.can_cast_to_real())
                                Error.err("InstanceReader::construct_"
                                +"assim_map: training schema requires a numerical "
                                +"value for attribute \"" +name+"\" -->fatal_error");
                        }
                        else
                            Error.err("InstanceReader::construct_"
                            +"assim_map: training schema contains an attribute \""
                            +name+"\" which is neither real nor nominal-->fatal_error");
                    }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99精品视频在线免费观看| 日本va欧美va精品| 99精品偷自拍| 亚洲精品菠萝久久久久久久| 91网站在线播放| 亚洲成人av一区二区| 91.com在线观看| 狠狠色丁香九九婷婷综合五月| 久久你懂得1024| 91日韩精品一区| 婷婷丁香久久五月婷婷| 欧美成人a视频| av网站免费线看精品| 夜夜嗨av一区二区三区四季av | 一二三四社区欧美黄| 欧美乱熟臀69xxxxxx| 精品在线免费视频| 国产精品全国免费观看高清 | 欧美日韩一区二区三区免费看| 亚洲国产aⅴ成人精品无吗| 欧美一区二区三区视频免费播放| 久久福利资源站| 国产精品嫩草影院com| 色婷婷精品大在线视频| 日韩电影网1区2区| 国产精品三级电影| 欧美丰满少妇xxxbbb| 国产成人aaaa| 日韩av一区二区在线影视| 国产欧美日韩在线观看| 欧美在线小视频| 国产一区二区三区高清播放| 亚洲精品国产品国语在线app| 国产精品色噜噜| 欧美一区日本一区韩国一区| 国产精品1区2区3区| 亚洲成在人线在线播放| 亚洲国产精品99久久久久久久久| 欧美老肥妇做.爰bbww| 成人免费毛片片v| 久久精品国产999大香线蕉| 亚洲精品水蜜桃| 久久亚洲综合色一区二区三区| 欧美在线视频不卡| 99久久99久久精品国产片果冻| 日韩av电影一区| 亚洲另类春色国产| 久久久国产午夜精品 | 日韩成人免费在线| 成人免费在线观看入口| 337p粉嫩大胆色噜噜噜噜亚洲| 色菇凉天天综合网| 成人av免费在线播放| 精品一区二区在线看| 午夜私人影院久久久久| 国产精品婷婷午夜在线观看| 日韩欧美黄色影院| 欧美日本一道本在线视频| 91天堂素人约啪| 成人国产亚洲欧美成人综合网| 另类小说图片综合网| 男女性色大片免费观看一区二区 | 激情综合网最新| 日韩精品午夜视频| 一区二区三区精品视频在线| 国产精品另类一区| 国产精品美女www爽爽爽| 2020国产精品自拍| 欧美电视剧免费全集观看| 8v天堂国产在线一区二区| 欧美日韩极品在线观看一区| 欧洲av在线精品| 色婷婷亚洲精品| 91激情在线视频| 色欧美88888久久久久久影院| 99国产精品国产精品毛片| av一区二区三区四区| 色综合天天综合| 色琪琪一区二区三区亚洲区| 欧美综合亚洲图片综合区| 91福利在线播放| 欧美日本视频在线| 日韩午夜在线观看视频| 日韩欧美一二区| 久久色中文字幕| 国产精品麻豆久久久| 国产精品的网站| 亚洲九九爱视频| 亚洲午夜成aⅴ人片| 视频一区在线视频| 精品一区二区免费看| 国产传媒久久文化传媒| 成人国产精品免费观看视频| 91最新地址在线播放| 欧美私模裸体表演在线观看| 717成人午夜免费福利电影| 欧美大尺度电影在线| 国产亚洲综合性久久久影院| 国产精品久久久久aaaa| 一区二区三区在线不卡| 天堂资源在线中文精品| 久久精品国产亚洲5555| 国产高清不卡一区| 91福利社在线观看| 91精品国产综合久久香蕉的特点| 亚洲精品一区二区精华| 中文字幕亚洲一区二区va在线| 亚洲一区在线免费观看| 日本中文一区二区三区| 成人一区二区三区在线观看| 99精品欧美一区二区三区综合在线| 欧美午夜精品一区二区蜜桃| 精品剧情在线观看| 亚洲女女做受ⅹxx高潮| 卡一卡二国产精品 | 亚洲免费观看视频| 日韩二区三区四区| 99久久伊人久久99| 欧美一区二区三区婷婷月色| 国产三区在线成人av| 性做久久久久久免费观看| 国产剧情在线观看一区二区| 日本道精品一区二区三区| 精品国产91洋老外米糕| 一区二区三区四区在线免费观看| 日本网站在线观看一区二区三区| 成人av网在线| 亚洲精品一区在线观看| 亚洲bdsm女犯bdsm网站| 国产精品亚洲成人| 日韩欧美区一区二| 亚洲综合色在线| 国产精品18久久久| 日韩精品一区二区三区蜜臀| 亚洲国产精品久久久久秋霞影院| 丰满亚洲少妇av| 欧美人牲a欧美精品| 日韩一区欧美一区| 国产高清在线观看免费不卡| 日韩欧美一级二级三级 | 日韩中文字幕不卡| 91免费在线视频观看| 久久奇米777| 蜜桃一区二区三区在线观看| 色猫猫国产区一区二在线视频| 久久久久久免费网| 久久99热99| 91精品国产91久久综合桃花 | 日韩欧美激情四射| 亚洲成av人片| 欧美日韩中文一区| 国内精品在线播放| 91精品欧美综合在线观看最新| 成人欧美一区二区三区| 不卡区在线中文字幕| 久久久久高清精品| 狠狠色狠狠色合久久伊人| 日韩精品自拍偷拍| 奇米精品一区二区三区四区| 欧美日韩一区成人| 亚洲高清中文字幕| 在线不卡中文字幕| 五月天丁香久久| 欧美日韩国产经典色站一区二区三区| 亚洲婷婷综合色高清在线| 成人av电影在线播放| 国产精品免费看片| 成人app下载| 国产精品久久久久影视| www.视频一区| 亚洲欧美色图小说| 欧美三级中文字幕在线观看| 亚洲高清在线精品| 91超碰这里只有精品国产| 日本最新不卡在线| 精品国产免费久久| 国产精品性做久久久久久| 国产欧美日本一区视频| 成人丝袜高跟foot| 亚洲欧美日韩国产一区二区三区 | 欧洲一区二区三区在线| 亚州成人在线电影| 欧美一区二区三区免费大片| 免费在线看一区| 2020国产精品| 91蜜桃网址入口| 亚洲第一福利视频在线| 日韩欧美区一区二| 顶级嫩模精品视频在线看| 国产精品国产三级国产aⅴ原创| 色婷婷久久一区二区三区麻豆| 午夜视频在线观看一区二区三区| 欧美不卡一区二区三区四区| 一本在线高清不卡dvd| 成a人片国产精品| 亚洲免费电影在线| 日韩一区二区在线看| 国产成人av资源| 亚洲一区二区高清| 欧美成人精品二区三区99精品|