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

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

?? schema.java

?? 本程序是用java語言編寫的數據挖掘分類算法中的決策樹分類方法c4.5程序代碼
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
package shared;
import java.util.*;
import java.lang.*;
import java.io.*;

/** Schema defines the attribute information. Most effort was directed at labelled
 * instances for supervised learning, and on discrete attributes.
 * @author James Louis Java Implementation.
 * @author Dan Sommerfield 2/21/97 Added loss functions.
 * @author Robert Allen Added project(). 1/27/95
 * @author Chia-Hsin Li Added display_names(). 9/29/94
 * @author Yeogirl Yun Merged LabelledInstanceInfo and InstanceInfo into Schema
 * and made it reference-count class. 6/12/94
 * @author Richard Long 5/27/94 AttrInfo stored as Array instead of linked list.
 * @author Richard Long 1/21/94 Added weighted option.
 * @author Svetlozar Nestorov 1/8/94 Added copy constructors.
 * @author Ronny Kohavi 8/18/93 Change equal to non-virtual, eliminated
 * combinations of LabelledInstanceInfo and InstanceInfo for equal and operator=.
 * See coding standards for explanations.
 * @author Richard Long 7/14/93 Initial revision (.c)
 * @author Ronny Kohavi 7/13/93 Initial revision (.h)
 *
 */
public class Schema
{
    /** Array of information on attributes.
     */    
   AttrInfo[] attr;
   /** Information on labels.
    */   
   AttrInfo labelInfo;
   /** The number of references to this Schema.
    */   
   int refCount;
   /** Loss matrix for this schema.
    */   
   double[][] lossMatrix;
   /** TRUE if the Lossmatrix should be transposed with the attribute information.
    */   
   boolean transposeLossMatrix = false;
   /** Constructor.
    * @param attrInfos	The information about each attribute to be
    * stored in this Schema.
    */
   public Schema(LinkedList attrInfos)
   {
      attr = new AttrInfo[attrInfos.size()];
      lossMatrix = null;
      refCount = 1;
  
       
      labelInfo = null;
      ListIterator pix = attrInfos.listIterator(0);
      for (int i=0; i < attrInfos.size(); i++){
         if(pix.hasNext())attr[i] = (AttrInfo)pix.next();  
         if(attr[i] == null)
            Error.err("Schema::Schema:attribute info "
               + i + "is NULL --> fatal_error");
      }
      attrInfos = null;
      OK(); 
   }
 
   /** Constructor.
    * @param attrInfos	The information about the each attribute to be
    * stored in this Schema.
    * @param lInfo		The information about the labels for each
    * catagory.
    */
   public Schema(LinkedList attrInfos,AttrInfo lInfo)
   {  
      attr = new AttrInfo[attrInfos.size()];
      lossMatrix = null;
      refCount = 1;
   
      if(lInfo == null)
         Error.err("Error-->Schema::Schema: Null labelInfo not"
            +" not allowed.  Use the constructor which does not require"
            +" a labelInfo argument, fatal_error");

      labelInfo = lInfo;
      ListIterator pix = attrInfos.listIterator(0); //(1) CHANGE
      for(int i=0; i< attrInfos.size();i++) {
         attr[i] = (AttrInfo)pix.next();
         if(attr[i] == null)
            Error.err("Schema::Schema: attribute info "
               +i+"is Null, fatal_error");
      }

      attrInfos = null;
      lInfo = null;
      
      OK(); 
   }

   /** Copy Constructor.
    * @param source The Schema object to be copied.
    * @throws CloneNotSupportedException if the cloning process for the new Schema experiences an Exception.
    */
   public Schema(Schema source) throws CloneNotSupportedException 
   {
      attr = new AttrInfo[source.num_attr()];
      //instanceOp = null;
      lossMatrix = null;
      refCount = 1;

      for(int i=0;i < source.attr.length; i++) {
         AttrInfo nextAttr = (AttrInfo)source.attr_info(i).clone(); //clone();
	 attr[i] = nextAttr;
      }
      
      if(source.is_labelled())
         labelInfo = (AttrInfo)source.labelInfo.clone(); //clone();
      else
         labelInfo = null;
   
      if(source.lossMatrix != null)
         lossMatrix = source.lossMatrix;

      //copy instance operation, if there is one
      //if(source.instanceOp)
      //   instanceOp = source.instanceOp; //clone();
	 
      //DBG(OK());
   }

