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

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

?? instance.java

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

/** The class Instance provides instances with or without label and
 * support for describing instances, iterating through values, and looking at
 * the instance label. Most effort was directed at categorization of labelled
 * instances for supervised learning. Has been extended to tree-structured
 * attributes.
 */

public class Instance {
    
    /** The Schema for the data stored in this Instance. **/
    private Schema schema;
    /** The values for each Attribute stored in this Instance. **/
    public AttrValue[] values;
    /** The weight assigned to this Instance of data. **/
    private double weight;
    /** Count of the references to this Instance object.
     */
    private int refCount;
    /** The label this Instance is categorized as. **/
    private AttrValue labelValue;
    
    /** A string used for displaying purposes. **/
    private static final String INSTANCE_WRAP_INDENT = "   ";
    /** A string used for displaying purposes. **/
    private static final char END_OF_INSTANCE_LINE = '.';
    
    /** Cloning function for the Instance class. Provides a deep copy.
     * @return A copy of the Object.
     * @throws CloneNotSupportedException if the cloning process for contained data members encounters a
     * CloneNotSupportedException.
     */
    public Object clone() throws CloneNotSupportedException {
        Instance newClone = new Instance(schema);
        newClone.set_weight(weight);
        newClone.set_label((AttrValue)labelValue.clone());
        for(int i=0;i<schema.num_attr();i++)
            newClone.values[i] = (AttrValue)get_value(i).clone();
        
        return newClone;
    }
    
    /** Constructor for the Instance class.
     * @param newSchema	The Schema for the data stored in this Instance.
     */
    public Instance(Schema newSchema) {
        values = new AttrValue[newSchema.num_attr()];
        for(int i = 0; i < values.length; values[i++] = new AttrValue());
        refCount = 1;
        weight = 1.0; //default value
        schema = newSchema;
        //DBG(init_values())
        //DBG(OK())
    }
    
    /** Copy constructor for the Instance class.
     * @param source	The original Instance to be copied.
     */
    public Instance(Instance source) {
        schema = source.schema;
        values = source.values;
        labelValue = source.labelValue;
        refCount = 1;
        
        weight = source.weight;
        //      DBG(OK());
    }
    
    
    /** Returns the Schema of attributes for this Instance.
     * @return The Schema for this Instance.
     */
    public Schema get_schema(){return schema;}
    
    /** Returns the number of attributes for data in this Instance.
     * @return The number of attributes in this Instance.
     */
    public int num_attr(){return schema.num_attr();}
    
    /** Returns the label this Instance is categorized as.
     * @return The labelValue for this Instance.
     */
    public AttrValue get_label(){return labelValue;}
    
    /** Returns a copy with only the attributes included that are are indicated
     * by the mask. Schema.project() should be called to create the new Schema
     * for the Instance.
     * @return The new Instance with the attributes specified.
     * @param shortSchema	The Schema for the new Instance created.
     * @param attrMask		An array of boolean values equal in length to the
     * original number of attributes. Each element
     * relates to an attribute of the original
     * instance. If the element is set TRUE, the
     * corresponding attribute is included in the new
     * Instance.
     */
    public Instance project(Schema shortSchema, boolean[] attrMask) {
        //DBG(OK());
        //ASSERT(attrMask.size() == num_attr());
        
        if(get_schema().is_labelled() != shortSchema.is_labelled())
            Error.err("Instance.project: short schema "
            +" has different labelled status from this schema-->"
            +"fatal_error");
        
        Instance newInst = new Instance(shortSchema);
        int newnum = 0;
        for(int i=0;i<num_attr();i++) {
            if(attrMask[i]) {
                newInst.values[newnum] = values[i];
                newnum++;
            }
        }
        
        if(get_schema().is_labelled())
            newInst.set_label(get_label());
        
        //set the weight for this instance
        newInst.set_weight(get_weight());
        
        return newInst;
    }
    
    // reimplementation of overrided [] method
    /** Returns the attribute value at the specified attribute.
     * @return The attribute value stored for the attribute at that index.
     * @param index	The index number for the specified attribute.
     */
    public AttrValue get_value(int index) {
        return values[index];
    }
    
    /** Sets the Schema for this Instance.
     * @param schemaRC	The new Schema for this Instance.
     */
    public void set_schema(Schema schemaRC) //SchemaRC
    {
        if(schemaRC.num_attr() != schema.num_attr())
            Error.err("Instance::set_schema(): attribute "
            +"count does not match -->fatal_error");
        schema = schemaRC;
    }
    
    /** Sets the weight for this Instance.
     * @param wt	The new weight for this Instance.
     */
    public void set_weight(double wt) {
        weight = wt;
    }
    
    /** Sets the label for this Instance.
     * @param lvalue	The new label value for this Instance.
     */
    public void set_label(AttrValue lvalue) {
        if(!schema.is_labelled())
            System.out.println("Instance::set_label():labelInfo is not set ->fe");
        schema.label_info().check_in_range(lvalue);
        labelValue = lvalue;
    }
    
