亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
国产精品中文字幕日韩精品| 欧美系列在线观看| 色偷偷久久一区二区三区| 欧美经典一区二区| 亚洲综合自拍偷拍| 成人av动漫在线| 精品日韩一区二区三区免费视频| 一区二区日韩电影| 不卡的av电影在线观看| 日韩精品中文字幕一区二区三区| 亚洲免费视频成人| av午夜一区麻豆| 久久蜜臀精品av| 久久国产生活片100| 欧美一区二区在线不卡| 亚洲影视资源网| 一本高清dvd不卡在线观看| 欧美经典一区二区| 国产在线不卡一卡二卡三卡四卡| 欧美日韩一卡二卡| 亚洲最色的网站| 91在线免费播放| **性色生活片久久毛片| 成人一区二区视频| 久久久久99精品一区| 精品一区二区日韩| 日韩女优电影在线观看| 蜜臀av一级做a爰片久久| 在线综合亚洲欧美在线视频| 午夜成人在线视频| 欧美日韩国产在线观看| 香蕉久久一区二区不卡无毒影院 | 国产精品盗摄一区二区三区| 在线观看一区二区精品视频| 国产欧美视频一区二区三区| 国产精品一区二区视频| 久久精子c满五个校花| 国产精品1024| 久久久久99精品国产片| 国产成人啪午夜精品网站男同| 久久嫩草精品久久久久| 国产又粗又猛又爽又黄91精品| 精品卡一卡二卡三卡四在线| 国产一本一道久久香蕉| 中文字幕在线不卡国产视频| 一本大道av一区二区在线播放| 中文字幕日韩精品一区| 91猫先生在线| 婷婷综合另类小说色区| 精品捆绑美女sm三区| 国产ts人妖一区二区| 亚洲欧美日韩在线| 欧美日韩精品二区第二页| 青青草国产成人99久久| 久久老女人爱爱| youjizz国产精品| 午夜精品一区二区三区三上悠亚| 91麻豆精品久久久久蜜臀| 国产剧情在线观看一区二区| 国产精品无人区| 欧美天堂亚洲电影院在线播放| 日本欧美一区二区三区| 三级久久三级久久久| 久久夜色精品一区| 91麻豆免费在线观看| 蜜芽一区二区三区| 国产精品视频一二三| 欧美日韩国产成人在线免费| 国产综合久久久久影院| 亚洲欧美激情一区二区| 精品国产百合女同互慰| 色www精品视频在线观看| 麻豆精品一区二区三区| 亚洲男人的天堂在线aⅴ视频| 日韩欧美国产成人一区二区| 波波电影院一区二区三区| 日本vs亚洲vs韩国一区三区| 国产精品私房写真福利视频| 91麻豆精品国产自产在线 | 久久精品人人做人人综合| 91视频精品在这里| 狠狠色狠狠色合久久伊人| 一级中文字幕一区二区| 欧美极品美女视频| 欧美一级专区免费大片| 色婷婷综合久久久中文一区二区 | 亚洲精品在线网站| 91豆麻精品91久久久久久| 国产精品亚洲午夜一区二区三区 | 国产成人精品在线看| 亚洲国产视频a| 欧美国产精品中文字幕| 日韩精品一区二区三区在线观看 | 亚洲高清免费在线| 中文字幕一区二区三区四区| 亚洲一卡二卡三卡四卡无卡久久| 欧美成人一区二区三区| 欧美日韩国产中文| 欧亚洲嫩模精品一区三区| av在线综合网| 粉嫩蜜臀av国产精品网站| 七七婷婷婷婷精品国产| 亚洲福利视频一区| 亚洲伊人伊色伊影伊综合网| 综合电影一区二区三区 | 亚洲视频小说图片| 中文字幕亚洲欧美在线不卡| 国产蜜臀97一区二区三区| 久久精品日产第一区二区三区高清版| 日韩欧美一区二区三区在线| 欧美日韩卡一卡二| 欧美理论片在线| 欧美精品乱人伦久久久久久| 欧美日韩在线播放三区四区| 欧美三级乱人伦电影| 欧洲精品中文字幕| 欧美日韩精品高清| 欧美一区二区三区免费视频| 欧美一二三四区在线| 日韩免费观看高清完整版| 欧美xxxxx牲另类人与| 日韩欧美激情在线| 国产亚洲欧洲一区高清在线观看| 久久品道一品道久久精品| 国产人成亚洲第一网站在线播放 | 香蕉成人啪国产精品视频综合网| 亚洲人123区| 五月天激情小说综合| 日韩av电影免费观看高清完整版| 奇米影视在线99精品| 狠狠狠色丁香婷婷综合激情| 国产999精品久久| 一本久道久久综合中文字幕| 在线观看日韩电影| 日韩视频一区二区在线观看| 国产亚洲婷婷免费| 艳妇臀荡乳欲伦亚洲一区| 琪琪一区二区三区| 国产成人日日夜夜| 欧洲一区在线电影| 精品国产乱码久久久久久牛牛| 中文字幕乱码久久午夜不卡 | 亚洲成av人片一区二区| 人人狠狠综合久久亚洲| 经典三级在线一区| av在线不卡电影| 在线播放日韩导航| 国产欧美精品日韩区二区麻豆天美| 中文字幕精品一区二区三区精品| 亚洲免费色视频| 麻豆精品视频在线观看| 成人av免费在线播放| 欧美日韩国产乱码电影| 国产网站一区二区| 亚洲国产日韩a在线播放 | 人人爽香蕉精品| 成人精品视频一区二区三区 | 在线免费一区三区| 欧美va亚洲va香蕉在线| 国产精品麻豆99久久久久久| 图片区日韩欧美亚洲| 福利一区二区在线| 91精品黄色片免费大全| 国产精品色噜噜| 奇米色777欧美一区二区| 91蜜桃婷婷狠狠久久综合9色| 91精品国产综合久久香蕉的特点| 国产精品色眯眯| 精品一区二区三区免费观看| 欧美无砖专区一中文字| 国产精品美女久久福利网站| 欧美a级一区二区| 日本韩国一区二区三区视频| 国产欧美一区二区精品婷婷| 免费在线看成人av| 在线视频中文字幕一区二区| 国产午夜亚洲精品羞羞网站| 日韩精品久久久久久| 欧美亚洲一区二区在线观看| 国产精品久久三| 国模冰冰炮一区二区| 91精品国产黑色紧身裤美女| 一区二区三区在线免费视频| 不卡的av中国片| 欧美国产一区视频在线观看| 久久99热国产| 日韩一区二区精品葵司在线| 亚洲第一成人在线| 欧美在线观看一二区| 亚洲男人的天堂网| 久久日韩精品一区二区五区| 视频在线在亚洲| 欧美日韩高清一区| 亚洲国产日韩a在线播放 | 成人精品视频一区二区三区尤物| 精品久久久久99| 精品一区免费av| 日韩精品中文字幕在线不卡尤物| 欧美aaaaa成人免费观看视频| 欧美老年两性高潮|