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

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

?? realattrinfo.java

?? 本程序是用java語言編寫的數據挖掘分類算法中的決策樹分類方法c4.5程序代碼
?? JAVA
字號:
package shared;
import java.io.*;

/** The RealAttrInfo class allows AttrValue of type Real. The standard definitions
 * of the comparison operators is implemented.
 *
 */
public class RealAttrInfo extends AttrInfo {
    /** The minimum value for this attribute. **/
    private double min;
    /** The maximum value for this attribute. **/
    private double max;
    
    /** Constructor.
     * @param s The name for this attribute.
     */
    public RealAttrInfo(String s) {
        super(s,AttrInfo.real);
    }
    
    /** Checks if this AttrInfo subclass can be cast as a RealAttrInfo class.
     * @return Always returns TRUE for the RealAttrInfo class.
     */
    public boolean can_cast_to_real(){return true;}
    
    /** Casts this AttrInfo subclass to a RealAttrInfo class.
     * @return A reference to this RealAttrInfo object.
     */
    public RealAttrInfo cast_to_real(){return this;}
    
    /** Reads the value for the attribute from the BufferedReader specified.
     * @return The attribute read from the BufferedReader.
     * @param stream	The specified BufferedReader to be read from.
     * @param isTest	TRUE if this value is for a test Instance, FALSE otherwise.
     * @param f		The FileSchema for the file being read.
     */
    public AttrValue read_attr_value(BufferedReader stream, boolean isTest,
    FileSchema f ) {
        // behave the same whether or not we're reading test data
        //      (void)isTest;
        
        RealAttrValue attrValue = new RealAttrValue();
        if (!f.skip_white_comments_same_line(stream))
            Error.parse_error(stream, "Attribute value expected");
        
        try {
            stream.mark(1);
            char ch = (char)stream.read();
            stream.reset();
            
            if (ch != '?') {
                boolean sameLine = false;
                boolean[] boolArray = new boolean[1];//ADDED BY JL
                boolArray[0] = true;//ADDED BY JL
                String realStr = f.read_word(stream, sameLine, boolArray);//(stream, false, sameLine, true);
                double val = 0;
                try {
                    val = Double.parseDouble(realStr);
                    if(val == Globals.UNKNOWN_STORED_REAL_VAL) {
                        System.err.print("Warning: real value "+val+" is the same as "+
                        "the bit pattern for an unknown real value.  Changing the "+
                        "value to ");
                        val /= 2;
                        System.err.println(val+".");
                    }
                }
                catch(NumberFormatException e) {
                    Error.parse_error(stream,
                    "The value \"" + realStr+
                    "\" is not a legitimate "+
                    "Real value for attribute "+ name());
                }
                attrValue.realVal = (float)val;
            }
            else {
                String str = f.read_word_on_same_line(stream, true, false);//(stream, true);
                //            (void)str;  // to avoid compiler warning in FAST
                //            DBGSLOW(ASSERT(str[0] == '?'));
                attrValue.realVal = (float)Globals.UNKNOWN_STORED_REAL_VAL;
            }
        }
        catch(Exception e){e.printStackTrace();}
        return attrValue;
    }
    
