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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? instance.java

?? 用C編寫的數(shù)據(jù)挖掘的相關(guān)算法
?? 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)

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美三级资源在线| 国产成人精品一区二区三区网站观看 | 国产精品午夜久久| 国产精品66部| 国产精品你懂的在线欣赏| 99精品国产99久久久久久白柏| 日韩毛片高清在线播放| 色老汉av一区二区三区| 日韩电影在线观看电影| 精品日韩一区二区三区| 成人福利视频在线| 亚洲国产cao| 日韩三级.com| 成人免费三级在线| 洋洋成人永久网站入口| 精品免费一区二区三区| www.欧美亚洲| 亚洲成a天堂v人片| 久久久精品免费网站| 99国产精品久久| 日本亚洲最大的色成网站www| 26uuu精品一区二区三区四区在线| 成人一二三区视频| 性感美女极品91精品| 国产日韩精品久久久| 欧美综合在线视频| 国产一区二区三区av电影| 亚洲欧洲日韩av| 欧美mv日韩mv亚洲| 色综合 综合色| 另类小说欧美激情| 亚洲尤物视频在线| 国产无遮挡一区二区三区毛片日本| 色先锋资源久久综合| 国产一区二区三区香蕉| 亚洲无线码一区二区三区| 久久精品免视看| 日韩亚洲欧美一区二区三区| jizz一区二区| 黄一区二区三区| 香蕉加勒比综合久久| 日本一区二区三区四区在线视频 | 制服视频三区第一页精品| 风间由美一区二区三区在线观看 | 黑人巨大精品欧美一区| 一区二区三区波多野结衣在线观看| 精品国产青草久久久久福利| 欧美性色欧美a在线播放| 成人精品国产福利| 国产精品综合一区二区| 日韩国产欧美三级| 亚洲一区欧美一区| 中文字幕亚洲不卡| 中文字幕av一区二区三区高 | 欧美日韩精品久久久| 成人免费视频一区二区| 看片的网站亚洲| 日韩精品一二区| 亚洲va欧美va人人爽| 夜夜夜精品看看| 亚洲激情在线播放| 亚洲视频在线一区观看| 欧美国产欧美综合| 久久久91精品国产一区二区精品| 日韩精品在线一区| 91超碰这里只有精品国产| 欧美丝袜第三区| 欧美日韩亚洲综合在线| 91精品1区2区| 在线一区二区三区| 欧洲中文字幕精品| 色婷婷久久久亚洲一区二区三区 | 99精品一区二区三区| 成人免费的视频| 成人app网站| 成人一级片在线观看| 顶级嫩模精品视频在线看| 国产成人自拍高清视频在线免费播放| 久久99热这里只有精品| 久久99精品国产.久久久久 | 中文字幕一区二区日韩精品绯色| 日本一区二区久久| 国产精品久久久久久亚洲毛片 | 中国av一区二区三区| 国产精品美女久久久久aⅴ| 日本一区二区免费在线观看视频| 欧美激情资源网| 亚洲视频中文字幕| 亚洲v中文字幕| 精品制服美女久久| 国产成人8x视频一区二区 | 丝袜国产日韩另类美女| 麻豆中文一区二区| 国产黄色成人av| 色悠悠久久综合| 欧美剧情片在线观看| 欧美成人性福生活免费看| 久久久久久久av麻豆果冻| 国产精品理伦片| 亚洲高清久久久| 久久99久久99精品免视看婷婷| 国产精品一二三四| 色狠狠综合天天综合综合| 欧美乱熟臀69xxxxxx| 国产视频在线观看一区二区三区| 成人欧美一区二区三区黑人麻豆| 夜夜嗨av一区二区三区四季av| 男女性色大片免费观看一区二区 | 午夜久久电影网| 国精产品一区一区三区mba桃花| 国产成人午夜电影网| 欧美午夜视频网站| 久久一夜天堂av一区二区三区| 综合久久综合久久| 男人的天堂久久精品| 99久久精品国产观看| 56国语精品自产拍在线观看| 国产色婷婷亚洲99精品小说| 亚洲成人免费在线| 国产成人av自拍| 欧美精品在线视频| 国产精品萝li| 免费一级欧美片在线观看| jiyouzz国产精品久久| 日韩欧美黄色影院| 亚洲午夜久久久久中文字幕久| 狠狠色狠狠色综合| 欧美人与z0zoxxxx视频| 国产精品欧美综合在线| 日本vs亚洲vs韩国一区三区二区| av中文一区二区三区| 久久久久久久久久久久久久久99| 怡红院av一区二区三区| 国产成人在线网站| 欧美精品成人一区二区三区四区| 中文字幕亚洲综合久久菠萝蜜| 极品少妇xxxx偷拍精品少妇| 欧美视频日韩视频在线观看| 欧美国产日韩亚洲一区| 蜜桃视频第一区免费观看| 色悠久久久久综合欧美99| 亚洲国产精品成人综合色在线婷婷| 日韩一区精品视频| 欧美色大人视频| 尤物av一区二区| 色综合咪咪久久| 国产精品激情偷乱一区二区∴| 精品亚洲porn| 日韩写真欧美这视频| 婷婷激情综合网| 欧美亚洲高清一区二区三区不卡| 国产精品美女久久久久久| 国产精品12区| 国产日韩欧美精品在线| 激情丁香综合五月| 26uuu国产电影一区二区| 日韩av一二三| 欧美另类久久久品| 亚洲18色成人| 91超碰这里只有精品国产| 午夜av区久久| 欧美日本国产视频| 日韩成人精品在线| 欧美一区二区日韩一区二区| 亚洲成人在线免费| 欧美日韩国产在线播放网站| 亚洲电影激情视频网站| 欧美影院一区二区| 天天综合日日夜夜精品| 91精品国产福利| 美美哒免费高清在线观看视频一区二区| 在线观看中文字幕不卡| 午夜欧美2019年伦理| 欧美日韩亚洲综合| 蜜桃视频在线一区| 久久综合一区二区| 国产 欧美在线| 亚洲欧洲日韩一区二区三区| 97久久人人超碰| 亚洲高清免费在线| 欧美成人性战久久| 国产91清纯白嫩初高中在线观看| 国产精品久久久久久久久图文区| 豆国产96在线|亚洲| 亚洲视频一二三区| 欧美另类高清zo欧美| 久久精品国产精品亚洲精品 | 欧美变态凌虐bdsm| 国产精品66部| 国产精品乱码妇女bbbb| 91麻豆视频网站| 亚洲高清中文字幕| 精品国产亚洲一区二区三区在线观看| 国产呦萝稀缺另类资源| 国产精品视频yy9299一区| 在线免费精品视频| 久久精品免费观看| 国产精品福利在线播放| 欧美色倩网站大全免费| 国产在线精品一区二区不卡了|