亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
欧美日韩一区精品| 日本一区二区三区四区在线视频| 欧美大片在线观看| 亚洲色图一区二区| 久久激五月天综合精品| 欧美性猛交xxxx黑人交| 国产三级欧美三级| 日av在线不卡| 在线观看国产精品网站| 亚洲国产精品成人综合| 蜜臀久久99精品久久久画质超高清| av一二三不卡影片| 久久视频一区二区| 美女在线视频一区| 欧美精选一区二区| 一区二区欧美在线观看| 99综合电影在线视频| 久久久久国产精品人| 免费欧美日韩国产三级电影| 欧美日韩第一区日日骚| 亚洲激情第一区| 94-欧美-setu| 国产日韩精品一区二区浪潮av| 蜜臀久久99精品久久久久宅男| 欧美日韩国产区一| 亚洲综合丝袜美腿| 欧美亚洲动漫精品| 伊人开心综合网| 一道本成人在线| ...xxx性欧美| 91久久线看在观草草青青| 中文字幕制服丝袜一区二区三区| 国产福利精品一区| 国产亚洲欧美一区在线观看| 老司机午夜精品| 日韩欧美国产wwwww| 国产欧美一区二区精品婷婷| 在线视频欧美区| 亚洲资源中文字幕| 欧美久久久久久久久中文字幕| 午夜欧美大尺度福利影院在线看| 在线观看日韩一区| 性做久久久久久久久| 在线播放日韩导航| 狠狠v欧美v日韩v亚洲ⅴ| 国产午夜精品一区二区| 成人丝袜视频网| 亚洲欧美日韩成人高清在线一区| 欧美午夜电影在线播放| 日本午夜精品视频在线观看| 欧美tickling挠脚心丨vk| 国产精品影视在线| 国产精品传媒视频| 欧美精品九九99久久| 久久精品久久精品| 中文字幕av资源一区| 在线视频你懂得一区二区三区| 日韩精品国产欧美| 久久久九九九九| 欧美伊人久久大香线蕉综合69 | 亚洲愉拍自拍另类高清精品| 欧美精品日韩综合在线| 韩国成人精品a∨在线观看| 亚洲国产精品激情在线观看| 欧美亚洲综合一区| 国产成人亚洲精品青草天美| 亚洲女厕所小便bbb| 日韩一级视频免费观看在线| 从欧美一区二区三区| 亚洲综合免费观看高清完整版| 日韩欧美三级在线| av亚洲精华国产精华精| 强制捆绑调教一区二区| 国产精品青草久久| 日韩视频在线你懂得| 91小视频免费观看| 国内精品国产三级国产a久久| 中文字幕一区二区三区四区| 日韩一区二区视频| 97se亚洲国产综合自在线| 日本不卡一二三区黄网| 亚洲欧洲日韩在线| 久久毛片高清国产| 欧美日韩一二三区| 99久久精品国产网站| 毛片av一区二区三区| 亚洲国产视频一区| 亚洲国产精品成人综合| 日韩免费高清av| 欧美影院一区二区三区| aa级大片欧美| 国产激情一区二区三区桃花岛亚洲| 午夜精品久久久久久久99水蜜桃| 亚洲视频一二三区| 久久久777精品电影网影网| 欧美一区二区网站| 欧美性生活大片视频| 欧美区一区二区三区| av在线综合网| 风间由美性色一区二区三区| 美腿丝袜亚洲一区| 日韩电影在线免费看| 一区二区三区波多野结衣在线观看| 国产欧美日韩综合| 久久午夜老司机| 久久婷婷色综合| 精品免费国产二区三区| 欧美一区二区三区性视频| 欧美片网站yy| 欧美欧美午夜aⅴ在线观看| 91官网在线免费观看| 色婷婷综合激情| 91丨porny丨最新| 99久久99久久久精品齐齐| 成人免费毛片片v| 成人的网站免费观看| 大白屁股一区二区视频| 成人一二三区视频| 91年精品国产| 91久久精品日日躁夜夜躁欧美| 99国产欧美另类久久久精品| 成人免费视频播放| 97精品久久久久中文字幕| 色综合天天综合狠狠| 在线观看日韩一区| 337p亚洲精品色噜噜狠狠| 这里只有精品99re| 欧美精品一区二区久久久| 久久综合久色欧美综合狠狠| 久久久国产一区二区三区四区小说 | 最新久久zyz资源站| 亚洲视频你懂的| 亚洲一区二区三区国产| 日韩电影在线免费看| 国产一区二区在线观看视频| 成人午夜免费视频| 色偷偷88欧美精品久久久| 欧美精品久久天天躁| 欧美大片在线观看一区| 欧美极品少妇xxxxⅹ高跟鞋| 亚洲精品成人在线| 日韩av一区二区在线影视| 久久精品99国产国产精| 成人精品鲁一区一区二区| 欧美性大战久久久久久久| 精品成人私密视频| 亚洲天堂福利av| 日韩av电影天堂| 成人毛片在线观看| 欧美日韩成人综合天天影院 | 麻豆精品一区二区三区| 成人听书哪个软件好| 欧美日韩免费高清一区色橹橹 | 国产精品网站在线| 亚洲综合网站在线观看| 激情综合网天天干| 亚洲精品乱码久久久久| 国产三区在线成人av| 亚洲综合一区在线| 国产美女在线精品| 欧美体内she精高潮| 国产女人aaa级久久久级| 亚洲国产欧美日韩另类综合| 国产经典欧美精品| 91精品久久久久久久91蜜桃| 中文字幕亚洲精品在线观看| 日韩不卡一区二区| 91在线高清观看| 久久人人超碰精品| 五月天激情综合网| 99精品国产热久久91蜜凸| 欧美v日韩v国产v| 亚洲一区免费在线观看| 丁香五精品蜜臀久久久久99网站| 日韩欧美中文字幕精品| 亚洲资源在线观看| heyzo一本久久综合| 久久精品视频在线免费观看| 五月婷婷另类国产| 91国在线观看| 18欧美乱大交hd1984| 国产成人在线影院| 精品乱人伦小说| 日韩精品一区第一页| 欧美三级电影在线观看| 中文字幕中文在线不卡住| 国产99久久久国产精品潘金 | 91亚洲永久精品| 国产精品免费久久久久| 国产激情91久久精品导航 | 欧美亚洲精品一区| 136国产福利精品导航| 成人av在线一区二区三区| 国产欧美视频在线观看| 国产福利精品一区二区| 久久欧美中文字幕| 国产在线播放一区| 久久色.com| 国产成人在线观看免费网站| 久久久久国产成人精品亚洲午夜|