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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? instancereader.java

?? 本程序是用java語言編寫的數(shù)據(jù)挖掘分類算法中的決策樹分類方法c4.5程序代碼
?? JAVA
?? 第 1 頁 / 共 3 頁
字號:
                }
            }
        }
        
        //if the weight is set and ignoreWeightColumn is specified, the weight
        //column MUST be unmapped
        if(fileSchema.get_weight_column() != unmapped &&
        assimMap[fileSchema.get_weight_column()] != unmapped &&
        fileSchema.get_weight_column() != 0) {
            Error.err("InstanceReader::constuct_assim_map: the "
            +"column "+fileSchema.attrInfos[fileSchema.get_weight_column()].name() + " is mapped "
            +"to both the weight and attribute "
            + assimMap[fileSchema.get_weight_column()] +" yet WEIGHT_IS"
            +"_ATTRIBUTE is falst -->fatal_error");
        }
        
        //if the label exists. replace with the list's label schema
        if(fileSchema.get_label_column() != unmapped){
            if(is_labelled() == false)
                Error.err("InstanceReader::construct_assim_map:"
                +" attempting to assimilate labelled data to unlabelled data "
                +" -->fatal_error");
            fileSchema.set_attr_info(fileSchema.get_label_column(),
            get_schema().label_info());
        }
        
        //make sure all attributes in the destination schema were accounted for.
        //Its ok to leave the lavel or weight unmapped, in this case you can use
        //the set_..._label() and set_weight() functions.
        if(checkCount < checklist.length){
            Error.err("InstanceReader::constuct_assim_map: the"
            +" following required attributes were unaccounted for: ");
            for(int i =0;i<checklist.length;i++){
                if(!checklist[i]){
                    System.out.print("\"" + get_schema().attr_info(i).name() + "\" ");
                }
            }
            Error.err("fatal_error");
        }
    }
    
    /** Releases the list we're building.
     * @return The InstanceList being built by this InstanceReader.
     */
    public InstanceList release_list() {
        //if we're not making extra values into unknowns, warn about
        //projected columns
        if(!makeUnknowns)
            warn_projected_columns();
        //it is an error to release a list when an instance is partially
        //added
        if(anySet)
            Error.err("InstanceReader::release_list: cannot"
            +" release a list with a partially built instance.  Use "
            +"set_complete() to finish off the instance with unknown"
            +" values -->fatal_error");
        
        //release ownership and return
        InstanceList retList = instList;
        instList = null;
        fileSchema = null;
        return retList;
    }
    
    /** Sets the value of an attribute from an MLJ format data file.
     *
     * @param attrNum The number of the attribute being read.
     * @param dataFile The BufferedReader reading the file.
     */
    public void set_from_file(int attrNum, BufferedReader dataFile) {
        //check range on the incoming attrNum
        if(attrNum < 0 || attrNum > fileSchema.num_attr())
            Error.err("InstanceReader::set_from_file: "
            +"attribute number "+attrNum+" is out of range-->fatal_error");
        
        //map attribute number, but keep original for later calls
        int mapNum = assimMap[attrNum];
        
        //read the attribute value from the file
        AttrValue attrVal = fileSchema.attrInfos[attrNum].read_attr_value(dataFile, makeUnknowns, fileSchema);
        if(mapNum==unmapped){
            if(fileSchema.get_ignore_weight_column() &&
            attrNum==fileSchema.get_weight_column()){
                //set the weight
                double val = fileSchema.attrInfos[attrNum].get_real_val(attrVal);
                weight = val;
            }
            return; //ignore unmapped attributes from here on
        }
        
        //determine type of attribute, and call the appropriate function instead.
        AttrInfo ai = fileSchema.attrInfos[attrNum];
        
        if(ai.is_unknown(attrVal)){
            set_unknown(attrNum);
        }
        else if(ai.can_cast_to_real()){
            
            double val = ai.get_real_val(attrVal);
            set_real(attrNum, val);
        }
        else if(ai.can_cast_to_nominal()){
            String strVal = ai.attrValue_to_string(attrVal);
            set_nominal(attrNum, strVal);
        }
        else
            Error.err("InstanceReader::set_from_file: reader "
            +"only supports real and nominal types -->fatal_error");
    }
    
    /** Sets the value of an attribute from an MLJ format data file.
     *
     * @param attrNum The number of the attribute being read.
     * @param dataFile The StreamTokenizer reading from the file.
     */
    public void set_from_file(int attrNum, StreamTokenizer dataFile) {
        //check range on the incoming attrNum
        if(attrNum < 0 || attrNum > fileSchema.num_attr())
            Error.err("InstanceReader::set_from_file: "
            +"attribute number "+attrNum+" is out of range-->fatal_error");
        
        //map attribute number, but keep original for later calls
        int mapNum = assimMap[attrNum];
        
        //read the attribute value from the file
        AttrValue attrVal = fileSchema.attrInfos[attrNum].read_attr_value(dataFile, makeUnknowns, fileSchema);
        if(mapNum==unmapped){
            if(fileSchema.get_ignore_weight_column() &&
            attrNum==fileSchema.get_weight_column()){
                //set the weight
                double val = fileSchema.attrInfos[attrNum].get_real_val(attrVal);
                weight = val;
            }
            return; //ignore unmapped attributes from here on
        }
        
        //determine type of attribute, and call the appropriate function instead.
        AttrInfo ai = fileSchema.attrInfos[attrNum];
        
        if(ai.is_unknown(attrVal)){
            set_unknown(attrNum);
        }
        else if(ai.can_cast_to_real()){
            
            double val = ai.get_real_val(attrVal);
            set_real(attrNum, val);
        }
        else if(ai.can_cast_to_nominal()){
            String strVal = ai.attrValue_to_string(attrVal);
            set_nominal(attrNum, strVal);
        }
        else
            Error.err("InstanceReader::set_from_file: reader "
            +"only supports real and nominal types -->fatal_error");
    }
    
    /** Adds the instance to the list. The instance must be fully constructed and must
     * have its label set. Also, you may not add the same instance twice.
     *
     * @return The Instance being added.
     */
    public Instance add_instance() {
        for(int i=0;i<setAttr.length;i++)
            if(assimMap[i]!=unmapped && !setAttr[i])
                Error.err("InstanceReader::add_instance: "
                +"you forgot to set attribute "+i+" ("
                +fileSchema.attrInfos[i].name()+")\n Use the set_complete() "
                +"to give unknown values to extra attributes -->fatal_Error");
        
        //set up small array of values for list
        AttrValue labelVal = null;
        AttrValue[] listVals = new AttrValue[get_schema().num_attr()];
        for(int i=0;i<assimMap.length;i++) {
            int mapNum = assimMap[i];
            if(mapNum>=0)
                listVals[mapNum] = vals[i];
            else if(mapNum == mapToLabel){
                //ASSERT(labelVal == null);
                labelVal = vals[i];
            }
        }
        
        //reset status bits for the next add
        //can't reset the weight before its used, so we have to
        //reset it independently for each branch of the if below.
        
        for(int i=0;i<setAttr.length;i++)
            setAttr[i] = false;
        anySet = false;
        
        if(is_labelled()){
            //ASSERT(labelVal);
            Instance inst =
            instList.reader_add_instance(listVals,labelVal,weight,
            allowUnknownLabels);
            if(attrValueLimit!=0)
                update_for_overflows();
            weight = 1.0;
            return inst;
        }
        else {
            //ASSERT(labelVal==null)
            Instance inst =
            instList.reader_add_instance(listVals,null,weight,false);
            if(attrValueLimit!=0)
                update_for_overflows();
            weight = 1.0;
            return inst;
        }
    }
    
    private void build_proj_maps(boolean[] readerProjMap, boolean[] listProjMap) {
        //ASSERT(readerProjMap.lenght == assimMap.length);
        Schema schema = get_schema();
        int numAttr = schema.num_attr();
        //ASSERT(listProjMap.length >= numAttr);
        
        //Both projection maps begin as all true;
        for(int i=0;i<readerProjMap.length;i++)
            readerProjMap[i] = true;
        for(int i=0;i<numAttr;i++)
            listProjMap[i] = true;
        
        //Run through the attributes in the names file. Check the number of
        //values for each nominal. If anything exceeds the limit, add it to the
        //map.  Also add attributes which are being deliberately ignored.
        for(int i=0;i<fileSchema.num_attr();i++){
            int numVals = 0;
            if(assimMap[i] >= 0){
                if(fileSchema.attrInfos[i].can_cast_to_nominal()) {
                    numVals = fileSchema.attrInfos[i].cast_to_nominal().num_values();
                    
                    //check the number of values here against the counterpart attr
                    // info in the list.  If these don't match, we have failed
                    //to update our attr infos correctly
                    int listNumVals = schema.attr_info(assimMap[i]).cast_to_nominal().num_values();
                    if(numVals != listNumVals)
                        Error.err("InstanceReader::build_proj_maps:"
                        +" number of values for attribute" + schema.attr_name(i)
                        +" is inconsistent; reader's FileSchema has "+numVals
                        +" while list has "+listNumVals+" -->fatal_error");
                    
                    //if we've exceeded the number of values, set entries in
                    // each map to false;
                    if(numVals > attrValueLimit) {
                        readerProjMap[i] = false;
                        listProjMap[assimMap[i]] = false;
                    }
                    
                    //if the attribute is marked to be ignored, set to false
                    if(fileSchema.attrInfos[i].cast_to_nominal().get_ignore()) {
                        readerProjMap[i] = false;
                        listProjMap[assimMap[i]] = false;
                    }
                }
            }
        }
    }
    
    private void update_assim_map(boolean[] projMap) {
        int displacement = 0;
        
        //ASSERT(projMap.length == asimMap.length);

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
av资源网一区| 日韩精品一区二区三区在线观看 | 91麻豆精品国产91久久久| 精品国产一区二区三区久久影院 | 久久天天做天天爱综合色| 1024成人网色www| 美洲天堂一区二卡三卡四卡视频| 不卡的电视剧免费网站有什么| 欧美一区三区四区| 亚洲精品一二三| 成人免费视频caoporn| 日韩手机在线导航| 亚洲国产精品一区二区久久 | 精品视频在线免费| 亚洲男人的天堂av| 成人性生交大片免费看中文 | 欧美一区二区网站| 亚洲综合丝袜美腿| 色素色在线综合| 国产精品高潮久久久久无| 国产精品996| 精品久久国产字幕高潮| 日韩一区欧美二区| 欧美色窝79yyyycom| 悠悠色在线精品| 色综合一区二区| 国产精品人成在线观看免费| 国产精品一区二区不卡| 精品日产卡一卡二卡麻豆| 男女激情视频一区| 日韩一二三四区| 久久国产精品第一页| 欧美大片一区二区| 久久爱另类一区二区小说| 精品999久久久| 精品一区二区免费视频| 精品久久久久久无| 国产精品一区二区果冻传媒| 国产日韩欧美精品电影三级在线| 国产一区二区三区免费看| 久久午夜羞羞影院免费观看| 韩国一区二区在线观看| 久久精品免费在线观看| 成人av电影在线| 亚洲欧美激情一区二区| 欧美体内she精视频| 天天操天天干天天综合网| 91麻豆精品91久久久久久清纯 | 亚洲国产一二三| 欧美日韩的一区二区| 青青草一区二区三区| 精品国产欧美一区二区| 国产精品一区二区果冻传媒| 中文字幕一区二区5566日韩| 91国偷自产一区二区开放时间 | 亚洲在线观看免费| 91精品国产综合久久小美女| 韩日精品视频一区| 亚洲欧美欧美一区二区三区| 欧美一区二区在线观看| 国产成人午夜精品影院观看视频| 中文字幕一区二区在线播放 | 一本大道久久a久久综合| 亚洲一区电影777| 精品剧情在线观看| 色综合久久久久综合| 蜜桃精品视频在线观看| 国产精品大尺度| 日韩网站在线看片你懂的| 成人精品一区二区三区四区 | 亚洲国产精品高清| 欧美亚洲一区二区在线| 国产中文一区二区三区| 亚洲精品视频在线观看网站| 欧美电影免费观看完整版| 国产成人av影院| 午夜欧美在线一二页| 中文字幕欧美国产| 欧美日韩国产三级| 国产成人啪免费观看软件| 亚洲尤物视频在线| 国产精品久久久久久福利一牛影视| 欧美日韩一区二区三区视频| 高清免费成人av| 久久精品理论片| 亚洲大片在线观看| 亚洲人成精品久久久久| 久久久电影一区二区三区| 欧美日韩国产影片| 色综合视频一区二区三区高清| 精品一区二区免费在线观看| 午夜欧美2019年伦理| 亚洲乱码国产乱码精品精可以看| 日韩精品一区二区在线| 7777精品久久久大香线蕉| 91麻豆国产福利在线观看| 成人性生交大片免费看中文| 国产在线播放一区三区四| 婷婷综合另类小说色区| 一级做a爱片久久| 18欧美亚洲精品| 亚洲天堂av一区| 中文字幕亚洲欧美在线不卡| 久久综合99re88久久爱| 欧美成人在线直播| 日韩亚洲欧美一区| 7777精品伊人久久久大香线蕉 | 国产精品不卡在线观看| 久久色在线观看| 欧美成人一级视频| 日韩免费一区二区| 日韩色在线观看| 日韩久久久久久| 日韩免费视频一区| 日韩视频一区在线观看| 欧美一区二区日韩一区二区| 欧美性xxxxx极品少妇| 在线视频欧美精品| 欧美视频中文字幕| 在线成人小视频| 日韩一区二区电影网| 日韩欧美国产电影| 精品国产第一区二区三区观看体验| 51精品国自产在线| 欧美大白屁股肥臀xxxxxx| 欧美va亚洲va在线观看蝴蝶网| 精品国产a毛片| 久久亚洲精品国产精品紫薇| 国产亚洲欧美日韩日本| 国产精品久久久久婷婷二区次| 国产精品久久久久久亚洲毛片| 亚洲视频一区二区免费在线观看| 亚洲老司机在线| 日韩国产高清影视| 国产在线精品一区二区夜色| 国产999精品久久| av在线播放成人| 欧美乱妇15p| 久久久青草青青国产亚洲免观| 国产精品美日韩| 伊人色综合久久天天| 日本欧美在线观看| 国产成人夜色高潮福利影视| 色吧成人激情小说| 精品久久久久久久久久久久久久久久久 | 久久精品这里都是精品| 亚洲免费在线视频一区 二区| 亚洲一二三四在线| 九色综合国产一区二区三区| 国产激情视频一区二区在线观看| 一本久久a久久精品亚洲| 欧美放荡的少妇| 欧美韩日一区二区三区| 亚洲午夜在线电影| 国产在线国偷精品免费看| 91精品91久久久中77777| 欧美mv和日韩mv的网站| 亚洲精品精品亚洲| 精品一区二区三区久久久| 91福利视频久久久久| 欧美成人a∨高清免费观看| 中文字幕亚洲一区二区va在线| 日本午夜一本久久久综合| a在线播放不卡| 精品日韩在线一区| 一区二区三区蜜桃| 国产高清不卡二三区| 欧美日免费三级在线| 2021久久国产精品不只是精品| 亚洲黄网站在线观看| 国产成人午夜高潮毛片| 欧美一区二区三区不卡| 亚洲一区二区综合| 成人av综合在线| 精品美女一区二区三区| 午夜在线成人av| 91理论电影在线观看| 久久久久久一级片| 美女看a上一区| 欧美日韩久久久| 亚洲久本草在线中文字幕| av在线这里只有精品| 久久亚洲综合色一区二区三区| 热久久一区二区| 欧美日韩精品欧美日韩精品| 国产精品二区一区二区aⅴ污介绍| 国产另类ts人妖一区二区| 91精品国模一区二区三区| 亚洲二区视频在线| 欧美性videosxxxxx| 一区二区三区四区亚洲| 97成人超碰视| 亚洲欧洲一区二区三区| 成人理论电影网| 国产精品人人做人人爽人人添 | 欧美日韩午夜在线视频| 一区二区三区四区蜜桃| 91亚洲精华国产精华精华液| 国产精品久久综合| 色哟哟国产精品|