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

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

?? id3inducer.java

?? 此編碼是一個數據挖掘的決策樹各種算法。以作為入門提示
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
package id3;
import java.lang.*;
import java.util.*;
import shared.*;
import shared.Error;

/** The ID3Class is the Java implementation of the ID3 algorithm. The
 * ID3 algorithm is a top-down decision-tree induction algorithm. This
 * algorithm uses the mutual information (original gain criteria),and
 * not the more recent information gain ratio.<P>
 * Complexity:<P>
 * Our split() method uses entropy and takes time O(vy) where v is
 * the total number of attribute values (over all attributes) and y
 * is the number of label values. This can be derived by noting that
 * mutual_info is computed for each attribute.<P>
 * Node categorizers (for predict) are AttrCategorizer and take
 * constant time, thus the overall prediction time is O(path-length).<P>
 * See TDDTInducer for more complexity information.<P>
 * Enhancements:<P>
 * The ID3Compute entropy once for the node, and pass it along to
 * avoid multiple computations like we do now.<P>
 *
 * @author James Louis 12/7/2000 Ported to Java
 * @author Clay Kunz 10/22/96 Changed bestSi to a pointer everywhere so
 * that we don't copy lots of split objects
 * around.
 * @author Yeogirl Yun 7/4/95 Added copy constructor.
 * @author Ronny Kohavi 9/08/93 Initial revision (.h,.c)
 */
public class ID3Inducer extends TDDTInducer
{
    /** Constructor.
     * @param dscr    The description of this inducer.
     * @param aCgraph A previously developed Cgraph.
     */
   public ID3Inducer(String dscr, CGraph aCgraph)
   {
      super(dscr, aCgraph);
   }

   /** Constructor.
    * @param dscr The description of this inducer.
    */
   public ID3Inducer(String dscr)
   {
      super(dscr); 
   }

   /** Copy Constructor.
    * @param source The original ID3Inducer that is being copied.
    */
   public ID3Inducer(ID3Inducer source)
   {
      super(source);
   }

   /** Returns the AttrCategorizer that splits on the best attribute found using
    * mutual information(information gain). Returns null if there is nothing
    * good to split on. Ties between this attribute and earlier attributes are
    * broken.
    * @param catNames The names of the categories that each instance may be
    * catagorized under.
    * @return The NodeCategorizer that splits on the best attribute found. May be
    * null if no good attribute split is found.
    */
   public  NodeCategorizer best_split(LinkedList catNames) 
   {
      Schema schema = TS.get_schema();
//schema used to be SchemaRC :JL
// @@ change these to return an index instead of bestSplit.
//   SplitAttr noSplit;
//bestSplit used to be set equal to noSplit : JL
      SplitAttr[] bestSplit = new SplitAttr[1]; 
	bestSplit[0] = new SplitAttr();
      SplitAttr[] splits = new SplitAttr[schema.num_attr()];
	for(int z = 0; z < splits.length;z++) splits[z] = new SplitAttr();
// @@ Call routine to initialize splits - sets penalty, minSplit
      if (!find_splits(bestSplit, splits)) return null;
      MLJ.ASSERT((bestSplit[0] != null) &&  (bestSplit[0].split_type() != SplitAttr.noReasonableSplit),
		"ID3Inducer:best_split--(bestSplit == null)"+
		"or(bestSplit.split_type() == noReasonableSplit)");
      NodeCategorizer bestCat = null;
      bestCat = split_to_cat(bestSplit[0], catNames);
      MLJ.ASSERT(bestCat != null,"ID3Inducer:best_split--bestCat == null");
//   DBG(bestCat->OK());
      logOptions.LOG(2, "Created split on attribute "+bestSplit[0].get_attr_num()+" ("+
          schema.attr_name(bestSplit[0].get_attr_num())+") at level "+
          get_level()+'\n');
      bestCat.build_distr(instance_list());
      return bestCat;
   }

   /** Fills in the array of splits for current subtree. It does very
    * little, but rarely overriden whereas best_split_info is overridden
    * by subclasses.
    * @return False if there is only one label value, the maximum number
    * of splits is reached, or if there is no reasonable split
    * available.
    * @param bestSplit This is an array of the best splits found during the
    * splitting process.
    * @param splits This is an array of all splits found during the
    * splitting process.
    */
   public boolean find_splits(SplitAttr[] bestSplit,
			    SplitAttr[] splits) 
   {
      if (TS.counters().label_num_vals() == 1)
         return false; // if we have one label value, we're done.
      if ((get_max_level() > 0)&&(get_level() >= get_max_level())) {
         logOptions.LOG(2, "Maximum level "+get_max_level()+" reached "+'\n');
         return false;
      }
      logOptions.LOG(3, TS.counters().toString());
      best_split_info(bestSplit, splits);
      return (bestSplit[0].split_type() != SplitAttr.noReasonableSplit);
   }

