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

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

?? instance.java

?? 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一区二区三区免费野_久草精品视频
色94色欧美sute亚洲线路二| 中文字幕制服丝袜成人av| 欧美日韩久久一区二区| 欧美亚洲综合一区| 欧美色爱综合网| 欧美视频第二页| 欧美日本免费一区二区三区| 欧美疯狂性受xxxxx喷水图片| 欧美日韩成人综合天天影院| 欧美日本不卡视频| 欧美一级淫片007| 精品国产精品网麻豆系列| 26uuu成人网一区二区三区| 久久综合999| 国产精品久久看| 亚洲老司机在线| 日韩福利电影在线| 极品尤物av久久免费看| 成人激情动漫在线观看| 色香蕉久久蜜桃| 欧美放荡的少妇| 久久人人97超碰com| 国产精品电影一区二区三区| 亚洲一区二区三区免费视频| 日韩激情一二三区| 欧美色区777第一页| 日韩欧美一二区| 中文字幕乱码一区二区免费| ...xxx性欧美| 日韩国产在线观看| 国产suv精品一区二区883| 91麻豆国产香蕉久久精品| 欧美日韩极品在线观看一区| 26uuu亚洲综合色欧美| 亚洲九九爱视频| 久久国产精品99精品国产 | 色综合久久久久综合| 欧美精品高清视频| 久久精品人人做人人综合| 樱花草国产18久久久久| 国产资源在线一区| 色妞www精品视频| 日韩精品一区二区三区视频 | 视频一区中文字幕| 国产精品中文字幕日韩精品| 在线免费精品视频| 精品电影一区二区| 一区二区成人在线视频| 国产乱人伦偷精品视频免下载| 色综合色狠狠综合色| xnxx国产精品| 亚洲国产精品久久久男人的天堂 | 日韩一区二区在线免费观看| 国产精品进线69影院| 日本视频免费一区| 色国产综合视频| 国产欧美综合在线观看第十页| 午夜精品一区在线观看| 99久久精品国产麻豆演员表| 日韩午夜小视频| 亚洲自拍欧美精品| 成人国产精品免费观看动漫| 日韩免费观看高清完整版 | 91色在线porny| 色综合久久88色综合天天免费| 91精品久久久久久久99蜜桃| 欧美韩日一区二区三区| 日本不卡在线视频| 日本韩国欧美在线| 欧美激情艳妇裸体舞| 蜜臀精品久久久久久蜜臀| 色美美综合视频| 国产精品无遮挡| 国内成人精品2018免费看| 欧美军同video69gay| 亚洲精品福利视频网站| 成人晚上爱看视频| 久久综合国产精品| 久久国产尿小便嘘嘘| 欧美色大人视频| 亚洲夂夂婷婷色拍ww47| 97久久人人超碰| 日韩精品每日更新| 色呦呦国产精品| 最新不卡av在线| 成人看片黄a免费看在线| 久久久精品日韩欧美| 国产寡妇亲子伦一区二区| 欧美一区二区三区播放老司机| 亚洲精品免费在线| 色哟哟欧美精品| 亚洲欧美另类综合偷拍| 99视频精品免费视频| 中文字幕av一区二区三区免费看| 激情五月婷婷综合网| 精品久久久三级丝袜| 精品亚洲成a人| 精品国产91洋老外米糕| 激情综合一区二区三区| 久久综合久久综合久久综合| 国产一区欧美一区| 国产日韩欧美激情| 国产盗摄女厕一区二区三区| 久久久久99精品国产片| 成人丝袜18视频在线观看| 国产精品区一区二区三区| 不卡av在线网| 亚洲激情图片qvod| 欧美日韩美女一区二区| 日韩av电影一区| 日韩欧美123| 国产精品性做久久久久久| 欧美激情综合在线| 色综合色狠狠综合色| 亚洲国产精品一区二区www在线| 69堂成人精品免费视频| 极品销魂美女一区二区三区| 国产蜜臀av在线一区二区三区| 床上的激情91.| 国产精品69毛片高清亚洲| 国产午夜精品福利| 99久久99久久精品免费看蜜桃| 亚洲欧美色图小说| 欧美日韩欧美一区二区| 日本不卡高清视频| 国产欧美精品一区二区色综合朱莉 | 日韩一区欧美二区| 26uuu国产在线精品一区二区| 国产精品一二三在| 亚洲精品国产精华液| 3d动漫精品啪啪一区二区竹菊| 韩国精品主播一区二区在线观看| 久久伊99综合婷婷久久伊| 91丨porny丨国产入口| 亚洲成在人线在线播放| 精品国产麻豆免费人成网站| caoporn国产精品| 亚洲国产精品久久久久秋霞影院| 欧美大片日本大片免费观看| 9久草视频在线视频精品| 爽好久久久欧美精品| 久久精品在线观看| 欧美中文字幕一区二区三区亚洲 | 99精品久久久久久| 日本欧美一区二区三区| 中文字幕免费一区| 欧美日韩高清一区二区| 国产成人在线免费| 丝袜诱惑亚洲看片| 国产精品三级av在线播放| 欧美日韩一本到| 床上的激情91.| 日本不卡免费在线视频| 椎名由奈av一区二区三区| 亚洲综合在线五月| 久久综合久久鬼色| 91福利在线观看| 国产精品一品二品| 偷拍亚洲欧洲综合| 最新成人av在线| 久久麻豆一区二区| 欧美一区二区在线免费播放| 99久久综合精品| 国产在线精品一区二区夜色 | 久久爱www久久做| 一区二区三区四区视频精品免费| 久久综合色之久久综合| 欧美精品久久天天躁| 91亚洲精品久久久蜜桃网站| 国产综合色在线视频区| 婷婷中文字幕一区三区| 亚洲少妇30p| 国产欧美日韩亚州综合| 91精品国产色综合久久ai换脸| 91社区在线播放| 盗摄精品av一区二区三区| 麻豆91免费看| 午夜影视日本亚洲欧洲精品| 亚洲免费在线观看| 国产精品国产馆在线真实露脸| 精品国产精品网麻豆系列| 欧美精品在线一区二区三区| 欧洲人成人精品| 91美女视频网站| 波多野结衣亚洲一区| 国产iv一区二区三区| 精品一区二区三区免费播放| 日韩成人午夜电影| 爽爽淫人综合网网站| 午夜电影久久久| 亚洲不卡av一区二区三区| 亚洲最新视频在线观看| 亚洲精品少妇30p| 国产精品国产自产拍在线| 欧美韩国一区二区| 国产欧美一区二区精品秋霞影院| 欧美成人三级在线| 日韩三级精品电影久久久| 欧美一区二区三区视频| 欧美精三区欧美精三区|