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

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

?? instancereader.java

?? 本程序是用java語言編寫的數據挖掘分類算法中的決策樹分類方法c4.5程序代碼
?? JAVA
?? 第 1 頁 / 共 3 頁
字號:
        
        //the following algorithm is based on identifying "newly removed"
        //attributes.  A newly removed attribute is one which has a valid
        //(i.e. >= 0) entry in the assim map, but a false in the projMap.
        //For each newly removed attribute, set it to unmapped in the
        //assim map and increment displacement.
        //Also, throughout the loop decrement the assimilation values of
        //any valid attribtes by displacement.  This will correct for
        //the newly removed attributes.
        for(int i=0; i< projMap.length;i++) {
            if(assimMap[i] >= 0) {
                if(projMap[i] == false) {
                    //newly removed
                    displacement++;
                    assimMap[i] = unmapped;
                }
                else {
                    //decrement by displacement to correct for other removed attrs
                    assimMap[i] -= displacement;
                    //ASSERT(assimMap[i] >= 0);
                }
            }
        }
    }
    
    private void update_for_overflows() {
        build_proj_maps(projMap, listProjMap);
        instList.update_for_overflows(listProjMap);
        update_assim_map(projMap);
    }
    
    private int warn_projected_columns() {
        //LOG(5, "Checking schema againts names-file schema);
        //ASSERT(fileSchema);
        
        int attrNum = 0;
        int origAttrNum = 0;
        int numIgnored = 0;
        
        Schema schema = get_schema();
        while(origAttrNum <  fileSchema.num_attr()) {
            if(attrNum < schema.num_attr())
                ;//LOG(5, "Schema: attr "+attrNum+" ("
            //+ schema.attr_name(attrNum) +").");
            else
                ;//LOG(5, "Schema: no more attrs.");
            
            //LOG(5, "Original: attr " + origAttrNum +" ("
            //   + fileSchema.attrInfos[origAttrNum].name() + ").");
            
            //If the left out column is a weight or label, don't do anything
            //Only leave out the weight if ignoreWeightColumn is set.
            if(fileSchema.get_label_column() == origAttrNum ||
            (fileSchema.get_weight_column() == origAttrNum &&
            fileSchema.get_ignore_weight_column()))
                ; //ignore this case
            
            //Check names.  If they match, we're ok and we increment
            // out index.  If not, print a warning
            else if(attrNum < schema.num_attr() &&
            schema.attr_name(attrNum) ==
            fileSchema.attrInfos[origAttrNum].name() )
                attrNum++;
            else{
                //Only nominals should get left out.  If it's not nominal,
                // then it's an error
                AttrInfo ai = fileSchema.attrInfos[origAttrNum];
                if(!ai.can_cast_to_nominal())
                    Error.err("InstanceList::diff_original"
                    +"_schema: non-nominal attribute "+ai.name()+" was "
                    +"projected out -->fatal_error");
                NominalAttrInfo nai = ai.cast_to_nominal();
                if(nai.num_values() >= attrValueLimit)
                    System.out.println("Warning-->attribute "+ai.name()
                    +" ignored: exceeded "+attrValueLimit+ " values.");
                else if(nai.num_values() == 0)
                    System.out.println("Warning-->attribute "+ai.name()
                    +" this attribtue has no values except unknowns.");
                else if(nai.get_ignore())
                    System.out.println("Warning-->attribute "+ai.name()
                    +"ignored: ignore flag set.");
                else
                    Error.err("InstanceReader::warn_on...:"
                    +"attribute "+ai.name() +" was poject out for an "
                    +"invalid reason -->fatal_error");
                
                numIgnored++;
            }
            
            origAttrNum++;
        }
        
        if(numIgnored > 0)
            ;//LOG(1, "\nWarning: some attributes are ignored.  The default"
        //+" limit of +"attrValueLimit+" may be increased\n"
        //+" by changing the MAX_ATTR_VALS paramter");
        
        //if no attributes remain, post a warning
        if(schema.num_attr()==0)
            Error.err("InstanceReader::warn_projected_columns"
            +": all attributes have been ignored!  This example is probably"
            +" no useful for learnign -->fatal_error");
        
        //Make sure we've accounted for all attributes in this schema
        //ASSERT(origAttrNum == fileSchema.num_attr());
        //ASSERT(attrNum == schema.num_attr());
        return numIgnored;
        
    }
    
    /** Checks if the Instance being read is labelled.
     * @return TRUE if the Instance is labelled, FALSE otherwise.
     */
    public boolean is_labelled(){return get_schema().is_labelled();}
    
    private void prepare_to_set(int attrNum, boolean isNominal, boolean isReal) {
        //check range on the incoming attrNum
        if(attrNum < 0 || attrNum > fileSchema.num_attr())
            Error.err("InstanceReader::prepare_to_set: "
            +"attribute number "+attrNum+" is out of range -->fatal_error");
        
        if(isNominal && isReal)
            Error.err("InstanceReader::prepare_to_set: "
            +"isNominal and isReal may not both be set -->fatal_error");
        
        if(isNominal && !fileSchema.attrInfos[attrNum].can_cast_to_nominal())
            Error.err("InstanceReader::prepare_to_set: "
            +"attempted to call a nominal setting function on a non-nominal"
            +" attribute -->fatal_error");
        
        if(isReal && !fileSchema.attrInfos[attrNum].can_cast_to_real())
            Error.err("InstanceReader::prepare_to_set: "
            +"attempted to call a real setting function on a non-real"
            +" attribute -->fatal_error");
        
        if(setAttr[attrNum])
            Error.err("InstanceReader::prepare_to_set: "
            +"attribute "+attrNum+" was already set -->fatal_Error");
        
        setAttr[attrNum] = true;
        anySet = true;
    }
    
    /** Returns the Schema being used to read data.
     * @return The Schema containing details about the file beinig read.
     */
    public Schema get_schema() {
        check_has_list();
        return instList.get_schema();
    }
    
    private void check_has_list() {
        if(!has_list())
            Error.err("InstanceReader::check_has_list: "
            +"this reader has had its list released -->fatal_error");
    }
    
    /** Checks if this InstanceReader has an InstanceList to store Instances in.
     * @return TRUE if there is an InstanceList present, FALSE otherwise.
     */
    public boolean has_list() {
        return instList != null;
    }
    
    /** Explicitly sets a nominal value. The attribute's type must support nominal.
     *
     * @param attrNum The number of the attribute containing the nominal value.
     * @param attrVal The value to be set as a nominal value.
     */
    public void set_nominal(int attrNum, String attrVal) {
        prepare_to_set(attrNum, true, false);
        //map attribute number if needed. If it doesn't map, return
        int mapNum = assimMap[attrNum];
        
        //map to label if requested. Do nothing if unmapped.  You cannot
        //map a nominal to the weight so abort if this is requested.
        if(mapNum==unmapped) {
            return;
        }
        else if(mapNum==mapToLabel){
            //ASSERT(fileSchema.get_label_column() != unmapped);
            if(vals[attrNum]==null)vals[attrNum]=new AttrValue();
            get_schema().label_info().cast_to_nominal().set_nominal_string(vals[attrNum], attrVal,makeUnknowns);
            
        }
        else {
            //set the value in vals from the list's attribute info.  If
            //makeUnknowns is set, we need to check if the value exists.
            //if not, don't add it but rather set an unknown value.
            if(vals[attrNum]==null)vals[attrNum]=new AttrValue();
            get_schema().attr_info(mapNum).cast_to_nominal().set_nominal_string(vals[attrNum],attrVal, makeUnknowns);
            
        }
        
        //force an update on the attrInfo in fileSchema if the nominal
        //belongs to a non-fixed attribute.
        //Only do this if makeUnknowns is not set
        if(!makeUnknowns &&
        !fileSchema.attrInfos[attrNum].cast_to_nominal().is_fixed()){
            AttrValue dummyAttrVal = new AttrValue();
            fileSchema.attrInfos[attrNum].set_nominal_string(dummyAttrVal, attrVal,false);
        }
        
    }
    
    /** Explicitly sets a real value. The attribute's type must support real.
     *
     * @param attrNum The number of the attribute containing the real value.
     * @param attrVal The value to be set as a real value.
     */
    public void set_real(int attrNum, double attrVal) {
        //System.out.println("Gets to InstanceReader::set_real--0");//DEBUG BY JL
        prepare_to_set(attrNum, false, true);
        //if this column is mapped to the weight, set the weight.
        if(attrNum==fileSchema.get_weight_column())
            weight = attrVal;
        //System.out.println("Gets to InstanceReader::set_real--1");//DEBUG BY JL
        
        //map attribute number if needed,  if it doesn't map, then just return
        int mapNum = assimMap[attrNum];
        //System.out.println("Gets to InstanceReader::set_real--2");//DEBUG BY JL
        if (vals == null)System.out.println("InstanceReader::set_real--vals == null");//DEBUG BY JL
        if (vals[attrNum] == null)System.out.println("InstanceReader::set_real--vals["+attrNum+"] == null");//DEBUG BY JL
        
        if(mapNum == unmapped)
            return;
        else if(mapNum==mapToLabel)
            //label is a nominal column--should have failed in check above
            Error.err("ABORT_IF_REACHED");
        else
            get_schema().attr_info(mapNum).cast_to_real().set_real_val(vals[attrNum], attrVal);
        //System.out.println("Gets to InstanceReader::set_real--3");//DEBUG BY JL
        
    }
    
    /** Sets an attribute's value to unknown. Works on any type.
     *
     * @param attrNum The number of the attribute for which the unknown value will be inserted.
     */
    public void set_unknown(int attrNum) {
        prepare_to_set(attrNum,false,false);
        if(attrNum == fileSchema.get_weight_column()){
            Error.err("Mcerr:WARNING:setting an unknown weight value ("
            + fileSchema.attrInfos[attrNum].name()+").");
            weight = 0.0;
        }
        
        //map attribute number if needed.  If it doesn't map, then just return
        int mapNum = assimMap[attrNum];
        
        if(mapNum == unmapped)
            return;
        else if(mapNum == mapToLabel)
            //a later process will remove this instance
            get_schema().label_info().set_unknown(vals[attrNum]);
        else
            get_schema().attr_info(mapNum).set_unknown(vals[attrNum]);
    }
    
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99久久99久久综合| 日韩欧美另类在线| 欧美一二三区在线观看| 久久精品欧美日韩| 亚洲国产综合人成综合网站| 国产毛片精品国产一区二区三区| 色哟哟亚洲精品| 国产三级精品三级在线专区| 日本中文字幕不卡| 一本到三区不卡视频| 久久午夜老司机| 日韩电影一区二区三区四区| 色综合久久久网| 欧美极品另类videosde| 美洲天堂一区二卡三卡四卡视频| 在线观看日产精品| 国产精品麻豆99久久久久久| 精品亚洲porn| 51精品国自产在线| 一二三四社区欧美黄| jizz一区二区| 国产精品污网站| 国产精品影音先锋| 久久美女艺术照精彩视频福利播放| 亚洲18色成人| 丝袜诱惑制服诱惑色一区在线观看| av一区二区三区在线| 久久久久高清精品| 国产一区二区主播在线| 欧美成人三级在线| 麻豆精品视频在线观看| 51精品国自产在线| 日本不卡视频在线观看| 欧美肥妇毛茸茸| 日本不卡在线视频| 欧美一区二区三区视频免费 | 三级久久三级久久| 在线免费视频一区二区| 亚洲美女区一区| 欧美伊人久久大香线蕉综合69| 伊人性伊人情综合网| 91蜜桃网址入口| 亚洲最大成人综合| 欧美人牲a欧美精品| 天天色图综合网| 欧美一级欧美三级在线观看| 老司机精品视频一区二区三区| 日韩免费观看高清完整版在线观看| 六月丁香婷婷色狠狠久久| 精品国产污污免费网站入口 | 一本色道**综合亚洲精品蜜桃冫| 亚洲色图一区二区| 欧美视频一区二区三区| 日本不卡一区二区三区| 国产偷国产偷亚洲高清人白洁 | 亚洲精品写真福利| 欧美日韩一区三区| 精品一区二区三区免费视频| 国产欧美日本一区视频| 在线一区二区三区四区五区| 亚洲成人手机在线| 久久亚洲精品国产精品紫薇| 91免费观看在线| 免费国产亚洲视频| 国产精品嫩草99a| 精品视频色一区| 国产精品18久久久久久久网站| 国产精品第四页| 91精品国产欧美一区二区| 国产成人鲁色资源国产91色综| 中文字幕亚洲一区二区va在线| 精品视频123区在线观看| 国产在线精品一区二区三区不卡| 国产精品久久久久久一区二区三区| 欧美日韩国产一区二区三区地区| 国产精品一区二区在线观看网站 | 国内精品免费在线观看| 亚洲女人小视频在线观看| 91精品国产综合久久蜜臀| 丁香激情综合五月| 日韩电影在线免费| 亚洲人成在线播放网站岛国| 日韩视频在线一区二区| 91在线观看地址| 韩国av一区二区三区四区| 亚洲视频你懂的| 国产日韩高清在线| 日韩一级二级三级| 欧美中文字幕不卡| 成人动漫精品一区二区| 久久99精品久久久| 亚洲一级二级三级在线免费观看| 欧美精彩视频一区二区三区| 欧美一区二区国产| 在线观看国产91| 99久久伊人久久99| 从欧美一区二区三区| 久久99精品国产| 日韩在线一二三区| 依依成人精品视频| 亚洲色图一区二区| 亚洲欧美在线aaa| 精品久久久久久无| 欧美成人免费网站| 日韩一区国产二区欧美三区| 在线成人高清不卡| 欧美视频日韩视频在线观看| 91麻豆福利精品推荐| 成人v精品蜜桃久久一区| 久久精品国产在热久久| 美女mm1313爽爽久久久蜜臀| 日本中文在线一区| 免费观看91视频大全| 理论电影国产精品| 国内精品免费在线观看| 国产精品一区免费视频| 国产成人午夜高潮毛片| 国产精品香蕉一区二区三区| 国产精品99久| av一区二区久久| 色香蕉久久蜜桃| 欧美群妇大交群中文字幕| 9191久久久久久久久久久| 日韩视频免费观看高清在线视频| 欧美一级日韩免费不卡| 久久色在线视频| 亚洲国产岛国毛片在线| 国产精品另类一区| 中文字幕一区二区在线观看| 曰韩精品一区二区| 五月天一区二区| 蜜臀99久久精品久久久久久软件| 黄色资源网久久资源365| 国产成人免费在线观看| 色婷婷综合激情| 欧美一三区三区四区免费在线看 | 欧美日本韩国一区二区三区视频 | 欧美日韩国产成人在线免费| 欧美久久久一区| 久久一二三国产| 亚洲天堂av老司机| 日韩和的一区二区| 精彩视频一区二区| 99精品久久久久久| 欧美日韩另类一区| 国产婷婷色一区二区三区在线| 亚洲裸体xxx| 日韩精品成人一区二区三区| 国产一区二区0| 91久久精品国产91性色tv| 国产日韩精品一区二区三区在线| 亚洲色图视频网站| 美女看a上一区| 91免费观看在线| 久久夜色精品国产噜噜av| 亚洲色图欧美在线| 久久黄色级2电影| 91久久国产综合久久| 精品国产sm最大网站免费看| 亚洲欧美一区二区三区极速播放| 奇米色一区二区| 色婷婷久久久亚洲一区二区三区| 精品sm在线观看| 午夜久久电影网| 成人高清免费观看| 欧美va在线播放| 亚洲久本草在线中文字幕| 国产伦精品一区二区三区免费迷| 一本一本大道香蕉久在线精品 | 韩国视频一区二区| 欧美午夜影院一区| 最新国产成人在线观看| 国产综合一区二区| 欧美一级日韩不卡播放免费| 亚洲精品免费电影| 成人高清视频在线| 久久精品亚洲精品国产欧美 | 亚洲人精品一区| 国产一本一道久久香蕉| 欧美日韩国产综合久久| 亚洲色图一区二区三区| 成人午夜免费视频| 日韩欧美成人午夜| 日韩在线a电影| 欧美欧美欧美欧美| 一区二区在线免费| 色综合色综合色综合色综合色综合| 久久久久久久国产精品影院| 奇米四色…亚洲| 欧美一区二区成人| 免费在线视频一区| 欧美肥妇毛茸茸| 日韩精品高清不卡| 欧美巨大另类极品videosbest | 一区二区不卡在线播放 | 亚洲综合色婷婷| 91在线精品一区二区| 国产精品久久久久aaaa樱花| www.欧美色图| 日韩理论片在线|