   /** Checks if this Schema object has a loss matrix.
    * @return TRUE if there is a loss matrix, FALSE otherwise.
    */
   public boolean has_loss_matrix(){return lossMatrix != null;}
   
   /** Returns the loss matrix for this Schema object.
    * @return The loss matrix.
    */
   public double[][] get_loss_matrix()
   {
      return lossMatrix;
   }
   
   /** Sets the loss matrix to the matrix specified.
    * @param aLossMatrix	The new matrix to be stored in this Schema
    * object.
    */
   public void set_loss_matrix(double[][] aLossMatrix)
   {
      establish_loss_matrix();
      lossMatrix = aLossMatrix;

      //some error checking here !
   }

   /** Allocates the loss matrix for this Schema object. The Schema must have
    * label information or an error message will be displayed.
    */
   public void establish_loss_matrix()
   {
      if(!is_labelled())
         Error.err("Schema::establish_loss_matrix: the"
	    +" data must be labelled -->fatal_error");

      //The dimensions of the lossmatrix in MLC++ are [-1..num_label_values]
      //[0..num_label_values + 1].  So we will make these [0..nlv][0..nlv+1]
      if(lossMatrix == null)
         lossMatrix = new double[num_label_values()][num_label_values()+1];
   
      //left out some stuff about dimensions of 2D array.  See Schema.c 
   }

   /** Creates a new Schema object which contains only the specified attributes.
    * @return The new Schema created.
    * @param attrMask A boolean array where each element represents an attribute
    * in the Schema. It should have have the same number of
    * elements as attributes. Elements set to true will result in
    * the corresponding attribute being included in the new
    * Schema.
    * @throws CloneNotSupportedException if the cloning process for the new Schema experiences an Exception.
    */
   public Schema project(boolean[] attrMask) throws CloneNotSupportedException
   {
      //DBG(OK());
      //ASSERT(attrMask.size() == num_attr());
      LinkedList attrInfos = new LinkedList();
      int newnum = 0;
      for(int i=0;i<num_attr();i++) {
         if(attrMask[i]) {
	    AttrInfo ai = (AttrInfo)attr_info(i).clone();  //clone()
	    newnum++;
	    attrInfos.add(ai);
	 }
      }

      if(is_labelled()) {
         AttrInfo labelInfo = label_info(); //clone()
	 Schema newSchema = new Schema(attrInfos, labelInfo);

	 //if the previous schema had a loss matrix, set it inside the new
	 //shema too
	 if(has_loss_matrix())
	    newSchema.set_loss_matrix(get_loss_matrix());

	 //newSchema gets ownership
	 //ASSERT(attrInfos == null); ASSERT(labelInfo == null);
	 return newSchema;
      }
      else{
         Schema newSchema = new Schema(attrInfos);
	 //ASSERT(attrInfos == null);
	 return newSchema;
      }
   }

   /** Casts the specified attribute to a nominal attribute.
    * @return The NominalAttrInfo object of the specified attribute.
    * @param attrNum	The index number of the specified attribute.
    */
   public NominalAttrInfo nominal_attr_info(int attrNum)
   {
      return attr_info(attrNum).cast_to_nominal();
   }

   /** Validate assertions.
    */
   private void OK()
   {
      int level = 0; 
      // ASSERT refCount >= 0
      check_duplicate_attrs();

      if (level <1) {
         for(int i=0; i< attr.length; i++)
            if (attr[i]==null)
               Error.err("Shema::OK: attribute info "
                  + i + "is NULL --> fatal_error");
      }

      if(lossMatrix != null){
         //ASSERT is_labelled() == true 
         int numLabelVals = num_label_values();
         //ASSERT(lossMatrix->start_row() == FIRST_CATEGORY_VAL);
         //ASSERT(lossMatrix->start_col() == UNKNOWN_CATEGORY_VAL);
         //ASSERT(lossMatrix->num_rows() == numLabelVals);
         //ASSERT(lossMatrix->num_cols() == numLabelVals + 1);
      } 
   }

