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

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

?? partition.java

?? clustering data for the different techniques of data mining
?? JAVA
?? 第 1 頁 / 共 5 頁
字號:
    System.out.println();
  }

  /** appends contents of this Partition as an array of integers to
   * <code>output</code>*/
  protected void print(StringBuffer output)
  {
    for (int i = 0; i < size; i++)
      output.append(v[i] + " ");
    
    output.append("\n");
  }

  /** prints this Partition as an array of a collection of rowids */
  public void printAM()
  {
    int noClasses = getNoClasses();
    Hashtable[] am = new Hashtable[noClasses];
    for (int i = 0; i < noClasses; i++)
      am[i] = new Hashtable();
    
    System.out.print("printAM noClasses = " + noClasses);
    print();

    getAM(am);
  
    System.out.print("[");
    for (int i = 0; i < noClasses; i++)
      {
	 System.out.print("[ ");

	 try
	   {
	     for (Enumeration keys = am[i].keys(); keys.hasMoreElements(); )
	       System.out.print(keys.nextElement() + " ");
	   }
	 catch(NoSuchElementException e)
	   {
	     System.err.println("InternalError:Partition.printAM()!");
	     System.exit(1);
	   }

	 System.out.print("]");
      }
    System.out.println("]");
  }
  
  /** @return the entropy of this partition computed with
   * <code>entropyMeasure</code> */
  public double entropy(int entropyMeasure)
  {
    double entropy = 0.0;
    for (Enumeration classCards = classCard.elements(); 
	 classCards.hasMoreElements(); )
      entropy += ImpurityMeasure.impurityMeasure(entropyMeasure,
						 ((Integer)classCards.nextElement()).intValue() / (double)size);
    return entropy;
  }

  /** @return true if this Partition is equal to the one received as
   * argument, false otherwise */
  public boolean isEqual(Partition p)
  {
    if (size != p.size)
      {
	if (Global.DEBUG == 1)
	  System.err.println("Warning! Partition.isEqual(): compared two partitions with different size");
	return false;
      }
    
    for (int i = 0; i < size; i++)
      if (v[i] != p.v[i])
	return false;
    
    return true;
  }

  /** sets the values of this Partition equal to the one from the
   * parameter */
  public void set(Partition p)
  {
    if (Global.DEBUG == 1)
      if (size != p.size)
	{
	  System.err.println("ERROR! Partition.set(): partitions have different size");
	  System.exit(1);
	}

    for (int rowid = 0 ; rowid < size; rowid++)
      set(rowid, p.v[rowid]);
    
    fitness = p.fitness;
    classFitness = new Hashtable(p.classFitness);
    cfIsValid = p.cfIsValid;
  }

  /** @return the cardinality of class <code>c</code> */
  public int getClassCard(int c)
  {
    Integer classNo = new Integer(c);
    if (classCard.containsKey(classNo) == true)
      return ((Integer)classCard.get(classNo)).intValue();
    else
      return 0;
  }

  /** @return the fitness of class <code>c</code> */
  public double getClassFitness(int c)
  {
    if (cfIsValid == false)
      {
	System.err.println("ERROR! Partition.getClassFitness(): cfIsValid = false");
	System.exit(1);
      }

    Integer classNo = new Integer(c);
    if (classFitness.containsKey(classNo))
      return ((Double)classFitness.get(classNo)).doubleValue();
    else
      {
	System.err.println("ERROR! Partition.getClassFitness(): invalid class no " + c);
	System.exit(1);
      }
    return 0.0;
  }

  /** sets the fitness of class <code>c</code> to <code>value</code> */
  public void setClassFitness(int c, double value)
  {
    classFitness.put(new Integer(c), new Double(value));
    cfIsValid = true;
  }

  /** @return fitness of this Partition */
  public double getFitness()
  {
    return fitness;
  }

  /** sets the fitness of this Partition to value <code>f</code> */
  public void setFitness(double f)
  {
    fitness = f;
  }

  /** @return the fitness type of the classes */
  public int getClassFitnessType()
  {
    return classFitnessType;
  }

  /** computes intersections between the classes of partitions in
      collection <code>c1</code> and classes of the partitions in
      collection <code>c2</code>
      @param NPART1 represents the number of partitions in c1
      @param NPART2 represents the number of partitions in c2
      @param intersectMap stores in intersectMap[i][j]: <class of
      c1[i], <class of c2[j], intersection count >>;
      intersectMap[i][j] is a map for intersections between partitions
      c1[i] and c2[j]; intersectMap[i][j]:key corresponds to each
      distinct value in c1[i](C_s); intersectMap[i][j]:value
      corresponds to a map with intersections between c2[j][t] and
      c1[i][s] (B_t x C_s); intersectMap[i][j] = <C_s, <B_t, B_t x C_s
      >> */
  static public void computeIntersections(Partition[] c1, int NPART1, 
				   Partition[] c2, int NPART2,
				   Hashtable[][] intersectMap)
  {
    int SIZE = c1[0].size; // partition size
    
    // create maps
    for (int rowid = 0; rowid < SIZE; rowid++)
      for (int i = 0; i < NPART1; i++)
	for (int j = 0; j < NPART2; j++)
	  {
	    Integer currClassC1 = new Integer(c1[i].v[rowid]);
	    Integer currClassC2 = new Integer(c2[j].v[rowid]);
	    
	    if (intersectMap[i][j].containsKey(currClassC1) == false)
	      {
		// currClassC1 has no hashtable associated yet
		// create a new table, with mapping (currClassC2, 1)
		Hashtable h = new Hashtable();
		h.put(currClassC2, new Integer(1));
		intersectMap[i][j].put(currClassC1, h);
	      }
	    else
	      {
		// currClassC1 has already a hashtable associated
		Hashtable h = (Hashtable)intersectMap[i][j].get(currClassC1);
		// does it contain an entry for currClassC2
		if (h.containsKey(currClassC2) == false)
		  h.put(currClassC2, new Integer(1));
		else
		  {
		    int oldCount = ((Integer)h.get(currClassC2)).intValue();
		    h.put(currClassC2, new Integer(oldCount+1));
		  }
	      }
	  }
  }
  
  /** computes intersections between the classes of partition
      <code>p</code> and classes of the partitions in collection
      <code>c</code>
      @param NPART represents the number of partitions in c
      @param intersectMap[i] stores: <class of p, <class of c[i],
      intersection count >>; intersectMap[i] is a map for
      intersections between partitions c[i] and p; intersectMap[i]:
      key corresponds to each distinct value in p (C_s);
      intersectMap[i]: value corresponds to a map with intersection
      between c[i][t] and p[s] (B_t x C_s); intersectMap[i] = <C_s,
      <B_t, B_t x C_s >> */
  static public void computeIntersections(Partition p, 
					  Partition[] c, int NPART,
					  Hashtable[] intersectMap)
  {
    int SIZE = p.size; // partition size
    
    // create maps
    for (int rowid = 0; rowid < SIZE; rowid++)
      for (int i = 0; i < NPART; i++)
	{
	  Integer currClass = new Integer(p.v[rowid]);
	  Integer currClassC = new Integer(c[i].v[rowid]);
	  
	  if (intersectMap[i].containsKey(currClass) == false)
	    {
	      // currClass has no hashtable associated yet
	      // create a new table, with mapping (currClassC, 1)
	      Hashtable h = new Hashtable();
	      h.put(currClassC, new Integer(1));
	      intersectMap[i].put(currClass, h);
	    }
	  else
	    {
	      // currClass has already a hashtable associated
	      Hashtable h = (Hashtable)intersectMap[i].get(currClass);
	      // does it contain an entry for currClassC
	      if (h.containsKey(currClassC) == false)
		h.put(currClassC, new Integer(1));
	      else
		{
		  int oldCount = ((Integer)h.get(currClassC)).intValue();
		  h.put(currClassC, new Integer(oldCount+1));
		}
	    }
	}
  }
  
  /** prints the intersection between classes of one partition and
   * other <code>nPart</code> partitions */
  static public void printIntersections(Hashtable[] intersectMap, int nPart)
  {
    for (int i = 0; i < nPart; i++)
      {
	System.out.println("Intersections with partition " + i);
	try
	  {

	    for (Enumeration classesC1 = intersectMap[i].keys(); 
		 classesC1.hasMoreElements();)
	      {
		Integer currClassC1 = (Integer)classesC1.nextElement();
		Hashtable intersect = (Hashtable)intersectMap[i].get(currClassC1);
		for (Enumeration classesC2 = intersect.keys(); 
		     classesC2.hasMoreElements();)
		  {
		    Integer currClassC2 = (Integer)classesC2.nextElement();
		    System.out.println(currClassC1 + " " + currClassC2 + " " 
				       + intersect.get(currClassC2));
		  }
	      }
	  }
	catch(NoSuchElementException e)
	  {
	    System.err.println("InternalError! Partition.printIntersections");
	    System.exit(1);
	  }
      }
  }

  /** @return entropy of the partition resulting from the
   * intersection of this Partition with the one received as argument,
   * computed with <code>entropyMeasure</code> */
  public double entropyIntersect(Partition p, int entropyMeasure)
  {
    // <Cs, <Bt, |Cs x Bt|> >
    Hashtable[] intersectMap = new Hashtable[1];
    intersectMap[0] = new Hashtable();
    Partition[] c = new Partition[1];
    c[0] = p;
    // create map with intersections
    computeIntersections(this, c, 1, intersectMap);

    double entropy = 0.0;
    // key: C_s, value: <B_t, B_t x C_s >
    for (Enumeration values = intersectMap[0].elements(); 
	 values.hasMoreElements(); )
      {
	Hashtable intersections = (Hashtable)values.nextElement();
	
	// key: B_t, value: |Bt x C_s|
	for (Enumeration counts = intersections.elements(); 
	     counts.hasMoreElements(); )
	  {
	    int count = ((Integer)counts.nextElement()).intValue(); // |B_t x C_s|
	    if (Global.DEBUG == 1)
	      if (count == 0)
		{
		  System.err.println("ERROR! Partition.entropyIntersect(): |B_t x C_s| = 0");
		  System.exit(1);
		}

	    entropy += ImpurityMeasure.impurityMeasure(entropyMeasure,
						       (double)count 
						       /(double)size);
	  }
      }
    
    return entropy;
  }


  /** fills the vector <code>v</code> with a Double representing the
   * value of the entropy of the partition determined by the
   * intersection of all <code>NPART</code> partitions in the
   * collection <code>c</code> and with an Integer representing the
   * number of classes of the intersection partition */
  static public void computeInfoIntersections(Partition[] c, int NPART, 
					      int entropyMeasure,
					      Vector v)
  {
    // the value in the partitions are integers so the key will be an
    // Integer; key:intersection class id, value: cardinality of the
    // class
    Hashtable intersections = new Hashtable();
    int SIZE = c[0].getSize(); // size of the partitions in c
    int key = 0;
    for (int rowid = 0; rowid < SIZE; rowid++)
      {
	for (int i = NPART-1; i >= 0; i--)
	  {
	    // accumulates the values in the columns to create a number; if
	    // the columns contain 1 2 3 4 5 for this rowid the key will
	    // be the number 12345
	    key = key*10 + c[i].v[rowid];
	  }
	
	Integer keyInt = new Integer(key);
	
	int count = 0;
	// is key already in the map, get old count
	if (intersections.containsKey(keyInt) == true)
	  count = ((Integer)intersections.get(keyInt)).intValue();
	
	intersections.put(keyInt, new Integer(count+1));
      }
    
    // compute entropy
    double entropy = 0.0;
    for (Enumeration values = intersections.elements(); 
	 values.hasMoreElements(); )
      entropy += ImpurityMeasure.impurityMeasure(entropyMeasure,
						 ((Integer)values.nextElement()).doubleValue() / (double)SIZE);

    v.insertElementAt(new Double(entropy), 0);

    v.insertElementAt(new Integer(intersections.size()), 1);
  }

  /** @return true if for the specified <code>fitnessMeasure</code>
   * we need to compute the entropy conditioned by the partition of
   * the argument */
  private boolean needsEntropyConditionedByThem(int fitnessMeasure)
  {
    return (fitnessMeasure == Global.FM_P_PA
	    || fitnessMeasure == Global.FM_BOTH
	    || fitnessMeasure == Global.FM_BOTH_SCALED
	    || fitnessMeasure == Global.FM_Q
	    || fitnessMeasure == Global.FM_L
	    || fitnessMeasure == Global.FM_Q_QR
	    || fitnessMeasure == Global.FM_ALTERNATE_HAVG
	    || fitnessMeasure == Global.FM_ALTERNATE
	    || fitnessMeasure == Global.FM_MOD
	    || fitnessMeasure == Global.FM_COS
	    || fitnessMeasure == Global.FM_NORM_W
	    || fitnessMeasure == Global.FM_WE
	    || fitnessMeasure == Global.FM_TEST);
  }

  /** @return true if for the specified <code>fitnessMeasure</code>
   * we need to compute the entropy conditioned by this partition */
  private boolean needsEntropyConditionedByUs(int fitnessMeasure)
  {
    return (fitnessMeasure == Global.FM_PA_P
	    || fitnessMeasure == Global.FM_BOTH
	    || fitnessMeasure == Global.FM_BOTH_SCALED
	    || fitnessMeasure == Global.FM_QR
	    || fitnessMeasure == Global.FM_LR
	    || fitnessMeasure == Global.FM_Q_QR
	    || fitnessMeasure == Global.FM_ALTERNATE_HAVG
	    || fitnessMeasure == Global.FM_ALTERNATE
	    || fitnessMeasure == Global.FM_MOD
	    || fitnessMeasure == Global.FM_COS
	    || fitnessMeasure == Global.FM_NORM_W
	    || fitnessMeasure == Global.FM_WE
	    || fitnessMeasure == Global.FM_TEST);
  }

  /** @return true if for the specified <code>fitnessMeasure</code>
   * we need to compute the entropy of intersections of all
   * partition */
  private boolean needsEntropyOfIntersection(int fitnessMeasure)
  {
    return (fitnessMeasure == Global.FM_L
	    || fitnessMeasure == Global.FM_LR);
  }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品99久| 日本高清免费不卡视频| 成人aa视频在线观看| 91黄色激情网站| 欧美久久久一区| 精品国产欧美一区二区| 久久久天堂av| 日韩制服丝袜先锋影音| 欧美性受xxxx| 性做久久久久久免费观看| 日韩中文字幕麻豆| 99在线精品视频| 欧美最猛性xxxxx直播| 久久综合久久综合久久| 亚洲人成在线播放网站岛国| 性做久久久久久久久| 国产suv精品一区二区883| 国产精品18久久久久久久网站| 不卡大黄网站免费看| 日韩一级欧美一级| 夜夜精品浪潮av一区二区三区| 成人开心网精品视频| 日韩视频免费直播| 亚洲人123区| 日韩不卡一区二区| 99re这里只有精品6| 精品成人免费观看| 中文字幕亚洲一区二区av在线 | 久久av资源站| 欧美在线色视频| 亚洲欧美怡红院| 成人在线一区二区三区| 久久久久青草大香线综合精品| 国产在线视频精品一区| 2020日本不卡一区二区视频| 国内久久精品视频| 国产欧美一区二区精品忘忧草| 国产一区二区三区在线观看免费| 日韩欧美国产麻豆| 国产揄拍国内精品对白| 久久婷婷一区二区三区| 国产一区二区精品久久| 久久久久久久性| 国产成人在线电影| 中文字幕一区二区5566日韩| 日本高清免费不卡视频| 天堂成人国产精品一区| 精品久久国产字幕高潮| 国产成人精品免费网站| 综合色中文字幕| 欧美群妇大交群的观看方式| 精品一二线国产| 国产精品亲子乱子伦xxxx裸| 91久久精品午夜一区二区| 日日欢夜夜爽一区| 亚洲精品一区二区三区福利| 不卡电影免费在线播放一区| 一区二区三区在线视频观看58| 6080国产精品一区二区| 国产精品一区免费视频| 玉米视频成人免费看| 欧美电影免费观看高清完整版| 国产伦精品一区二区三区在线观看| 亚洲国产精品激情在线观看 | 亚洲国产精品t66y| 91久久精品一区二区三区| 久久成人精品无人区| 国产精品欧美久久久久一区二区| 91精彩视频在线| 国内精品伊人久久久久影院对白| 椎名由奈av一区二区三区| 91精品国产综合久久久久久久久久| 国内不卡的二区三区中文字幕 | 色呦呦网站一区| 国产成人午夜高潮毛片| 亚洲影院在线观看| 久久精品人人做人人爽人人| 精品视频在线看| 国产一区 二区 三区一级| 亚洲午夜电影网| 亚洲国产精品精华液2区45| 欧美精选一区二区| 99热精品一区二区| 国内精品伊人久久久久影院对白| 樱桃视频在线观看一区| 欧美国产成人在线| 精品国产123| 欧美日韩国产高清一区二区三区| 成人免费毛片嘿嘿连载视频| 久久国产剧场电影| 午夜久久久影院| 亚洲主播在线播放| 亚洲欧美另类久久久精品| 久久午夜国产精品| 欧美成人在线直播| 在线成人小视频| 欧美日韩在线一区二区| 91免费视频网| av激情综合网| 丁香另类激情小说| 国产白丝网站精品污在线入口| 久久av老司机精品网站导航| 日韩高清不卡在线| 亚洲一二三专区| 亚洲另类中文字| 亚洲欧美激情插| 亚洲免费视频中文字幕| 亚洲天堂久久久久久久| 国产精品久久久久久久裸模| 国产亚洲精品久| 欧美激情在线观看视频免费| 久久你懂得1024| 国产欧美日韩三级| 国产精品传媒入口麻豆| 国产精品久久久久一区二区三区| 国产欧美日韩另类一区| 中文字幕电影一区| 国产精品久久三| 最新热久久免费视频| 亚洲激情六月丁香| 亚洲成人精品一区| 午夜精品一区二区三区免费视频| 午夜精品久久久久久久蜜桃app| 偷拍日韩校园综合在线| 日韩精品一区第一页| 美国十次综合导航| 狠狠色丁香婷综合久久| 国产精品白丝jk白祙喷水网站 | 亚洲高清不卡在线观看| 石原莉奈在线亚洲二区| 日本不卡在线视频| 国产麻豆精品视频| 成人激情黄色小说| 色婷婷精品久久二区二区蜜臂av| 91成人国产精品| 91精品国产综合久久福利软件 | 91精品国产麻豆| ww亚洲ww在线观看国产| 国产精品久久久久久户外露出| 亚洲日本在线看| 日韩高清不卡在线| 丰满白嫩尤物一区二区| 色94色欧美sute亚洲线路一ni| 欧美日韩国产综合草草| 欧美videossexotv100| 中文字幕中文字幕中文字幕亚洲无线 | 日本91福利区| 成人午夜看片网址| 欧美日韩一级黄| 国产日韩精品一区二区三区| 狠狠色2019综合网| 色一情一伦一子一伦一区| 日韩免费观看2025年上映的电影| 精品国产乱码久久久久久免费| 国产精品美日韩| 免费在线观看视频一区| 91小视频免费观看| 26uuu久久综合| 亚洲综合区在线| 成人小视频在线| 日韩欧美久久久| 亚洲免费视频中文字幕| 国产精品资源网| 欧美久久高跟鞋激| 亚洲免费高清视频在线| 国产剧情av麻豆香蕉精品| 欧美日韩一区中文字幕| 中文字幕一区二区三区在线不卡| 青草av.久久免费一区| 色综合av在线| 中文乱码免费一区二区| 极品尤物av久久免费看| 欧美日韩精品是欧美日韩精品| 中文字幕一区二区三| 久久99精品视频| 欧美一区二区视频在线观看| 亚洲嫩草精品久久| 国产成人鲁色资源国产91色综 | 免费一级片91| 欧美日韩国产在线观看| 亚洲色图在线看| 高清在线不卡av| 欧美电影免费观看高清完整版| 午夜精品在线视频一区| 色先锋aa成人| 国产精品每日更新| 成人黄色国产精品网站大全在线免费观看| 欧美岛国在线观看| 麻豆国产欧美日韩综合精品二区| 欧美吻胸吃奶大尺度电影| 亚洲天堂网中文字| 97久久超碰国产精品| 国产精品美女久久久久aⅴ国产馆 国产精品美女久久久久av爽李琼 国产精品美女久久久久高潮 | 天天色天天爱天天射综合| 欧美日韩视频在线观看一区二区三区 | 性欧美疯狂xxxxbbbb| 欧美亚洲动漫另类| 一区二区三区四区五区视频在线观看| 99国产精品久久久久久久久久久 | 高清在线观看日韩|