    /** Returns the weight for this Instance.
     * @return The weight for this Instance.
     */
    public double get_weight(){return weight;}
    
    /** Displays the Instance with labels.
     * @param displayWeight	TRUE if the weight for this Instance should be shown,
     * FALSE otherwise.
     * @param normalizeReals TRUE if the attribute values should be normalized,
     * FALSE otherwise.
     */
    public void display(boolean displayWeight, boolean normalizeReals) {
        display_unlabelled(displayWeight, normalizeReals);
        if(is_labelled()){
            if(schema.num_attr() > 0)
                System.out.print(", ");
            AttrInfo ai = schema.label_info();
            String data = ai.attrValue_to_string(labelValue);
            //if(protectChars)
            //   data = protect_chars(data);
            System.out.print(data);
        }
        System.out.println();
        
    }
    
    /** Displays the Instance without labels.
     * @param normalizeReal TRUE if the attribute values should be normalized,
     * FALSE otherwise.
     * @param displayWeight TRUE if the weight for this Instance should be shown,
     * FALSE otherwise.
     */
    public void display_unlabelled(boolean displayWeight, boolean normalizeReal) {
        String separator =  new String(", ");
        if(displayWeight)
            System.out.println(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]))
                    System.out.print(AttrInfo.UNKNOWN_VAL_STR);
                else
                    System.out.print(rai.normalized_value(values[attrNum]));
                if(attrNum < schema.num_attr() -1)
                    System.out.print(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);
                System.out.print(data);
                if((attrNum < (schema.num_attr()-1))&&(!(data.equals(""))))
                    System.out.print(separator);
                
            }
        }
    }
    
    /** Checks if this Instance is labelled.
     * @returns TRUE if the Instance is labelled, FALSE otherwise.
     * @return TRUE if the Instance contains a label value, FALSE otherwise.
     */
    public boolean is_labelled() {
        boolean fatalOnFalse = false;
        return schema.is_labelled();
    }
    
    /** Checks if this Instance is labelled.
     * @return TRUE if the Instance is labelled, FALSE otherwise.
     * @param fatalOnFalse TRUE if an Error message should be displayed if there
     * is no label for this Instance, FALSE otherwise.
     */
    public boolean is_labelled(boolean fatalOnFalse) {
        return schema.is_labelled(fatalOnFalse);
    }
    
    
    /** Returns the information about the label this Instance is categorized as.
     * @return The information about the label value.
     */
    public AttrInfo label_info() {
        if (!schema.is_labelled())
            Error.fatalErr("Instance::label_info(): label is not set ");
        return schema.label_info();
    }
    
    /** Transfers this Instance to a String value.
     * @return A String with representations of the data stored in this Instance.
     */
    public String toString() {
        boolean displayWeight = false;
        boolean normalizeReals = false;
        String rtrn = "";
        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(normalizeReals && ai.can_cast_to_real()){
                RealAttrInfo rai = ai.cast_to_real();
                if(rai.is_unknown(values[attrNum]))
                    rtrn = rtrn + "?";//Globals.UNKNOWN_VAL_STR;
                else
                    rtrn = rtrn + rai.normalized_value(values[attrNum]);
                if(attrNum < schema.num_attr() -1)

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
麻豆精品视频在线观看免费| 成人午夜在线视频| 无吗不卡中文字幕| 亚洲乱码国产乱码精品精可以看| 中文一区一区三区高中清不卡| 久久午夜电影网| 久久亚洲免费视频| 久久精品人人做人人综合| 26uuu亚洲综合色| 久久久久久久久久美女| 久久久国产一区二区三区四区小说| 久久人人爽人人爽| 中文字幕av一区二区三区免费看| 国产精品国产三级国产aⅴ中文| 国产精品国产三级国产aⅴ中文| 日韩一区欧美一区| 一区二区三区欧美日韩| 亚洲宅男天堂在线观看无病毒| 亚洲一区二区在线免费看| 天天亚洲美女在线视频| 麻豆91在线看| 国产成人精品综合在线观看| 99re66热这里只有精品3直播| 91一区一区三区| 欧美日韩综合在线| 欧美一级高清片| 国产亚洲精品aa| 中文字幕永久在线不卡| 亚洲一区在线视频| 久久狠狠亚洲综合| 成人av网址在线| 在线看日本不卡| 精品乱码亚洲一区二区不卡| 国产亚洲精品7777| 一区二区三区精品久久久| 日韩经典中文字幕一区| 国产成人一区二区精品非洲| 91久久奴性调教| 欧美成人aa大片| 综合亚洲深深色噜噜狠狠网站| 亚洲第一激情av| 国内国产精品久久| 成人小视频免费在线观看| 欧美日韩一区二区三区在线| 26uuu另类欧美| 一区二区在线观看不卡| 麻豆中文一区二区| 91视视频在线直接观看在线看网页在线看| 欧美日韩在线播| 国产欧美精品一区二区色综合 | 337p粉嫩大胆噜噜噜噜噜91av| 国产精品水嫩水嫩| 日韩av在线免费观看不卡| 成人一区二区三区视频在线观看| 欧美蜜桃一区二区三区| 国产免费成人在线视频| 日韩二区三区四区| 91在线视频观看| 26uuu精品一区二区三区四区在线| 综合电影一区二区三区 | 欧美大白屁股肥臀xxxxxx| 国产精品视频免费看| 亚洲一线二线三线视频| 国内精品视频666| 色综合天天综合网天天狠天天| 欧美日韩国产精品自在自线| 久久久久久久久久久99999| 日韩美女视频19| 美女视频免费一区| 93久久精品日日躁夜夜躁欧美| 91精品国产综合久久久蜜臀粉嫩| 国产日本亚洲高清| 偷拍一区二区三区四区| jizzjizzjizz欧美| 欧美电影精品一区二区| 国产精品色在线观看| 久久精品久久精品| 国产成人亚洲精品青草天美| 欧美日韩成人综合在线一区二区| 国产乱码一区二区三区| 青青草国产精品97视觉盛宴| 不卡一区二区三区四区| 欧美亚洲免费在线一区| 日韩伦理电影网| 国产一区二区不卡| 欧美日韩成人一区二区| 中文字幕一区二区三区在线不卡 | 日韩免费观看高清完整版| 亚洲欧美区自拍先锋| 国产美女主播视频一区| 日韩免费高清av| 午夜视频一区在线观看| 91免费小视频| 国产情人综合久久777777| 日本vs亚洲vs韩国一区三区| 欧美专区在线观看一区| 国产精品久久精品日日| 国产一区二区毛片| 在线电影一区二区三区| 亚洲欧美在线视频| 国产经典欧美精品| 久久久亚洲精华液精华液精华液| 伊人性伊人情综合网| 99精品国产热久久91蜜凸| 日韩欧美国产1| 日韩中文欧美在线| 欧美色网一区二区| 一区二区免费在线播放| 国产精品一区二区在线播放 | 欧美视频在线观看一区二区| 亚洲欧美另类图片小说| av电影在线观看不卡| 精品久久久久久亚洲综合网| 国产一区二区三区黄视频 | 欧美日韩久久久久久| 亚洲乱码国产乱码精品精的特点 | 日韩一级免费观看| 性欧美疯狂xxxxbbbb| 91香蕉国产在线观看软件| 国产精品免费av| 国产69精品久久久久777| 久久久精品日韩欧美| 狠狠狠色丁香婷婷综合激情| 精品国产91洋老外米糕| 精品无人区卡一卡二卡三乱码免费卡 | 免费高清不卡av| 日韩欧美卡一卡二| 精一区二区三区| 久久伊人蜜桃av一区二区| 国产一区不卡视频| 欧美国产国产综合| 波多野结衣中文字幕一区二区三区| 国产精品污污网站在线观看| 国产精品12区| 中文字幕免费不卡| jlzzjlzz亚洲女人18| 一区二区视频在线| 欧美疯狂做受xxxx富婆| 日韩成人伦理电影在线观看| 日韩欧美专区在线| 国产一区二三区好的| 亚洲人成伊人成综合网小说| 日本丶国产丶欧美色综合| 亚洲高清视频中文字幕| 欧美一级免费观看| 久久99精品久久久久婷婷| 久久久久国产精品麻豆ai换脸 | 粉嫩欧美一区二区三区高清影视| 中文av字幕一区| 色一情一伦一子一伦一区| 亚洲一区二区三区四区中文字幕| 欧美视频一区二区| 九九热在线视频观看这里只有精品| 久久网站最新地址| 91蜜桃免费观看视频| 午夜电影久久久| 久久久蜜臀国产一区二区| 91视频精品在这里| 麻豆精品一二三| 国产精品久久久爽爽爽麻豆色哟哟| av爱爱亚洲一区| 青草国产精品久久久久久| 国产精品美女一区二区| 精品视频一区二区不卡| 国产精品资源站在线| 亚洲黄色录像片| 日韩免费视频一区| 91免费视频网| 天天综合色天天综合色h| 精品国产伦一区二区三区观看方式 | 亚洲综合视频网| 久久久美女毛片| 欧美中文字幕亚洲一区二区va在线 | 日韩视频国产视频| 99v久久综合狠狠综合久久| 日韩国产一二三区| 国产精品久久久久久久久久久免费看 | 麻豆freexxxx性91精品| 中文字幕佐山爱一区二区免费| 欧美日本一区二区三区| 高清成人在线观看| 日韩**一区毛片| 亚洲精品国产第一综合99久久| 欧美成人乱码一区二区三区| 在线免费亚洲电影| 成人免费三级在线| 天天av天天翘天天综合网| 欧美精彩视频一区二区三区| 欧美疯狂性受xxxxx喷水图片| 99久久99久久综合| 精品亚洲成a人| 日韩在线观看一区二区| 18成人在线视频| 精品国产一区二区精华| 在线观看av一区二区| 波多野结衣在线aⅴ中文字幕不卡| 日本一不卡视频| 亚洲国产一区二区视频| 中文字幕视频一区| 久久久精品免费网站|