    /** Reads the value for the attribute from the StreamTokenizer specified.
     * @return The attribute read from the StreamTokenizer.
     * @param stream	The specified StreamTokenizer to be read from.
     * @param isTest	TRUE if this value is for a test Instance, FALSE otherwise.
     * @param f		The FileSchema for the file being read.
     */
    public AttrValue read_attr_value(StreamTokenizer stream, boolean isTest,
    FileSchema f ) {
        // behave the same whether or not we're reading test data
        //      (void)isTest;
        
        RealAttrValue attrValue = new RealAttrValue();
        //      if (!f.skip_white_comments_same_line(stream))
        if(stream.ttype == (int)',')
            Error.parse_error(stream, "Attribute value expected");
        
        try{
            //       stream.mark(1);
            //       char ch = (char)stream.read();
            //       stream.reset();
            
            if (stream.ttype != '?') {
                boolean sameLine = false;
                boolean[] boolArray = new boolean[1];//ADDED BY JL
                boolArray[0] = true;//ADDED BY JL
                //            String realStr = f.read_word(stream, sameLine, boolArray);//(stream, false, sameLine, true);
                double val = 0;
                if (stream.ttype == StreamTokenizer.TT_NUMBER) {
                    val = stream.nval;
                    //               val = Double.parseDouble(realStr);
                    if(val == Globals.UNKNOWN_STORED_REAL_VAL) {
                        System.err.print("Warning: real value "+val+" is the same as "+
                        "the bit pattern for an unknown real value.  Changing the "+
                        "value to ");
                        val /= 2;
                        System.err.println(val+".");
                    }
                }
                else Error.parse_error(stream,
                "The value \"" + stream.toString()+ //realStr+
                "\" is not a legitimate "+
                "Real value for attribute "+ name());
                attrValue.realVal = val;
            }else{
                //            String str = f.read_word_on_same_line(stream, true, false);//(stream, true);
                //            (void)str;  // to avoid compiler warning in FAST
                //            DBGSLOW(ASSERT(str[0] == '?'));
                attrValue.realVal = (float)Globals.UNKNOWN_STORED_REAL_VAL;
            }
        }catch(Exception e){e.printStackTrace();}
        return attrValue;
    }
    
    
    /** Checks if the specified AttrValue is unknown.
     * @return TRUE if the specified AttrValue is unknown.
     * @param realValue	The specified AttrValue.
     */
    public boolean is_unknown(AttrValue realValue) {
        return (realValue.realVal == Globals.UNKNOWN_STORED_REAL_VAL);
    }
    
    
    /** Returns the real value of this AttrValue.
     * @return The real value of this AttrValue.
     * @param av realValue The specified av.
     */
    public double get_real_val(AttrValue av) {
        if(av.type != AttrValue.real)
            Error.err("RealAttrInfo:get_real_val: cannot get "
            + " a real value from a "+attr_type_to_string(av.type)
            + " AttrValue --> fatal_error");
        if(is_unknown(av))
            Error.err("RealAttrInfo:get_real_val: trying to get "
            + " UNKNOWN value --> fatal_error");
        return av.realVal;
    }
    
    /** Sets the specified AttrValue to the specified value.
     * @param av	The specified AttrValue.
     * @param val	The specified new value.
     */
    public void set_real_val(AttrValue av, double val) {
        
        if(GlobalOptions.debugLevel >= 1){
            if (av.type == AttrValue.unknown)
                av.type = AttrValue.real;
            else if (av.type != AttrValue.real)
                Error.fatalErr("RealAttrInfo:set_real_val: Cannot assign a real value to a"+
                attr_type_to_string(av.type)+"AttrValue_");
        }
        if (val == Globals.UNKNOWN_STORED_REAL_VAL)
            Error.fatalErr("RealAttrInfo::set_real_val: attempt to store value="+
            "UNKNOWN_STORED_REAL_VAL="+Globals.UNKNOWN_STORED_REAL_VAL);
        if (val > Globals.STORED_REAL_MAX)
            Error.fatalErr("RealAttrInfo::set_real_val: value "+
            val+" too large.  Maximum is "+Globals.STORED_REAL_MAX);
        if (val < -Globals.STORED_REAL_MAX)
            Error.fatalErr("RealAttrInfo::set_real_val: value "+
            val+" too small.  Minimum valus is "+ -Globals.STORED_REAL_MAX);
        av.realVal = (float)val;
    }
    
    /** Normalize the specified AttrValue according to the min and max values for
     * this AttrValue.
     * @return The normalized value.
     * @param val	The AttrValue to be normalized.
     */
    public double normalized_value(AttrValue val) {
        if(is_unknown(val))
            Error.err("RealAttrInfo::normalized_value: Unknown"
            +" attribute value passed to RealAttrinfo "+name()+" fatal_error");
        if(min==max)
            return .5;
        else
            return (val.realVal - min) / (max-min);
    }
    
    /** Returns a String value of the value in the specified AttrInfo.
     * @return A String value of the value in this AttrInfo.
     * @param val	The specified AttrInfo.
     */
    public String attrValue_to_string(AttrValue val) {
        if (is_unknown(val))
            return UNKNOWN_VAL_STR;
        String ret = Double.toString(val.realVal);
        return ret.substring(0,ret.indexOf((int)'.')+ 2);
    }
    