   /** Fills in the array of SplitAttr for current subtree. This function
    * is a good candidate to override in subclasses.
    * @param bestSplit	This is an array of the best splits found during the
    * splitting process.
    * @param splits	This is an array of all splits found during the
    * splitting process.
    */
   public  void best_split_info(SplitAttr[] bestSplit, SplitAttr[] splits) 
   {
      Schema schema = TS.get_schema();
   		//schema used to be SchemaRC : JL
      int numAttributes = schema.num_attr();
   
      StatData allMutualInfo = new StatData();
      StatData allNonMultiValMutualInfo = new StatData();
   
      RealAndLabelColumn[] realColumns = null;
      if (get_have_continuous_attributes()) {
         boolean[] mask = new boolean[numAttributes];
         for(int z = 0; z < numAttributes; z++) mask[z] = true;
         realColumns = TS.transpose(mask);
      }

      for (int attrNum = 0; attrNum < numAttributes; attrNum++) {
         split_info(attrNum, splits[attrNum], realColumns);
         // Find the mean of the mutual information over all attributes
         //   with reasonable splits.  From c4.5, we accumulate separately
         //   the mutual information that originates from attributes that
         //   do not have "too many" values.  Unless ALL attributes fail
         //   this criterion we use only those from the "smaller" attributes.
         // @@ We may want to compute the mean only when it's needed, i.e.,
         // @@ for gain-ratio emulation
         if (splits[attrNum].split_type() != SplitAttr.noReasonableSplit) {
            double mi = splits[attrNum].get_mutual_info(false, true);
            MLJ.ASSERT(mi >= 0,"ID3Inducer.best_split_info(SplitAttr,SplitAttr[])--"+
   			" mi < 0");
            logOptions.LOG(3, "Adding mutualInfo "+mi+" to mean.");
            allMutualInfo.insert(mi);
            if (!multi_val_attribute(attrNum)) {
               allNonMultiValMutualInfo.insert(mi);
               logOptions.LOG(3, "  It's not multi-val.");
            }
   	   logOptions.LOG(3,'\n');
         }
      }
      realColumns = null;
      pick_best_split(bestSplit, splits, allMutualInfo,allNonMultiValMutualInfo);
   }

   /** Return true if the attribute has many values according to
    * the C4.5 definition.
    * @return True if this attribute has many values, False otherwise.
    * @param attrNum	The number of the attribute being checked.
    */
   public boolean multi_val_attribute(int attrNum) 
   {
      double totalWeight = get_total_inst_weight();
      MLJ.ASSERT(totalWeight >= 0,"ID3Inducer.multi_val_attribute(int)--"+
   		 " totalWeight < 0");
      Schema schema = TS.get_schema();
//schema used to be SchemaRC : JL
      return ((schema.attr_info(attrNum).can_cast_to_nominal())&&(schema.num_attr_values(attrNum) >= (0.3 * totalWeight)));
   }

