亚洲欧美第一页_禁久久精品乱码_粉嫩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一区 二区| 亚洲一区免费视频| 国内偷窥港台综合视频在线播放| 国产伦精品一区二区三区视频青涩 | 91免费观看视频| 正在播放一区二区| 1024成人网色www| 国产一区视频导航| 欧美私模裸体表演在线观看| 欧美久久久久久久久中文字幕| 久久久蜜桃精品| 久久国内精品自在自线400部| 色屁屁一区二区| 国产人久久人人人人爽| 国内精品久久久久影院色| 欧美一区二区三区四区高清| 一区二区三区中文在线| www.日韩精品| 亚洲欧美在线视频观看| 成人精品免费视频| 国产亚洲欧美中文| 国产成人精品影院| 久久久久久久av麻豆果冻| 国产精品一区二区免费不卡| 精品成a人在线观看| 国产成人午夜99999| 自拍av一区二区三区| 91色视频在线| 看电视剧不卡顿的网站| 亚洲精品一区二区三区香蕉 | 中文字幕一区在线| 欧美日韩视频在线一区二区 | 激情小说欧美图片| 欧美激情在线免费观看| 在线国产电影不卡| 麻豆精品一区二区综合av| 久久久久综合网| 欧美日韩综合不卡| 粉嫩欧美一区二区三区高清影视| 亚洲欧美在线视频| 久久影院午夜论| 欧美日韩精品三区| 成人一区二区三区在线观看 | 国产日韩欧美精品电影三级在线| 91福利在线看| www.亚洲色图| 国产精品18久久久久久久久久久久| 亚洲猫色日本管| 国产精品国产三级国产aⅴ中文| 欧美二区三区91| 欧美日免费三级在线| 不卡免费追剧大全电视剧网站| 久久精品久久久精品美女| 亚洲综合久久久| 尤物av一区二区| 一区二区三区四区蜜桃| 亚洲日本成人在线观看| 亚洲欧洲日韩综合一区二区| 国产亚洲欧洲997久久综合| 国产精品久久久久久久久免费桃花 | 天堂成人免费av电影一区| 亚洲已满18点击进入久久| 一区二区免费看| 亚洲国产成人精品视频| 日本不卡的三区四区五区| 黄色资源网久久资源365| 成人av午夜电影| 欧美电影在哪看比较好| 日韩欧美高清dvd碟片| 中文一区一区三区高中清不卡| 一区二区三区四区高清精品免费观看| 亚洲日本一区二区| 久久爱www久久做| 99精品热视频| 欧美一区二区在线看| 中文字幕的久久| 美脚の诱脚舐め脚责91| 91蜜桃传媒精品久久久一区二区| 精品视频在线视频| 亚洲精品一区二区三区影院| 国产精品午夜春色av| 久久精品理论片| 91免费看`日韩一区二区| 91精品国产综合久久久久久漫画 | 三级精品在线观看| 99综合影院在线| 亚洲精品在线免费播放| 亚洲国产日韩av| 在线观看亚洲一区| 国产精品久久久久久久蜜臀| 国内精品伊人久久久久影院对白| 欧美午夜片在线观看| 亚洲精选在线视频| 在线观看91视频| 亚洲一区二区精品3399| 欧美影院一区二区三区| 亚洲欧美偷拍三级| 91免费在线视频观看| 一区二区三区中文字幕电影| 色综合久久99| 亚洲国产精品久久久久婷婷884| 色综合久久久久久久久久久| 亚洲乱码国产乱码精品精小说| 一本大道av一区二区在线播放| 亚洲精选免费视频| 欧美精品国产精品| 久久精品国产999大香线蕉| 久久久久久久电影| 欧洲精品视频在线观看| 亚洲大片精品永久免费| 欧美一级夜夜爽| 成人午夜激情视频| 日韩高清一区二区| 亚洲国产精品av| 欧美日韩国产精选| 国产91丝袜在线18| 午夜电影网亚洲视频| 中文字幕乱码久久午夜不卡| 99re8在线精品视频免费播放| 图片区小说区国产精品视频| 国产亚洲精品中文字幕| 制服丝袜亚洲色图| 欧美男人的天堂一二区| av电影在线观看一区| 久久er精品视频| 午夜精品久久久久久不卡8050| 蜜臀国产一区二区三区在线播放| 一区二区三区在线免费播放| 亚洲v日本v欧美v久久精品| 亚洲黄色免费网站| 亚洲欧洲av另类| 亚洲精品国产一区二区三区四区在线 | 欧美一区二区日韩一区二区| 色域天天综合网| 91网站最新地址| 欧美三级乱人伦电影| 欧美性大战久久久| 精品欧美一区二区三区精品久久| 久久久久久久久久久电影| 国产丝袜在线精品| 一级做a爱片久久| 日本成人在线视频网站| 久久99精品久久久久久久久久久久| 美女视频黄免费的久久| 福利一区二区在线| 欧美精品色综合| 久久免费精品国产久精品久久久久| 亚洲欧美日韩国产另类专区| 性做久久久久久久免费看| 依依成人综合视频| 亚洲一区二区视频在线| 日日噜噜夜夜狠狠视频欧美人 | 久久精品视频一区二区三区| 亚洲午夜激情网站| 91免费在线看| 国产精品美女一区二区| 亚欧色一区w666天堂| 99久久精品国产一区| 欧美一区二区大片| 视频一区二区不卡| 91麻豆精品国产| 另类综合日韩欧美亚洲| 色综合久久66| 婷婷丁香激情综合| 欧美日韩另类一区| 丝袜诱惑亚洲看片| 欧美一区午夜视频在线观看| 日韩有码一区二区三区| 欧美日韩日本视频| 一级中文字幕一区二区| 欧美在线制服丝袜| 亚洲综合一区二区精品导航| 欧美午夜电影在线播放| 亚洲国产成人tv| 欧美mv和日韩mv国产网站| 国产毛片精品一区| 一区二区三区久久久| 精品国产污污免费网站入口| 91麻豆免费观看| 国产成人免费视频一区| 欧美aaa在线| 亚洲精品菠萝久久久久久久| 粗大黑人巨茎大战欧美成人| 国产日韩三级在线| 成人a免费在线看| 洋洋成人永久网站入口| 日韩精品一区二区三区在线| 国产高清视频一区| 一区二区三区日韩精品视频| 欧美精品xxxxbbbb| 不卡电影免费在线播放一区| 亚洲自拍偷拍麻豆| 久久久久久久国产精品影院| 91看片淫黄大片一级|