    /** Returns TRUE if given AttrValue are equivalent, FALSE otherwise. Assumes
     * that given AttrValue are both of the type described by the instance of
     * RealAttrInfo calling this function.
     * @param realValue1 The first AttrValue to be compared.
     * @param realValue2 The second AttrValue to be compared.
     * @return TRUE if the give AttrValue are equivalent, FALSE otherwise.
     */
    // @@ why does this exist if we have equal() ?
    public boolean equal_value(AttrValue realValue1, AttrValue realValue2) {
        return MLJ.approx_equal((float)(realValue1.realVal),
        (float)(realValue2.realVal), 10);
    }
    
    /** At the moment this does nothing. Checks if the given AttrValue is in the
     * range for this AttrValue.
     * @param val	The specified AttrValue.
     */
    public void check_in_range(AttrValue val){}
    
    /** Sets the given AttrValue to be unknown.
     * @param val The AttrValue to be changed.
     */
    public void set_unknown(AttrValue val) {
/*   ATTRDBG(if (val.type == unknown)
          val.type = real;
       else if (val.type != real)
          err << "RealAttrInfo:set_real_val: Cannot assign a real value to a"
              << attr_type_to_string(val.type) << "AttrValue_"
              << fatal_error);
 */
        val.realVal = Globals.UNKNOWN_STORED_REAL_VAL;
    }
    
    /** Displays the attribute values in names file format.
     * @param stream	Writer to which the display will be written.
     */
    public void display_attr_values(Writer stream)
    { display_attr_values(stream,false);}
    
