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

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

?? instance.java

?? 用C編寫的數據挖掘的相關算法
?? 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| 国产美女主播视频一区| 色婷婷久久久久swag精品| 国产精品久久久久三级| 极品瑜伽女神91| 久久影视一区二区| 美国十次综合导航| 欧美成人精品福利| 国产一区二区三区蝌蚪| 精品久久久久久久久久久久久久久| 樱桃视频在线观看一区| 日本精品一区二区三区四区的功能| 亚洲欧美在线视频| 色欧美片视频在线观看| 一区二区三区产品免费精品久久75| 成人免费的视频| 一区精品在线播放| 成人网在线免费视频| 国产日韩一级二级三级| 国产在线精品一区二区| 精品精品欲导航| 毛片av一区二区三区| 欧美成人video| 国产乱一区二区| 亚洲三级电影全部在线观看高清| 成人高清免费观看| 秋霞电影网一区二区| 中文字幕精品一区| 91精品久久久久久久久99蜜臂| 精品综合免费视频观看| 国产精品精品国产色婷婷| 欧美性生活久久| 亚洲国产成人高清精品| 欧美亚洲禁片免费| 国产精品一二三| 日韩高清不卡一区二区| 一色屋精品亚洲香蕉网站| 欧美一区二区大片| 色94色欧美sute亚洲线路一久| 久久精品99久久久| 亚洲国产视频一区| 国产精品进线69影院| 精品国产第一区二区三区观看体验| 99re这里只有精品视频首页| 麻豆freexxxx性91精品| 午夜精品久久久久久| 日本一区二区成人在线| 日韩欧美国产麻豆| 制服.丝袜.亚洲.中文.综合| 欧日韩精品视频| 欧美色图激情小说| 欧美色精品天天在线观看视频| 色噜噜狠狠一区二区三区果冻| 北条麻妃一区二区三区| 岛国精品一区二区| 国产在线视频一区二区三区| 蜜臀久久久99精品久久久久久| 亚洲国产一区二区a毛片| 久久久不卡网国产精品一区| 日韩一区二区视频在线观看| 欧美色爱综合网| 91天堂素人约啪| 一本久道中文字幕精品亚洲嫩| 国产乱码精品一区二区三区av| 麻豆专区一区二区三区四区五区| 精品国产一区二区三区久久久蜜月| 91福利国产精品| 欧美色图激情小说| 欧美日韩国产成人在线免费| 日韩欧美中文一区| 欧美变态口味重另类| 久久久久久久综合日本| 久久久精品影视| 国产精品久久久久四虎| 午夜亚洲福利老司机| 国产白丝精品91爽爽久久| 91在线观看一区二区| 在线电影院国产精品| 欧美成人精品二区三区99精品| 精品少妇一区二区三区在线播放| 精品国产乱码久久久久久夜甘婷婷| 日韩一级片在线播放| 欧美一卡二卡三卡四卡| 久久综合久久综合久久综合| 国产精品美女久久福利网站| 亚洲欧美日韩国产综合| 成人亚洲精品久久久久软件| 欧美久久久久久久久久| 国产精品家庭影院| 国产福利一区在线| 色综合色狠狠天天综合色| 久久精品日韩一区二区三区| 亚洲男女一区二区三区| 日韩av电影免费观看高清完整版在线观看 | 亚洲精品在线免费观看视频| 尤物视频一区二区| 狠狠色丁香婷综合久久| 欧美一卡二卡在线观看| 亚洲欧美日韩在线不卡| aa级大片欧美| 中文字幕欧美激情| 日本vs亚洲vs韩国一区三区| av亚洲精华国产精华精华| 精品88久久久久88久久久| 一区二区三区欧美| 粉嫩在线一区二区三区视频| 国产日韩亚洲欧美综合| 免费观看一级特黄欧美大片| 欧美日韩视频第一区| 亚洲色图在线播放| 色婷婷av一区二区三区之一色屋| 欧美日韩精品一区二区在线播放| 亚洲综合小说图片| 欧美性高清videossexo| 日本在线播放一区二区三区| 欧美一区二区日韩一区二区| 亚洲国产精品影院| 91浏览器入口在线观看| 国产精品私人影院| 欧美网站一区二区| 偷拍自拍另类欧美| 欧美人妖巨大在线| 久久国产婷婷国产香蕉| 亚洲人吸女人奶水| 91极品视觉盛宴| 伊人色综合久久天天人手人婷| 日韩综合一区二区| 精品久久久久久久久久久久久久久久久| 亚洲电影视频在线| 久久久av毛片精品| 99在线热播精品免费| 亚洲综合在线电影| 日韩一级黄色大片| 成人午夜在线视频| 亚洲成a人v欧美综合天堂下载| 日韩午夜激情电影| www.亚洲精品| 蜜臀精品一区二区三区在线观看| 欧美大度的电影原声| 99久久99久久精品免费看蜜桃| 亚洲福利视频一区| 精品国产1区2区3区| 欧美这里有精品| 国产精品自拍在线| 日韩经典一区二区| 亚洲一二三区在线观看| 26uuu精品一区二区| 欧美写真视频网站| 精品综合久久久久久8888| 国产精品私房写真福利视频| 欧美视频在线一区二区三区| 成人综合在线观看| 国产综合色在线| 日韩avvvv在线播放| 香蕉乱码成人久久天堂爱免费| 国产日韩三级在线| 久久久久久久综合日本| 欧美成人精精品一区二区频| 欧美日韩精品欧美日韩精品一| 99精品黄色片免费大全| 99精品一区二区| 99re这里只有精品6| 99久久久精品| 成+人+亚洲+综合天堂| kk眼镜猥琐国模调教系列一区二区| 国产精品中文有码| 成人av资源站| 色综合 综合色| 欧美美女一区二区| 欧美久久一二区| 欧美激情艳妇裸体舞| 青娱乐精品视频| 91黄色免费看| 国产精品久久久久久一区二区三区| 老司机精品视频导航| 色婷婷综合激情| 日韩伦理免费电影| 国产91在线观看丝袜| 精品少妇一区二区三区免费观看 | 久久精品国产精品青草| 国内精品第一页| 在线观看日韩高清av| 久久久亚洲欧洲日产国码αv| 亚洲美女免费视频| 亚洲成人激情社区| 国产成人综合自拍| 色美美综合视频| 亚洲精品一区在线观看| 一级女性全黄久久生活片免费| 美女视频免费一区| 欧美性猛片aaaaaaa做受| 久久精品综合网| 久久精品国产精品亚洲红杏| 在线视频亚洲一区| 中文字幕的久久| 久久精品国产一区二区| 欧美大片国产精品| 九色|91porny| 国产精品私人影院| 99re这里只有精品6|