   /** Returns the number of values possible for the specified attribute.
    * @return The number of values.
    * @param attrNum	The index number of the specified attribute.
    */
   public int num_attr_values(int attrNum)
   {
      return nominal_attr_info(attrNum).num_values();
   }


   /** Returns the number of classification labels possible for this Schema.
    * @return The number of labels.
    */
   public int num_label_values()
   {
      return nominal_label_info().num_values();
   }
   
   /** Casts the label information to a nominal attribute.
    * @return The NominalAttrInfo containing the label information.
    */
   public NominalAttrInfo nominal_label_info()
   {
      return label_info().cast_to_nominal();
   }

   /** Returns the label information.
    * @return The AttrInfo containing the label information.
    */
   public AttrInfo label_info()
   {
      if (!is_labelled())
         Error.err("Schema::label_info() : labelInfo is "
            + "NULL -->fatal_error");
      return labelInfo; 
   }
   
   /** Checks if this Schema has label information.
    * @return TRUE if label information is present, FALSE otherwise.
    */
   public boolean is_labelled()
   {
      return is_labelled(false);
   }

   /** Checks if this Schema has label information.
    * @return TRUE if label information is present, FALSE otherwise.
    * @param fatalOnFalse	If set to TRUE, an error message will be displayed if
    * there is no label information in this Schema.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文久久乱码一区二区| 国产成人免费网站| 丁香激情综合五月| 欧美日韩国产综合视频在线观看| 久久―日本道色综合久久| 亚洲曰韩产成在线| 成人丝袜高跟foot| 精品三级av在线| 亚洲国产美国国产综合一区二区| 国产成人三级在线观看| 日韩午夜电影在线观看| 亚洲另类在线制服丝袜| 国产成人一级电影| 精品剧情v国产在线观看在线| 一区二区三区免费看视频| 国产91在线|亚洲| 欧美不卡视频一区| 美女诱惑一区二区| 欧美久久一二区| 亚洲综合小说图片| 色婷婷久久久亚洲一区二区三区| 久久久精品国产99久久精品芒果 | 欧美专区日韩专区| 国产精品毛片久久久久久| 国产原创一区二区三区| 精品国产一区二区精华| 久久9热精品视频| 欧美成人精精品一区二区频| 亚洲成人动漫一区| 欧美人动与zoxxxx乱| 亚洲靠逼com| 欧美亚洲一区二区三区四区| 伊人开心综合网| 欧美中文字幕一区二区三区亚洲| 一区二区成人在线| 欧美乱妇20p| 日本vs亚洲vs韩国一区三区二区| 欧美久久久久免费| 热久久国产精品| 精品99久久久久久| 高潮精品一区videoshd| 中文字幕在线一区| 91精品办公室少妇高潮对白| 亚洲国产精品天堂| 91精品欧美久久久久久动漫| 麻豆精品一区二区三区| 久久蜜桃av一区精品变态类天堂| 国产成人免费视频精品含羞草妖精| 久久久久九九视频| 91亚洲永久精品| 亚洲国产精品一区二区www| 欧美一级日韩不卡播放免费| 国内精品自线一区二区三区视频| 久久伊人蜜桃av一区二区| 99久久久国产精品免费蜜臀| 亚洲一区在线观看视频| 日韩欧美国产高清| 成人午夜短视频| 午夜伊人狠狠久久| 精品国产91亚洲一区二区三区婷婷| 国产精品一区二区在线看| 最新国产精品久久精品| 欧美日韩在线三级| 国产麻豆午夜三级精品| 国产精品久久久久久一区二区三区| 色菇凉天天综合网| 国产真实乱对白精彩久久| ㊣最新国产の精品bt伙计久久| 欧美挠脚心视频网站| 成人性视频免费网站| 偷拍与自拍一区| 亚洲国产精品高清| 日韩一二在线观看| 日本韩国欧美国产| 国产不卡在线视频| 日韩电影一区二区三区| 综合激情成人伊人| 2024国产精品视频| 6080国产精品一区二区| 成人午夜电影久久影院| 日韩不卡一区二区| 亚洲一二三四区| 国产欧美日韩视频一区二区| 欧美日韩国产片| 99久久er热在这里只有精品15| 激情成人综合网| 丝袜亚洲另类丝袜在线| 国产精品久久影院| 26uuu精品一区二区三区四区在线 26uuu精品一区二区在线观看 | 成人av网站在线| 麻豆精品精品国产自在97香蕉| 亚洲少妇30p| 国产精品视频一区二区三区不卡| 欧美一区二区女人| 欧美视频一区二区在线观看| 成人黄色在线看| 国产成人在线免费观看| 精品夜夜嗨av一区二区三区| 亚洲成人黄色小说| 亚洲在线观看免费| 一区二区三区日韩精品视频| 亚洲私人影院在线观看| 国产精品成人网| 国产精品色噜噜| 国产日韩欧美精品一区| 久久综合久色欧美综合狠狠| 日韩一级大片在线观看| 日韩一级大片在线| 日韩欧美国产一区二区在线播放| 在线播放国产精品二区一二区四区| 一本大道久久a久久综合婷婷| 成人教育av在线| 粉嫩一区二区三区性色av| 国产精品自在在线| 国产一区91精品张津瑜| 精品一区二区在线视频| 久久成人久久爱| 国产原创一区二区三区| 国产很黄免费观看久久| 国产成人综合亚洲网站| 国产91在线|亚洲| 99久久婷婷国产精品综合| av网站一区二区三区| 91麻豆国产在线观看| 91福利视频网站| 欧美日本韩国一区二区三区视频 | 欧美少妇xxx| 欧美性videosxxxxx| 欧美高清一级片在线| 日韩欧美成人一区| 久久精品人人做人人综合| 国产精品天干天干在线综合| 亚洲视频免费观看| 午夜精品久久久久久久蜜桃app| 亚洲第一在线综合网站| 免费看精品久久片| 国产精品一二三| 色综合天天综合网天天狠天天| 色综合久久88色综合天天| 欧美日本韩国一区| 国产亚洲午夜高清国产拍精品 | 久久久久久久久一| 亚洲欧洲国产日韩| 天堂一区二区在线| 国产精品一线二线三线精华| 日本久久一区二区三区| 日韩欧美一级二级| 中文字幕日韩欧美一区二区三区| 亚洲国产色一区| 国产精一区二区三区| 欧美在线视频你懂得| 精品国产亚洲在线| 伊人色综合久久天天人手人婷| 青青国产91久久久久久| 波多野结衣欧美| 欧美一区二区三区在线电影| 久久精品日产第一区二区三区高清版| 亚洲手机成人高清视频| 久久国内精品视频| 色天天综合色天天久久| 精品久久久久av影院| 亚洲视频精选在线| 国产一区二区三区四区五区美女| 色先锋久久av资源部| 久久久久国产精品麻豆ai换脸 | 久久精品夜色噜噜亚洲a∨| 一区二区三区欧美激情| 国产黄色成人av| 欧美精品高清视频| 亚洲色图19p| 国产精品1区二区.| 欧美一级生活片| 亚洲一区二区三区自拍| 成人动漫一区二区在线| 亚洲精品一线二线三线| 亚洲成人午夜电影| 91玉足脚交白嫩脚丫在线播放| 精品播放一区二区| 免费黄网站欧美| 欧美精品一二三| 亚洲午夜一区二区| 97精品电影院| 国产精品麻豆一区二区| 国产精品亚洲一区二区三区妖精| 欧美日韩精品一区二区三区蜜桃| 中文字幕一区二区三区av| 国产一区二区在线免费观看| 91精品国产美女浴室洗澡无遮挡| 亚洲乱码精品一二三四区日韩在线| 国产乱一区二区| 久久久久久日产精品| 韩国欧美国产一区| 欧美精品一区二区久久婷婷| 奇米影视一区二区三区| 7777精品久久久大香线蕉 | 亚洲欧美综合另类在线卡通| 国产精品综合久久| 国产日韩精品视频一区| 国产一区二区三区久久久| 久久精品视频免费|