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

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

?? instance.java

?? 本程序是用java語言編寫的數(shù)據(jù)挖掘分類算法中的決策樹分類方法c4.5程序代碼
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
                    rtrn = rtrn + separator;
            }
            else{
                //System.out.println("Values.length = " + values.length);
                //System.out.println("attrNum = "+attrNum);
                if(values[attrNum] == null)System.out.println("Error");
                String data = ai.attrValue_to_string(values[attrNum]);
                if(ai.can_cast_to_nominal())// && protectChars)
                    ;// data = protect_chars(data);
                rtrn = rtrn + data;
                if(data.equals("")) rtrn = rtrn + "?";
                if(attrNum < (schema.num_attr()-1))
                    rtrn = rtrn + separator;
                
            }
        }
        if(is_labelled()){
            if(schema.num_attr() > 0)
                rtrn = rtrn + ", ";
            AttrInfo ai = schema.label_info();
            String data = ai.attrValue_to_string(labelValue);
            //if(protectChars)
            //   data = protect_chars(data);
            rtrn = rtrn + data;
        }
        rtrn = rtrn + "\n";
        return(rtrn);
        
    }
    
    /** Returns the information about the attribute specified.
     * @return The information about the attribute.
     * @param attrNum	The index of the attribute specified.
     */
    public AttrInfo attr_info(int attrNum) {
        return schema.attr_info(attrNum);
    }
    
    /** Checks if this Instance is equal to the specified Instance. Compares the
     * attributes values, the weight, and the label of this Instance.
     * @return TRUE if these Instances are equal, FALSE otherwise.
     * @param i_instance	The Instance to be compared to.
     */
    public boolean equals(Instance i_instance) {
        return equal(i_instance,true,true,false);
    }
    
    /** Compares this Instance to the specified Instance. This function may
     * optionally compare the label and the weight as part of this process. Setting
     * fatalOnFalse will cause equal() to abort with a clear error message
     * if the equality test fails.
     * @return TRUE if these Instances are equal, FALSE otherwise.
     * @param instance		The Instance to be compared to.
     * @param compLabel		TRUE if labels are to be compared, FALSE otherwise.
     * @param compWeight		TRUE if weights are to be compared, FALSE otherwise.
     * @param fatalOnFalse	TRUE if an Error message should be displayed if
     * the Instances are not equal, FALSE otherwise.
     */
    boolean equal(Instance instance,
    boolean compLabel, boolean compWeight,
    boolean fatalOnFalse) {
        // if one instance is labelled and the other is not AND we're
        // comparing labels, its a mismatch.
        if( compLabel && (is_labelled() != instance.is_labelled())) {
            if (fatalOnFalse) {
                Error.fatalErr("Instance::equal: equalilty failed (only one of the"
                +"two instances has label).");
            }
            else
                return false;
        }
        
        // compare labels if compLabel is set
        else if(compLabel && is_labelled()) {
            //      DBGSLOW(schema.label_info().equal(instance.get_schema().label_info(),
            //					TRUE));
            if(!schema.label_info().equal_value(labelValue,instance.get_label())) {
                if(fatalOnFalse) {
                    Error.fatalErr("Instance::equal: equality failed (label values "
                    +"differ).");
                }
                return false;
            }
        }
        
        // compare weights if compWeight is set
        if(compWeight) {
            if(!MLJ.approx_equal((float)get_weight(),
            (float)(instance.get_weight()))) {
                if(fatalOnFalse) {
                    Error.fatalErr("Instance::equal: equality failed (weights do not match: "
                    +get_weight() +" vs " +instance.get_weight()
                    +").");
                }
                return false;
            }
        }
        
        // check schemas and number of values (DBG only)
        //   DBGSLOW(get_schema().equal_no_label(instance.get_schema(), TRUE));
        //   DBG(if (instance.values.size() != values.size())
        //       err << "Instance::equal: number of values in instance "
        //       "do not match.  class=" << values.size()
        //       << " and rhs=" << instance.values.size() << fatal_error);
        
        // compare attribute values
        for (int i = 0; i < schema.num_attr(); i++) {
            if (!attr_info(i).equal_value( values[i], instance.values[i] )) {
                if( fatalOnFalse ) {
                    Error.fatalErr("Instance::equal: equality failed (differed on "
                    +attr_info(i).name() +").");
                }
                return false;
            }
        }
        
        // comparison succeeded
        return true;
    }
    
    /** Returns a String representation of the Instance.
     * @param displayWeight TRUE if the Instance weight is to be displayed, FALSE otherwise.
     * @param normalizeReals TRUE if the real values in the Instance are to be normalized, FALSE otherwise.
     * @return A String representation of the Instance.
     */
    public String out(boolean displayWeight, boolean normalizeReals) {
        String rtrn = new String();
        rtrn = rtrn + display_unlabelled_out(displayWeight, normalizeReals);
        if(is_labelled()){
            if(schema.num_attr() > 0)
                rtrn = rtrn + ", ";
            AttrInfo ai = schema.label_info();
            String data = ai.attrValue_to_string(labelValue);
            //if(protectChars)
            //   data = protect_chars(data);
            rtrn = rtrn + data;
        }
        rtrn = rtrn + "\n";
        return rtrn;
    }
    
    /** Returns a String representation of the Instance.
     * @param displayWeight TRUE if the Instance weight is to be displayed, FALSE otherwise.
     * @param normalizeReal TRUE if the real values in the Instance are to be normalized, FALSE otherwise.
     * @return A String representation of the Instance.
     */
    public String display_unlabelled_out(boolean displayWeight, boolean normalizeReal) {
        String rtrn = new String();
        String separator =  new String(", ");
        if(displayWeight)
            rtrn = rtrn + (weight+separator);
        for(int attrNum = 0;attrNum<schema.num_attr();attrNum++){
            AttrInfo ai = schema.attr_info(attrNum);
            if(normalizeReal && ai.can_cast_to_real()){
                RealAttrInfo rai = ai.cast_to_real();
                if(rai.is_unknown(values[attrNum]))
                    rtrn = rtrn + AttrInfo.UNKNOWN_VAL_STR;
                else
                    rtrn = rtrn + rai.normalized_value(values[attrNum]);
                if(attrNum < schema.num_attr() -1)
                    rtrn = rtrn + separator;
            }
            else{
                //System.out.println("Values.length = " + values.length);
                //System.out.println("attrNum = "+attrNum);
                if(values[attrNum] == null)System.out.println("Error");
                String data = ai.attrValue_to_string(values[attrNum]);
                if(ai.can_cast_to_nominal())// && protectChars)
                    ;// data = protect_chars(data);
                rtrn = rtrn + data;
                if((attrNum < (schema.num_attr()-1))&&(!(data.equals(""))))
                    rtrn = rtrn + separator;
            }
        }
        return rtrn;
    }
    
    /** Returns the AttrValue at the specified index number.
     * @return The AttrValue at the specified index.
     * @param index The index specified.
     */
    public AttrValue index(int index) {
        return values[index];
    }
    
    /** Copies the supplied Instance object into this Instance object.
     * @param other The Instance object to be copied.
     * @throws CloneNotSupportedException if the cloning process for contained data members encounters a
     * CloneNotSupportedException.
     */
    public void copy(Instance other) throws CloneNotSupportedException{
        values = new AttrValue[other.schema.num_attr()];
        for(int i = 0; i < values.length; values[i++] = new AttrValue());
        schema = other.schema;
        refCount = other.refCount;
        set_weight(weight);
        set_label((AttrValue)labelValue.clone());
        for(int i=0;i<values.length;i++)
            values[i] = (AttrValue)other.get_value(i).clone();
    }
    
    /** Remove an Attribute from an Instance. When doing many projections, it is more
     * efficient to supply a Schema with the deleted attribute.
     * @param attrNum The number of the attribute to be removed from this InstanceObject.
     * @param schemaWithDelAttr Schema with the attribute deleted.
     * @return The modified Instance.
     */
    public Instance remove_attr(int attrNum, Schema schemaWithDelAttr) {
        if ( attrNum < 0 || attrNum >= num_attr() )
            Error.fatalErr("Instance.remove_attr(int,Schema): illegal attrNum \n"
            +attrNum+" is passed but the proper range is \n"+" 0 to "+(num_attr() - 1)
            +".");
        
        Instance instance = new Instance(schemaWithDelAttr);
        for (int i = 0; i < schema.num_attr(); i++)
            if (i != attrNum){
                index(i - ((i > attrNum)?1:0)).copy(index(i));
            }
        if (schema.is_labelled()) // both are labelled becauseof
            // equal_except_del_attr
            instance.set_label(get_label());
        return instance;
    }
    
    /** Remove an Attribute from an Instance. When doing many projections, it is more
     * efficient to supply a Schema with the deleted attribute.
     * @param attrNum The number of the attribute to be removed from this InstanceObject.
     * @return The modified Instance.
     */
    public Instance remove_attr(int attrNum) {
        if ( attrNum < 0 || attrNum >= num_attr() )
            Error.fatalErr("Instance.remove_attr(int): illegal attrNum \n"
            +attrNum+" is passed but the proper range is \n"+" 0 to "+(num_attr() - 1)
            +".");
        
        Schema schemaNew = schema.remove_attr(attrNum);
        return remove_attr(attrNum, schemaNew);
    }
    
    
    /** Returns the number of values for the specified attribute.
     * @param attrNum The number of the attribute for which the number of values is requested.
     * @return The number of attribute values.
     */
    public int num_attr_values(int attrNum){
        return schema.num_attr_values(attrNum);
    }
    
    /** Returns the number of possible label values in the Schema of this Instance.
     * @return The number of possible label values.
     */
    public int num_label_values() {
        return nominal_label_info().num_values();
    }
    
    /** Returns the information on the label attribute.
     * @return Information on the label attribute.
     */
    public NominalAttrInfo nominal_label_info() {
        return label_info().cast_to_nominal();
    }
    
    /** Returns the attribute name.
     * @param attrNum The number of the attribute.
     * @return The name of the attribute.
     */
    public String attr_name(int attrNum){
        return schema.attr_name(attrNum);
    }
    
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
岛国一区二区三区| 风间由美性色一区二区三区| 国产精品大尺度| 五月天激情综合网| 日本欧洲一区二区| 激情综合色播激情啊| 国产成人亚洲综合色影视| 成人午夜激情片| 91热门视频在线观看| 欧美日韩精品一区二区三区蜜桃| 欧美男人的天堂一二区| 精品久久国产字幕高潮| 国产精品麻豆一区二区| 天天色天天操综合| 色综合久久久网| 精品成人一区二区三区| 亚洲二区在线视频| av不卡一区二区三区| 精品国产一区久久| 视频一区视频二区中文字幕| 国产.欧美.日韩| 亚洲精品一线二线三线无人区| 一区二区三区**美女毛片| 精品在线一区二区| 91精品国产色综合久久久蜜香臀| 中文在线一区二区| 床上的激情91.| 精品久久久久一区二区国产| 日韩精品一二三| 欧美日韩一区二区三区四区五区| 成人欧美一区二区三区视频网页| 激情图区综合网| 久久久久国产精品麻豆| 久久精品国产精品亚洲综合| 欧美一级欧美三级在线观看| 一区二区三区精品在线观看| www..com久久爱| 亚洲精品写真福利| 欧美色视频在线| 日本系列欧美系列| 精品国产自在久精品国产| 国产在线一区二区| 久久久国产午夜精品| 丰满少妇久久久久久久| 亚洲国产精品ⅴa在线观看| 欧美日韩卡一卡二| 日韩中文字幕不卡| 日韩三级av在线播放| 精品一区二区三区久久久| 国产清纯白嫩初高生在线观看91 | 日韩精品每日更新| 日韩午夜中文字幕| 成人app在线| 亚洲人精品午夜| 精品人在线二区三区| 91首页免费视频| 日本成人中文字幕在线视频| 中文字幕在线观看不卡| 欧美日韩在线综合| 精品一区二区三区在线观看| 亚洲另类色综合网站| 日韩视频永久免费| 欧美这里有精品| 99久免费精品视频在线观看| 男人操女人的视频在线观看欧美| 国产女主播视频一区二区| 69av一区二区三区| 91黄色小视频| 一本色道a无线码一区v| 99精品久久只有精品| 国内精品视频666| 久久草av在线| 日韩av不卡在线观看| 亚洲第一av色| 亚洲国产精品一区二区久久| 国产精品久久久久久久久免费丝袜| 日韩一区和二区| 日韩美一区二区三区| 日韩欧美电影一二三| 9191久久久久久久久久久| 91福利在线观看| 欧美午夜精品一区| 欧美日韩日日摸| 正在播放亚洲一区| 欧美一级欧美一级在线播放| 欧美日韩在线一区二区| 欧美日韩一区二区三区高清| 欧美日高清视频| 日韩一区二区三区在线观看| 日韩女优视频免费观看| 久久奇米777| 中文字幕一区二区三区在线播放| 国产精品女主播av| 午夜伊人狠狠久久| 久久成人免费网| 99精品视频在线观看免费| 国产午夜亚洲精品理论片色戒| 91麻豆精品91久久久久久清纯| 欧美一区二区性放荡片| 91精品国产一区二区三区香蕉| 亚洲精品在线一区二区| av在线综合网| 在线免费观看一区| 精品久久人人做人人爰| 亚洲精品中文在线观看| 日韩激情视频在线观看| 成人av在线播放网站| 日韩视频免费观看高清在线视频| 国产精品成人一区二区三区夜夜夜| 亚洲国产wwwccc36天堂| 国产福利一区在线观看| 欧美一区二区视频在线观看2020| 国产日韩欧美在线一区| 久久精品国产久精国产| 欧美日韩高清在线播放| 综合久久久久久| 高清国产午夜精品久久久久久| 欧美一区日韩一区| 五月天久久比比资源色| 欧美日韩中文国产| 中文乱码免费一区二区| 高清成人在线观看| 久久久久99精品国产片| 国产激情偷乱视频一区二区三区 | 91精品国产91综合久久蜜臀| 亚洲精品欧美综合四区| 一本一本久久a久久精品综合麻豆| 国产欧美日韩综合精品一区二区| 极品尤物av久久免费看| 欧美精品免费视频| 久久99在线观看| 精品对白一区国产伦| 国产精品18久久久久久久久久久久 | 国产成人免费视频一区| 亚洲国产精品成人综合色在线婷婷| 国产精品亚洲一区二区三区妖精| 欧美高清在线精品一区| 91黄色激情网站| 日本欧美一区二区在线观看| 日韩欧美不卡在线观看视频| 丁香天五香天堂综合| 有码一区二区三区| 欧美刺激脚交jootjob| 北岛玲一区二区三区四区| 亚洲一区在线观看网站| 久久这里只有精品6| 91亚洲国产成人精品一区二区三| 亚洲国产综合在线| 久久免费午夜影院| 在线观看91精品国产入口| 精一区二区三区| 怡红院av一区二区三区| 国产精品全国免费观看高清| 欧美系列日韩一区| 99这里只有精品| 激情国产一区二区| 免费在线观看日韩欧美| 亚洲精品综合在线| 国产午夜一区二区三区| 91精品久久久久久久99蜜桃| 97se狠狠狠综合亚洲狠狠| 美国三级日本三级久久99| 亚洲高清一区二区三区| 一区二区三区在线免费视频| 国产精品美女久久久久aⅴ国产馆| 91精品婷婷国产综合久久性色| 欧美在线色视频| 在线精品观看国产| 欧美日韩免费在线视频| 色一区在线观看| 在线观看视频一区二区欧美日韩| 正在播放一区二区| 精品黑人一区二区三区久久 | 一区二区三区**美女毛片| 国产精品欧美久久久久无广告| 久久男人中文字幕资源站| 久久久噜噜噜久久人人看 | 麻豆精品国产传媒mv男同| 日本免费新一区视频| 日韩经典一区二区| 国产一区二区精品久久| 成人免费电影视频| 91黄色免费版| 欧美一级一区二区| 中文av一区二区| 午夜精品久久久久久久| 韩日精品视频一区| 成人免费视频免费观看| 一本到不卡免费一区二区| 欧美一级夜夜爽| 中文字幕在线不卡国产视频| 亚洲www啪成人一区二区麻豆| 极品尤物av久久免费看| 国产99精品在线观看| 欧美自拍偷拍午夜视频| 亚洲女厕所小便bbb| 国产精品一区在线| 欧美精品国产精品| 国产免费成人在线视频| 日本成人超碰在线观看|