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

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

?? instancelist.java

?? 本程序是用java語言編寫的數據挖掘分類算法中的決策樹分類方法c4.5程序代碼
?? JAVA
?? 第 1 頁 / 共 5 頁
字號:
        fileSchema = new FileSchema(trainList.get_original_schema());
        weighted = false;
        bagCounters = null;
        init_max_vals();
        read_data(testName, true);
    }
    
    
    
    /** Checks if this InstanceList has a set of bagcounters yet.
     * @return False if BagCounters is set to null, True otherwise.
     */
    public boolean has_counters() {
        return bagCounters != null;
    }
    
    /** Creates and fills bagCounters.
     * @return The BagCounters object created.
     */
    public BagCounters counters() {
        ensure_counters();
        return bagCounters;
    }
    
    /** Fills bagCounters by adding all instances into it.
     */
    public void ensure_counters() {
        if(bagCounters == null) {
            //Construct counters by adding each instance in turn
            bagCounters = new BagCounters(get_schema());
            if(!no_instances()) {
                //	    ListIterator pix = instances.listIterator();
                Instance inst = null;
                //	    for(;pix.hasNext();inst = (Instance)pix.next())
                for(ListIterator pix = instances.listIterator();
                pix.hasNext();){
                    inst =(Instance)pix.next();
                    bagCounters.add_instance(inst);
                }
            }
        }
    }
    
    /** Reads the data from the supplied file. InstanceList.read_data() takes
     * time proportional to the number of instances * the complexity of
     * read_data_line() + complexity of free_instances().
     * @param file		The name of the file containing the data set.
     * @param isTest	Indicator of whether this is a test data set. True
     * indicates this is a test data set, False otherwise.
     */
    public void read_data(String file, boolean isTest) {
        GetEnv getenv = new GetEnv();
        
        removeUnknownInstances = getenv.get_option_bool("REMOVE_UNKOWN_INST");
        corruptToUnknownRate = getenv.get_option_real_range("CORRUPT_UNKOWN_RATE");
        
        remove_all_instances();
        if(bagCounters!=null)
            bagCounters = null;
        try{
            BufferedReader dataFile = new BufferedReader(new FileReader(file));
            
            /*SECTION ADDED BY JL*/
            StreamTokenizer dataStream = new StreamTokenizer(dataFile);
            dataStream.eolIsSignificant(true);
            dataStream.commentChar((int)'|');
            dataStream.ordinaryChar((int)'?');
            dataStream.ordinaryChar((int)',');
            dataStream.ordinaryChar((int)'.');
            dataStream.wordChars((int)'_',(int)'_');
            dataStream.wordChars((int)' ',(int)' ');
            //	dataStream.parseNumbers();
            if(fileSchema.attrInfos[0] instanceof RealAttrInfo)
            {parseNumbers(dataStream,true);}
            else {parseNumbers(dataStream,false);}
            /*END OF SECTION ADDED BY JL*/
            
            InstanceList thisList = this;
            InstanceReader reader = new InstanceReader(thisList, maxAttrVals, isTest);
            
            fileSchema.skip_white_comments_same_line(dataFile);
            
            
            try{
                /*SECTION ADDED BY JL*/
                while(dataStream.nextToken() != StreamTokenizer.TT_EOF){
                    if(dataStream.ttype != StreamTokenizer.TT_EOL){
                        read_data_line(dataStream, isTest, reader);
                        if(num_instances() % 100 == 0)
                            ; //GLOBLOG(1,'.',flush);
                    }
                }
                /*END OF SECTION ADDED BY JL*/
                
/*REPLACES THIS SECTION
         while(dataFile.ready()){
            read_data_line(dataFile, isTest, reader);
            if(num_instances() % 100 == 0)
              ; //GLOBLOG(1,'.',flush);
         }
/*END OF SECTION REPLACED*/
                //done reading; release the list
                reader.release_list();
                
                if(!removeUnknownInstances)
                    ;//GLOBLOG(1," done.");
                else{
                    int num = num_instances();
                    //GLOBLOG(1,' '); //show we finished reading
                    remove_inst_with_unknown_attr();
                    int newNum = num_instances();
                    if(newNum < num)
                        ;//GLOBLOG(1,"Removed " + num-newNum +" instances.");
                    else
                        ;//GLOBLOG(1,"done.");
                }
                
                if(no_instances())
                    System.out.println("InstanceList.read_data WARNING: no"
                    + " instances in file");
                
                unknownSeed = -1;
                mrandomForUnknowns = null;
                if(corruptToUnknownRate > 0){
                    if(unknownSeed == -1) { //get seed first time
                        unknownSeed = getenv.get_option_int("UNKOWN_RATE_SEED");
                        mrandomForUnknowns = new Random(unknownSeed);
                    }
                    corrupt_values_to_unknown(corruptToUnknownRate, mrandomForUnknowns);
                }
                
                //remove any nominals which have no values other than unknowns here
                try{
                    remove_unknown_attributes();  //causes problems!
                }catch(CloneNotSupportedException e){
                    Error.err("Clone not supported exception caught");}
                
                
                //apply the loss matrix (from the FileSchema) now
                fileSchema.apply_loss_spec(schema);
                
                //some comments about next two lines
                Schema newSchema = schema;             //SchemaRC -> Schema
                try{
                    set_schema(newSchema);
                }catch(CloneNotSupportedException e){
                    Error.err("Clone not supported exception caught");}
            }catch(IOException e){Error.err("InstanceList.read_data"
            +" ERROR");}
        }catch(FileNotFoundException e){Error.err("-"
        +" Data file NOT found");}
    }
    
    /** Removes all instances that have unknown attributes from the data set.
     */
    
    //change for C45
    //   private void remove_inst_with_unknown_attr()
    public void remove_inst_with_unknown_attr() {
        ListIterator pix = instances.listIterator(0);
        while(pix.hasNext()) {
            boolean hasUnknownAttr = false;
            Instance instance = (Instance)pix.next();
            for(int attrNum=0;attrNum<num_attr() && !hasUnknownAttr;attrNum++) {
                AttrInfo attrInfo = attr_info(attrNum);
                AttrValue attrValue = instance.get_value(attrNum);
                if(attrInfo.is_unknown(attrValue))
                    hasUnknownAttr = true;
            }
            if(hasUnknownAttr)
                remove_instance(pix,instance);  //removes from list last element seen by next()
        }
    }
    
    /** Removes the specified Instance from the ListIterator of Instances
     * supplied.
     * @param pix		The ListIterator containing the Instance.
     * @param instance 	The Instance to be removed.
     */
    public void remove_instance(ListIterator pix,Instance instance) {
        if(instance==null)
            Error.err("InstanceList.remove_instance: tried "
            +"to dereference a null instance -->fatal_error");
        pix.remove();//instance_list().del(instance);
        //Remove from counters if we have them
        if(bagCounters!=null)
            bagCounters.del_instance(instance);
        
        //Update totalWeight cache
        totalWeight = instance.get_weight() -1 ;
        
    }
    
    /** Removes all Instance objects stored in this InstanceList object.
     */    
    public void remove_all_instances() {
        //drop_counters();
        MLJ.ASSERT(instances != null,"InstanceList.remove_all_instances: instance is null");
        while(!no_instances())
            instances.removeFirst();
        totalWeight = 0;
    }
    
    /** Returns the number of instances in the InstanceList.
     * InstanceList.num_instances() takes time proportional to the number of
     * instances in the List.
     * @return An integer value of the number of Instances contained in this list.
     */
    public int num_instances() {
        return instances.size();
    }
    
    /** Returns the number of categories that the instances in the List can have.
     * Only works if the Label is of a nominal attribute.
     * @return An integer value of the number of categories.
     */
    public int num_categories() {
        return nominal_label_info().num_values();
    }
    
    /** Returns the nominal label information contained in this InstanceList's
     * schema.
     * @return The information on the nominal labels contained in the schema.
     */
    public NominalAttrInfo nominal_label_info() {
        return label_info().cast_to_nominal();
    }
    
    /** Returns the label information contained in this InstanceList's
     * schema.
     * @return The information on the labels contained in the schema.
     */
    public AttrInfo label_info() {
        return get_schema().label_info();
    }
    
    /** Checks if this InstanceList contains Instances.
     * @return Returns True if there are no Instances in this InstanceList, False
     * otherwise.
     */
    public boolean no_instances() {
        return instances.size() == 0;
    }
    
    /** This function projects out any attributes which have only unknown values.
     *
     * @throws CloneNotSupportedException If InstanceList.project_in_place encounters an exception during cloning of the
     * Schema.
     */    
    private void remove_unknown_attributes() throws CloneNotSupportedException {
        boolean[] attrMask = new boolean[num_attr()];
        for(int i=0;i<attrMask.length;i++)attrMask[i] = true;
        for(int i=0;i<num_attr();i++)
            if(schema.attr_info(i).can_cast_to_nominal() &&
            schema.nominal_attr_info(i).num_values() == 0)
                attrMask[i] = false;
        project_in_place(attrMask);
    }
    
    /** Returns the list of Instances stored in this InstanceList.
     * @return A LinkedList containing the Instances sotred in this InstanceList.
     */
    public LinkedList instance_list() {
        return instances;
    }
    
    /** This function is very similar to project(), except that the list is
     * projected "in place"--attributes are removed directly from the list
     * and the schema is updated.
     * @param projMask An array of boolean values representing which attributes shall be use in this
     * InstanceList object. Values of projMask are related by order to the atributes.
     * Values of TRUE indicate that attribute will be used, FALSE indicates the
     * attribute will not be used.
     * @throws CloneNotSupportedException if the cloning process in Schema encounters an exception.
     */
    public void project_in_place(boolean[] projMask) throws CloneNotSupportedException {
        MLJ.ASSERT(schema != null,"InstanceList.project_in_place: schema is null");
        Schema newSchema = new Schema(schema.project(projMask));
        
        //Project all instances in the list "in place" --we cheat a bit
        // here because we have instances in the list with different
        // schemas.  However, we clean everything up at the end and check
        // the schemas carefully.
        
        int numInstBefore = num_instances();
        //ListIterator temp = instances.listIterator(0);
        int index = 0;
        for(int i=0;i<numInstBefore;i++) {
            //Work ona  temporary pix; otherwise we'll remove an instance
            //  before advancing the pix which is bad.
            

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美久久久久久蜜桃| 亚洲国产一区二区三区| 亚洲男人天堂av网| 狠狠色综合播放一区二区| 色美美综合视频| 久久久久久99精品| 午夜av一区二区三区| k8久久久一区二区三区| 2021国产精品久久精品| 天天操天天色综合| 日本精品一区二区三区高清| 久久精品一区二区三区不卡| 欧美a级理论片| 欧美午夜精品久久久久久超碰 | 17c精品麻豆一区二区免费| 裸体在线国模精品偷拍| 56国语精品自产拍在线观看| 一区二区三区小说| 色综合久久久久综合99| 亚洲欧洲精品一区二区三区不卡 | 91在线免费视频观看| 中文字幕免费不卡| 风流少妇一区二区| 久久男人中文字幕资源站| 裸体一区二区三区| 日韩三级av在线播放| 视频一区二区三区中文字幕| 在线成人午夜影院| 婷婷综合五月天| 91麻豆精品国产91久久久久久久久 | 激情综合色播激情啊| 91麻豆精品国产91久久久资源速度| 国产成人自拍网| 日韩精品一区二区三区老鸭窝| 免费视频最近日韩| 精品欧美一区二区久久| 久久电影网站中文字幕 | 在线日韩一区二区| 亚洲国产精品久久久男人的天堂| 欧美私模裸体表演在线观看| 日欧美一区二区| 日韩视频一区二区三区在线播放| 极品美女销魂一区二区三区免费| 久久综合色之久久综合| 成人免费视频一区| 尤物av一区二区| 欧美日韩日日骚| 看国产成人h片视频| 欧美激情一区在线观看| 91免费看视频| 青椒成人免费视频| 国产精品私房写真福利视频| 91成人在线观看喷潮| 日本不卡在线视频| 久久精品一区二区| 在线影视一区二区三区| 视频一区视频二区在线观看| 337p日本欧洲亚洲大胆精品 | 久久精品噜噜噜成人av农村| 国产欧美日韩亚州综合| 在线观看日韩电影| 极品美女销魂一区二区三区| 免费在线成人网| 国产日韩一级二级三级| 欧洲亚洲国产日韩| 寂寞少妇一区二区三区| 亚洲视频一二三区| 欧美一区二区久久| 色综合天天综合给合国产| 免费av网站大全久久| 中文字幕一区二| 欧美一级xxx| 色www精品视频在线观看| 秋霞电影网一区二区| 亚洲视频狠狠干| 欧美变态口味重另类| 欧美性大战久久久久久久蜜臀| 国产麻豆日韩欧美久久| 丝袜美腿亚洲一区| 国产精品卡一卡二| 精品国产91洋老外米糕| 欧美另类久久久品| av电影天堂一区二区在线| 狠狠v欧美v日韩v亚洲ⅴ| 亚洲永久精品国产| 中文字幕一区三区| 国产亚洲va综合人人澡精品| 欧美精品电影在线播放| av一区二区三区| 欧美色图一区二区三区| av在线一区二区三区| 国产美女视频91| 蜜臀av性久久久久蜜臀aⅴ四虎 | 日本视频中文字幕一区二区三区| 日韩一区欧美小说| 久久五月婷婷丁香社区| 日韩情涩欧美日韩视频| 欧美男同性恋视频网站| 日本精品免费观看高清观看| 高清久久久久久| 国产精品一区二区你懂的| 国产揄拍国内精品对白| 另类人妖一区二区av| 午夜不卡在线视频| 五月综合激情婷婷六月色窝| 亚洲一区在线播放| 亚洲风情在线资源站| 亚洲午夜一区二区| 亚洲第一福利一区| 日韩在线卡一卡二| 日韩经典一区二区| 日精品一区二区三区| 日日夜夜精品免费视频| 午夜电影久久久| 秋霞国产午夜精品免费视频| 麻豆久久久久久| 激情综合网最新| 国产一区二区毛片| 风间由美性色一区二区三区| 成人国产在线观看| 99精品视频一区二区三区| 色综合一区二区| 欧美视频一区二区三区| 欧美一区二区视频免费观看| 欧美sm极限捆绑bd| 欧美国产精品一区二区三区| 亚洲欧美一区二区三区孕妇| 亚洲人成精品久久久久久| 国产成人免费9x9x人网站视频| 国产91对白在线观看九色| av一区二区三区在线| 欧美三区在线视频| 精品欧美一区二区在线观看| 中文在线资源观看网站视频免费不卡| 国产精品第一页第二页第三页| 亚洲免费av高清| 日韩国产成人精品| 国产成人免费在线视频| 色先锋久久av资源部| 欧美一区二区三区影视| 久久精品人人做人人爽人人| 日韩理论片一区二区| 日韩精品乱码av一区二区| 国产jizzjizz一区二区| 91久久奴性调教| 欧美一级xxx| 亚洲欧洲韩国日本视频| 日韩在线播放一区二区| 成人久久视频在线观看| 欧美三级日韩三级国产三级| 亚洲精品在线观看网站| 一区二区三区中文字幕| 麻豆成人av在线| 91视频在线观看免费| 精品国产一区二区三区忘忧草| 久久精品欧美一区二区三区不卡| 亚洲日本免费电影| 久久精品国产色蜜蜜麻豆| 色综合久久久久综合体| 26uuu国产在线精品一区二区| 亚洲欧洲成人精品av97| 精品一区二区日韩| 欧美三级视频在线播放| 国产精品久久久久aaaa樱花| 另类的小说在线视频另类成人小视频在线 | 精品国产三级a在线观看| 一区二区三区免费观看| 国产一区二区三区在线观看免费视频 | 日韩午夜在线影院| 亚洲精品国产品国语在线app| 国产一区二区三区蝌蚪| 91精品国产一区二区三区香蕉| 亚洲免费观看高清完整| 国产a区久久久| wwwwww.欧美系列| 日日欢夜夜爽一区| 欧美亚男人的天堂| 亚洲视频一区二区免费在线观看| 极品销魂美女一区二区三区| 欧美丰满嫩嫩电影| 亚洲美女免费视频| av在线不卡网| 中文字幕欧美日本乱码一线二线| 美女精品一区二区| 欧美顶级少妇做爰| 亚洲精品免费视频| 91老师片黄在线观看| 亚洲日本在线天堂| www.亚洲国产| 中文字幕一区二区三区色视频 | 蜜桃免费网站一区二区三区| 欧美日韩午夜精品| 亚洲国产精品久久久久秋霞影院| av亚洲精华国产精华| 国产精品久久二区二区| 国产成a人无v码亚洲福利| 精品国产凹凸成av人网站| 久久精品久久综合| 久久久久99精品国产片| 国产一区二区按摩在线观看|