亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
五月婷婷色综合| 久久久久九九视频| 福利电影一区二区三区| 亚洲卡通欧美制服中文| 欧美国产一区在线| 国产精品天干天干在观线| 精品久久久久久无| 久久免费看少妇高潮| 国产丝袜欧美中文另类| 欧美成人欧美edvon| 欧美一区二区三区在线| 欧美性高清videossexo| 日本精品视频一区二区三区| 玉米视频成人免费看| 精品国产乱码久久久久久老虎| 美国av一区二区| 欧美亚男人的天堂| 91精品在线观看入口| 国产经典欧美精品| 久久99国产精品久久| 麻豆精品蜜桃视频网站| av在线播放成人| 欧美一区二区在线免费观看| 91福利社在线观看| 成人av免费观看| 欧美一区二区三区免费观看视频| 欧美一区三区四区| eeuss鲁片一区二区三区| 日韩精品亚洲一区| 捆绑变态av一区二区三区| 免费在线观看成人| 亚洲午夜羞羞片| 亚洲精品自拍动漫在线| 日韩美女视频19| 亚洲免费观看高清完整版在线| 久久草av在线| 欧美伊人久久久久久午夜久久久久| 精品国产乱码久久久久久免费| 色婷婷综合久久久中文一区二区| 日本精品免费观看高清观看| 欧美理论电影在线| 26uuu色噜噜精品一区二区| 欧美变态口味重另类| 依依成人综合视频| 激情都市一区二区| 在线观看欧美日本| 日韩女同互慰一区二区| 亚洲日本在线天堂| 国产精品理伦片| 美国精品在线观看| 欧美日韩激情在线| 国产精品电影院| 日韩一区二区三区电影| 成人中文字幕合集| 色美美综合视频| 国产欧美一区二区三区在线看蜜臀 | 久久久精品2019中文字幕之3| 日韩欧美一级二级| 日韩精品成人一区二区在线| 日产精品久久久久久久性色| 亚洲一区二区av在线| 久久综合久久综合九色| 成人一区在线观看| 欧美日韩国产免费一区二区| 成人精品国产福利| 日本久久电影网| 国产精品国产三级国产三级人妇 | 日韩va欧美va亚洲va久久| 亚洲影院久久精品| 99久久精品免费观看| 国产日韩欧美精品在线| 国产91丝袜在线18| 亚洲精选视频免费看| 夜夜揉揉日日人人青青一国产精品| 精品国内二区三区| 国产盗摄视频一区二区三区| 中文字幕在线一区| 91成人在线免费观看| 91蝌蚪porny| 久久精品国产成人一区二区三区 | 国产欧美日韩不卡免费| 欧美精品视频www在线观看| 久久国产精品99久久久久久老狼| 国产亚洲精品aa| 91精品国产综合久久香蕉麻豆 | 欧美一区二区三区免费大片| 国产专区欧美精品| 久久久久久久久久久久电影| 亚洲午夜久久久| 国产精品国产a级| 欧美男同性恋视频网站| 色婷婷综合久色| 成人一区在线观看| 在线区一区二视频| 97aⅴ精品视频一二三区| 青青青爽久久午夜综合久久午夜| 久久精品国产亚洲高清剧情介绍| 国产精品亚洲专一区二区三区 | 久久久国产午夜精品| 不卡一二三区首页| 8x福利精品第一导航| 国产乱人伦偷精品视频不卡| 亚洲成av人片一区二区梦乃 | 久久嫩草精品久久久精品| 国产精品综合久久| 亚洲精选一二三| 7777精品伊人久久久大香线蕉的 | 久久99精品国产.久久久久 | 91精品办公室少妇高潮对白| 亚洲mv在线观看| 欧美成人一区二区三区片免费 | 91福利社在线观看| 日韩精品五月天| 亚洲精品一区二区三区香蕉| 99视频热这里只有精品免费| 日本视频在线一区| 中文字幕不卡在线观看| 久久91精品久久久久久秒播| 中文字幕av在线一区二区三区| 久久精品日产第一区二区三区高清版 | 4438成人网| 欧美伦理影视网| 亚洲国产日韩一区二区| 国产福利一区在线| 国产欧美精品一区二区色综合 | 欧美日韩国产影片| 蜜桃视频在线观看一区| 亚洲天堂免费在线观看视频| 日本精品一区二区三区四区的功能| 久久精品久久精品| 亚洲一级片在线观看| 国产精品色呦呦| 日韩欧美国产三级| 色婷婷久久一区二区三区麻豆| 九色porny丨国产精品| 亚洲影视在线播放| 国产欧美日韩综合精品一区二区| 精品婷婷伊人一区三区三| 成a人片亚洲日本久久| 国产精品白丝jk黑袜喷水| 日本亚洲免费观看| 亚洲成人免费在线观看| 亚洲精品水蜜桃| 国产精品日日摸夜夜摸av| 欧美一区二区三区喷汁尤物| 欧美三级中文字幕| 欧美三级中文字| 欧美视频一二三区| 欧美亚洲丝袜传媒另类| 欧美视频在线一区二区三区| 国产aⅴ综合色| 成人性生交大片免费看视频在线 | 国产精品不卡视频| 久久久亚洲精华液精华液精华液 | 亚洲免费观看高清完整版在线观看熊 | 欧美性大战久久| 欧美羞羞免费网站| 色视频成人在线观看免| 91在线播放网址| 欧美亚洲动漫精品| 欧美精品粉嫩高潮一区二区| 91精品国产一区二区三区香蕉| 日韩免费性生活视频播放| 欧美一区二区三区喷汁尤物| 欧美日韩在线免费视频| 日本乱人伦一区| 欧美视频一二三区| 精品国产成人系列| 国产精品乱人伦中文| 亚洲视频一区二区在线| 午夜国产精品影院在线观看| 蜜臀av性久久久久蜜臀aⅴ四虎 | 26uuu色噜噜精品一区二区| 久久久影视传媒| 亚洲欧美日韩小说| 天堂精品中文字幕在线| 午夜婷婷国产麻豆精品| 婷婷激情综合网| 狠狠色丁香婷婷综合久久片| 国产成人精品免费在线| 色综合久久久久综合体桃花网| 99久久精品免费| 欧美日韩1234| 国产欧美日韩综合精品一区二区| 亚洲欧美视频在线观看| 日本午夜精品视频在线观看| 成人一区二区在线观看| 欧美一级二级三级乱码| 国产精品久久久久影视| 亚洲丝袜另类动漫二区| 一区二区三区中文字幕在线观看| 亚洲成va人在线观看| 亚洲综合免费观看高清完整版| 精品一区二区三区免费| 亚洲综合清纯丝袜自拍| 亚洲情趣在线观看| 爽好多水快深点欧美视频| 狠狠色丁香婷婷综合久久片| 日本丶国产丶欧美色综合| 国产高清成人在线|