    /** Displays the attribute values in names file format.
     * @param stream	Writer to which the display will be written.
     * @param protectchars True if "\" and "." are to be protected by "\"
     * characters, false otherwise.
     */
    public void display_attr_values(Writer stream, boolean protectchars) {
        try{
            stream.write("continuous");
            if (min != Globals.UNKNOWN_STORED_REAL_VAL)
                stream.write(" min="+min);
            if (max != Globals.UNKNOWN_STORED_REAL_VAL)
                stream.write(" max="+max);
            stream.write(".\n");
        }catch(IOException e){e.printStackTrace();System.exit(1);}
    }
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区三区精品| 99久久免费视频.com| 91浏览器入口在线观看| 制服丝袜中文字幕亚洲| 中文字幕欧美国产| 激情综合网激情| 欧美三片在线视频观看| 成人欧美一区二区三区小说| 精品中文字幕一区二区小辣椒| 色女孩综合影院| 国产欧美精品一区二区色综合朱莉| 日日摸夜夜添夜夜添国产精品| 91影院在线观看| 国产女同性恋一区二区| 狂野欧美性猛交blacked| 欧美色图在线观看| 亚洲免费毛片网站| 99这里只有精品| 国产精品日日摸夜夜摸av| 国产麻豆日韩欧美久久| 91精品国产一区二区人妖| 亚洲一二三区在线观看| 色综合久久久久久久久| 国产精品国产三级国产aⅴ原创| 九九九久久久精品| 日韩一级成人av| 秋霞午夜鲁丝一区二区老狼| 欧美视频在线不卡| 性做久久久久久免费观看| 色八戒一区二区三区| 最新国产の精品合集bt伙计| www.欧美色图| 亚洲精品视频一区| 91麻豆福利精品推荐| 亚洲色图欧美激情| 色婷婷久久久久swag精品| 日韩伦理av电影| 91国产福利在线| 亚洲国产乱码最新视频 | 欧美国产1区2区| 国内偷窥港台综合视频在线播放| 欧美α欧美αv大片| 国产精品资源在线看| 国产精品乱码一区二三区小蝌蚪| 国产成人在线免费观看| 国产精品乱码一区二区三区软件| av亚洲精华国产精华精华| 亚洲精品亚洲人成人网在线播放| 欧美又粗又大又爽| 日韩不卡一区二区三区| 久久美女高清视频 | 久久国产欧美日韩精品| 久久久久久久久久久久久久久99| 福利电影一区二区三区| 亚洲人成在线播放网站岛国| 欧美视频一区二区三区在线观看| 天天综合天天综合色| www国产亚洲精品久久麻豆| 成人高清视频免费观看| 亚洲国产日韩精品| 欧美草草影院在线视频| 国产成人亚洲综合色影视| 1000部国产精品成人观看| 欧美人与禽zozo性伦| 国产毛片精品一区| 怡红院av一区二区三区| 欧美一级夜夜爽| 成人精品鲁一区一区二区| 一区二区在线免费| 精品理论电影在线观看 | 亚洲黄色录像片| 精品国产三级a在线观看| 99久久精品国产导航| 麻豆国产精品视频| 亚洲三级在线观看| 日韩欧美电影在线| jlzzjlzz亚洲日本少妇| 日本成人中文字幕| 亚洲免费在线播放| 国产午夜三级一区二区三| 在线观看视频欧美| 高清免费成人av| 人禽交欧美网站| 夜夜精品视频一区二区| 久久男人中文字幕资源站| 欧美亚洲免费在线一区| 粉嫩嫩av羞羞动漫久久久 | 日韩色在线观看| 色综合天天综合网国产成人综合天 | 一本到一区二区三区| 国内精品久久久久影院色| 亚洲综合视频网| 欧美激情综合在线| 日韩一区国产二区欧美三区| 欧美天堂一区二区三区| av亚洲产国偷v产偷v自拍| 亚洲三级视频在线观看| 欧美性色欧美a在线播放| 成人免费观看av| 久久99精品国产.久久久久| 亚洲第一激情av| 日韩欧美中文字幕精品| 国产一区二区三区免费看| 免费成人在线视频观看| 午夜视频在线观看一区| 亚洲一区二区三区在线| 亚洲欧美韩国综合色| 国产精品麻豆一区二区| 国产嫩草影院久久久久| 久久久久国产精品免费免费搜索| 欧美大肚乱孕交hd孕妇| 精品免费国产二区三区| 欧美精品一区二| 久久这里只精品最新地址| 欧美va亚洲va| 精品精品国产高清a毛片牛牛 | av亚洲精华国产精华| 成人免费精品视频| 99国内精品久久| 色婷婷一区二区| 欧美亚洲一区二区在线观看| 欧美午夜电影网| 欧美巨大另类极品videosbest| 欧美久久婷婷综合色| 日韩无一区二区| 精品噜噜噜噜久久久久久久久试看| 欧美变态tickle挠乳网站| xf在线a精品一区二区视频网站| 久久伊人蜜桃av一区二区| 久久久久久亚洲综合影院红桃 | 91在线观看污| 欧美午夜一区二区| 欧美伦理影视网| 久久人人97超碰com| 国产精品理伦片| 亚洲一区二区在线播放相泽 | 99久久99久久综合| 欧洲一区二区av| 在线综合视频播放| 亚洲精品一区二区三区在线观看| 久久综合色播五月| 国产精品国产三级国产普通话蜜臀 | 理论电影国产精品| 国产成人av影院| 欧美视频精品在线观看| 精品国产91久久久久久久妲己| 日本一区二区三区久久久久久久久不| 中文字幕一区二区三区精华液 | 中文字幕一区二区三区在线播放 | 欧美日韩国产影片| 亚洲精品一区二区三区精华液| 亚洲欧洲成人精品av97| 五月激情六月综合| 成人avav在线| 欧美一区日韩一区| 国产精品免费视频一区| 奇米精品一区二区三区四区| 99精品一区二区| 日韩视频免费观看高清在线视频| 国产精品乱码一区二区三区软件| 三级久久三级久久久| av在线一区二区| 日韩欧美你懂的| 亚洲在线观看免费视频| 国产v日产∨综合v精品视频| 欧美日韩一卡二卡三卡| 国产精品视频免费看| 久久精品国产亚洲a| 色视频一区二区| 欧美国产成人精品| 久久精品国产**网站演员| 日本久久精品电影| 国产精品久久一卡二卡| 国产精品综合av一区二区国产馆| 欧美日韩一区视频| 国产精品久久久久久亚洲毛片| 男人的天堂久久精品| 欧美日韩一区中文字幕| 136国产福利精品导航| 国产乱码精品一区二区三区五月婷| 欧美日本视频在线| 亚洲男人的天堂网| 99re在线视频这里只有精品| 久久女同精品一区二区| 精品影视av免费| 日韩欧美综合一区| 免费观看在线色综合| 欧美狂野另类xxxxoooo| 亚洲国产一区二区a毛片| 91免费版在线看| 一区免费观看视频| 成人黄色a**站在线观看| 久久精品人人做人人综合| 激情成人午夜视频| 日韩午夜在线影院| 精品中文字幕一区二区小辣椒| 欧美电视剧在线观看完整版| 免费在线一区观看| 欧美成人午夜电影| 麻豆成人久久精品二区三区小说|