   /** Choose the best attribute to split the on from all possible splits.
    * @param bestSplit	The array of the best splits found during splitting
    * process.
    * @param splits	The array of all splits found during the splitting
    * process.
    * @param allMutualInfo	Statistical information about all instances.
    * @param allNonMultiValMutualInfo	Statistical information about instances
    * where an attribute can only have one
    * value at a time.
    */
   public void pick_best_split(SplitAttr[] bestSplit,
					SplitAttr[] splits,
					StatData allMutualInfo,
					StatData allNonMultiValMutualInfo) 
   {
      Schema schema = TS.get_schema();
      int numAttributes = schema.num_attr();

      if (get_split_score_criterion() != SplitScore.gainRatio) {
         for (int attrNum = 0; attrNum < numAttributes; attrNum++) {
            SplitAttr split = splits[attrNum];
            if (split.split_type() != SplitAttr.noReasonableSplit) {
      	    // Remember the best.  MLJ.realEpsilon is added because on
      	    //   monk1, the difference is 1e-16, and we want to tie break
      	    //   exactly as C4.5 does.
      	    // First half of test is because bestSplit might be unset, in
      	    //   which case we can't get its criterion score.
               if (bestSplit[0].split_type() == SplitAttr.noReasonableSplit
                  || split.score() > (bestSplit[0].score() + MLJ.realEpsilon))
                  bestSplit[0] = split;
            }
         }
      } else { // gain ratio
         double meanMutualInfo = Globals.UNDEFINED_REAL;
         if (allMutualInfo.size() > 0) 
         if (all_attributes_multi_val() || allNonMultiValMutualInfo.size() == 0) {
            meanMutualInfo = allMutualInfo.mean();
            if (all_attributes_multi_val()) logOptions.LOG(3, "All attributes are multi-val."+'\n');
         }
         else
            meanMutualInfo = allNonMultiValMutualInfo.mean();      
         logOptions.LOG(3,"Mean mutual info is "+meanMutualInfo+'\n');
   
         // Look at the criterion score for each attribute.  Any time an
         //   attribute has a mutual info greater than the mean mutual info
         //   it's a candidate for chosing as best.  If its score is
         //   greater than the max so far, pick it.
         double maxScore = Globals.UNDEFINED_REAL;
         boolean foundScoreAboveMean = false;
         for (int attrNum = 0; attrNum < numAttributes; attrNum++) {
            SplitAttr split = splits[attrNum];
            logOptions.LOG(3,"For attribute "+attrNum+", checking for reasonable split");
            if (split.split_type() == SplitAttr.noReasonableSplit){
               logOptions.LOG(3,"...Sorry, no reasonable split"+'\n');
            }
            else {
               boolean mutualInfoAboveMean = split.get_mutual_info(false,true) >
               meanMutualInfo + MLJ.realEpsilon;
   	    // was || maxScore == Globals.UNDEFINED_REAL)
//               if (maxScore == Globals.UNDEFINED_REAL) MLJ.ASSERT(!foundScoreAboveMean);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲欧美偷拍卡通变态| 97久久精品人人做人人爽50路| 亚洲国产精品久久人人爱| 国产精品视频你懂的| 国产午夜久久久久| 国产日韩欧美在线一区| 久久这里只有精品视频网| 欧美电影免费观看高清完整版| 欧美一区二区三区电影| 日韩欧美成人激情| 亚洲精品在线观看视频| 2023国产精华国产精品| 精品久久久久久综合日本欧美| 日韩欧美国产综合| 久久视频一区二区| 国产日韩欧美精品一区| 亚洲欧美在线高清| 亚洲激情男女视频| 亚洲123区在线观看| 天堂av在线一区| 七七婷婷婷婷精品国产| 韩国av一区二区三区在线观看| 狠狠色丁香婷婷综合久久片| 国产精品456| 99久久精品情趣| 91久久久免费一区二区| 欧美久久久久久蜜桃| 日韩免费在线观看| 亚洲国产精华液网站w | 亚洲精品菠萝久久久久久久| 亚洲国产欧美一区二区三区丁香婷| 亚洲va欧美va人人爽| 韩国v欧美v日本v亚洲v| 99精品一区二区三区| 欧美日韩国产一级二级| xnxx国产精品| 国产精品网站一区| 亚洲成av人片在线观看无码| 狠狠色综合播放一区二区| 99久久国产免费看| 日韩一区二区三区av| 国产精品亲子伦对白| 亚洲高清视频中文字幕| 国产永久精品大片wwwapp| 99久久精品国产麻豆演员表| 91麻豆精品国产91久久久久| 日本一区二区免费在线观看视频| 一区二区国产盗摄色噜噜| 欧美aa在线视频| 99精品黄色片免费大全| 日韩一级二级三级精品视频| 欧美国产欧美亚州国产日韩mv天天看完整 | 久久无码av三级| 亚洲免费视频中文字幕| 麻豆久久久久久| 一本大道久久a久久综合婷婷| 日韩视频国产视频| 亚洲欧美另类图片小说| 激情图片小说一区| 欧美日韩久久久| 中文字幕精品一区二区精品绿巨人| 婷婷久久综合九色综合绿巨人 | 在线影院国内精品| 久久综合一区二区| 午夜精品福利在线| 波多野结衣视频一区| 精品黑人一区二区三区久久| 亚洲精品午夜久久久| 国产福利91精品| 日韩欧美精品三级| 五月开心婷婷久久| 91蝌蚪porny| 欧美激情一区二区| 麻豆精品一二三| 欧美日韩国产首页| 亚洲激情在线播放| av动漫一区二区| 国产欧美视频一区二区三区| 另类综合日韩欧美亚洲| 欧美性猛交xxxxxxxx| 亚洲天堂福利av| 国产jizzjizz一区二区| 日韩欧美一区二区不卡| 亚洲福利视频一区| 91国产免费看| 综合激情成人伊人| 成人av免费在线观看| 久久九九久久九九| 激情文学综合丁香| 精品99999| 九九九精品视频| 日韩视频中午一区| 日本 国产 欧美色综合| 欧美精品v日韩精品v韩国精品v| 亚洲激情图片一区| 在线视频观看一区| 一区二区三区四区不卡在线| 91老师片黄在线观看| 亚洲另类在线制服丝袜| 99久久99久久精品免费看蜜桃| 国产精品亲子伦对白| av高清不卡在线| 亚洲图片另类小说| 色婷婷av久久久久久久| 一区二区三区国产精华| 色狠狠综合天天综合综合| 亚洲欧美欧美一区二区三区| 色欧美88888久久久久久影院| 亚洲免费观看视频| 色婷婷精品久久二区二区蜜臀av| 亚洲综合免费观看高清完整版在线| 在线观看av不卡| 天天综合网 天天综合色| 制服丝袜一区二区三区| 美美哒免费高清在线观看视频一区二区| 91精品国产91久久久久久一区二区| 午夜精品久久久久久久久久久 | 日韩精品电影一区亚洲| 欧美一区日本一区韩国一区| 麻豆成人免费电影| 久久久不卡网国产精品一区| 成人网在线免费视频| 亚洲人成亚洲人成在线观看图片| 91蝌蚪国产九色| 午夜精品久久久久久久99樱桃| 日韩三级中文字幕| 国产剧情一区二区三区| 国产精品国产三级国产专播品爱网| av中文字幕在线不卡| 亚洲午夜一区二区三区| 91精品国产综合久久精品性色 | 欧美三级视频在线播放| 日韩精品三区四区| 国产亚洲欧美激情| 色综合久久久久综合体桃花网| 亚洲va韩国va欧美va精品| 精品欧美乱码久久久久久1区2区| 国产精品12区| 一区二区免费在线播放| 日韩欧美资源站| jlzzjlzz国产精品久久| 天堂成人免费av电影一区| 久久久久久久久97黄色工厂| 91色在线porny| 日本午夜一区二区| 亚洲国产精华液网站w| 欧美人与性动xxxx| 国产成人综合精品三级| 亚洲自拍偷拍综合| 2024国产精品| 在线观看亚洲一区| 国产精品 日产精品 欧美精品| 亚洲国产日韩一级| 欧美激情在线观看视频免费| 欧美人xxxx| 99久久综合国产精品| 喷白浆一区二区| 亚洲精品水蜜桃| 久久色.com| 欧美日韩久久一区二区| 成人激情黄色小说| 首页国产丝袜综合| 亚洲欧洲成人av每日更新| 日韩午夜av一区| 欧美探花视频资源| 国产精品一二三四区| 天天操天天色综合| 综合自拍亚洲综合图不卡区| 26uuu国产电影一区二区| 欧美日韩国产免费| 成人精品视频网站| 久久99精品国产麻豆婷婷洗澡| 亚洲欧美经典视频| 国产目拍亚洲精品99久久精品| 制服丝袜亚洲精品中文字幕| 91啦中文在线观看| 国产成人精品亚洲777人妖| 免费av成人在线| 亚洲国产一区二区在线播放| 国产精品久久久久一区| 亚洲精品在线观看网站| 91精品在线免费| 欧美在线免费播放| 91香蕉视频在线| 国产成人av影院| 国模少妇一区二区三区| 日韩国产欧美在线播放| 亚洲综合视频网| 一区二区三区四区不卡在线 | 免费成人深夜小野草| 亚洲综合免费观看高清完整版在线| 中文字幕av资源一区| 国产亚洲成年网址在线观看| 日韩免费性生活视频播放| 91麻豆精品国产91久久久久久| 欧美人xxxx| 91精品国产高清一区二区三区蜜臀| 欧美日韩国产一级| 欧美人狂配大交3d怪物一区 | 亚洲精品五月天|