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

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

?? instance.java

?? 基于數據挖掘的決策樹改進算法和貝葉斯改進算法
?? 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一区二区三区免费野_久草精品视频
亚洲国产视频一区| 91久久精品一区二区二区| 不卡的av电影| 欧美精品日韩综合在线| 国产精品乱人伦| 另类专区欧美蜜桃臀第一页| 日本乱人伦一区| 国产欧美日韩一区二区三区在线观看| 亚洲电影一级片| 丁香五精品蜜臀久久久久99网站 | 日韩一区二区三区电影在线观看| 26uuu亚洲综合色| 日韩和欧美一区二区三区| 91女人视频在线观看| 久久久久久久网| 久久99国产精品尤物| 欧美精品日韩一本| 亚洲综合免费观看高清完整版在线| 国产成人精品免费看| 日韩一级片在线播放| 亚洲综合激情网| 色婷婷精品久久二区二区蜜臀av| 国产日韩欧美高清在线| 日韩av中文字幕一区二区三区| 99在线精品观看| 亚洲色图20p| 亚洲一二三四在线| 欧美久久一区二区| 中文字幕亚洲欧美在线不卡| 国产精品素人视频| 国产精品国产三级国产a| 亚洲一级电影视频| 欧美私人免费视频| 亚洲裸体xxx| 色婷婷激情一区二区三区| 亚洲日本青草视频在线怡红院| 风间由美性色一区二区三区| 国产精品婷婷午夜在线观看| 成人午夜电影小说| 亚洲视频在线观看三级| 91在线视频免费观看| 18欧美亚洲精品| 99re热视频精品| 欧美性色黄大片手机版| 国产麻豆成人传媒免费观看| 欧美α欧美αv大片| 国产酒店精品激情| 国产精品毛片久久久久久| av网站一区二区三区| 亚洲欧美偷拍卡通变态| 欧美优质美女网站| 日本欧美一区二区| 久久日一线二线三线suv| 国产一区视频在线看| 国产精品国产三级国产aⅴ入口 | 一本一道久久a久久精品综合蜜臀| 国产欧美日韩不卡| 91视频91自| 日本欧美一区二区三区乱码| 国产日韩欧美不卡| 在线观看视频一区| 久久91精品久久久久久秒播| 日韩精品在线一区| 亚洲三级小视频| 亚洲欧美国产高清| 亚洲一区二区三区爽爽爽爽爽| 欧美肥胖老妇做爰| 国产美女在线观看一区| 亚洲另类色综合网站| 欧美日韩国产高清一区二区| 久久99久久久久| 亚洲色图制服诱惑| 日韩亚洲欧美中文三级| 成人18视频在线播放| 美女看a上一区| 亚洲激情一二三区| 久久蜜桃av一区精品变态类天堂 | 欧美va亚洲va在线观看蝴蝶网| 99精品久久久久久| 精品综合久久久久久8888| 亚洲乱码一区二区三区在线观看| 欧美大片在线观看一区二区| 国产精品灌醉下药二区| 欧美美女一区二区在线观看| 成人欧美一区二区三区| 亚洲欧洲av在线| 欧美一级二级三级乱码| 91啪亚洲精品| 国产乱码精品一区二区三区av| 亚洲综合久久久| 中文字幕日韩一区二区| 久久青草欧美一区二区三区| 欧美丝袜丝nylons| 色综合中文字幕国产| 久久精品国内一区二区三区| 亚洲综合图片区| 亚洲视频在线一区观看| 国产精品久久久久久久久果冻传媒| 日韩一区二区免费在线电影| 久久蜜臀精品av| 精品国产乱码久久| 69堂成人精品免费视频| 欧美日韩精品免费| 欧美日韩中字一区| 在线观看区一区二| 91麻豆国产香蕉久久精品| 午夜精品久久久久久久99樱桃| 99视频在线观看一区三区| 丝袜美腿高跟呻吟高潮一区| 亚洲精品国产一区二区精华液| 国产精品乱人伦一区二区| 国产精品久久久一本精品| 中文一区二区完整视频在线观看| 久久夜色精品国产欧美乱极品| 精品国产人成亚洲区| 久久综合狠狠综合久久激情| 精品美女一区二区| 日韩欧美国产成人一区二区| 日韩欧美精品在线| 久久久久免费观看| 国产人妖乱国产精品人妖| 欧美激情一区二区三区不卡| 中文字幕巨乱亚洲| 亚洲精品视频免费看| 亚洲福利视频导航| 视频在线观看国产精品| 蜜臀av性久久久久蜜臀aⅴ流畅| 日韩va欧美va亚洲va久久| 韩国一区二区视频| 国产精品一线二线三线| 成人黄色大片在线观看| 91久久免费观看| 欧美一区二区久久久| 26uuu国产在线精品一区二区| 国产视频一区二区在线观看| 亚洲精品免费视频| 日韩高清中文字幕一区| 久久er精品视频| 成人禁用看黄a在线| 欧美性生活大片视频| 精品理论电影在线观看| 国产精品理论在线观看| 亚洲成av人片在www色猫咪| 蜜臀av亚洲一区中文字幕| 成人亚洲一区二区一| 精品视频一区 二区 三区| 日韩欧美一区电影| 国产精品久久久久影院亚瑟| 亚洲成人免费在线观看| 国产精品小仙女| 欧美日韩国产一二三| 国产拍揄自揄精品视频麻豆| 一区二区三区**美女毛片| 狠狠狠色丁香婷婷综合久久五月| caoporm超碰国产精品| 91精品一区二区三区久久久久久| 日本一区二区三区久久久久久久久不| 亚洲乱码国产乱码精品精的特点| 青青草97国产精品免费观看无弹窗版| 国产a久久麻豆| 欧美日韩国产免费| 国产精品色哟哟网站| 美女视频一区二区| 色综合久久久网| 久久久五月婷婷| 日韩专区中文字幕一区二区| av中文字幕亚洲| 久久一夜天堂av一区二区三区| 亚洲国产一区在线观看| 成人精品免费看| 2欧美一区二区三区在线观看视频 337p粉嫩大胆噜噜噜噜噜91av | 精品国产污网站| 视频在线观看一区| 色婷婷亚洲婷婷| 国产精品免费丝袜| 狠狠色综合色综合网络| 欧美高清hd18日本| 亚洲激情在线激情| 99国产精品视频免费观看| 欧美精品一区二区三区蜜臀| 蜜臀国产一区二区三区在线播放 | 美女免费视频一区二区| 精品视频在线免费| 亚洲一区在线观看免费 | 国模无码大尺度一区二区三区| 欧美日韩电影一区| 一区二区免费在线| 色综合欧美在线| 亚洲欧美另类图片小说| 99久久婷婷国产综合精品| 国产精品成人免费在线| 国产成人免费视| 日本一区二区在线不卡| 国产超碰在线一区| 欧美国产精品一区二区三区| 国产成人精品www牛牛影视| 欧美成人精品二区三区99精品| 免费xxxx性欧美18vr| 欧美一级高清大全免费观看| 美女免费视频一区|