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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? algorithmlbg.java_2

?? 完整的模式識別庫
?? JAVA_2
?? 第 1 頁 / 共 2 頁
字號:
//----------------------------------------------------------------------
// AlgorithmLBG.java
//
// Created: 7/15/03
//
// Author: Phil Trasatti
// 
// Last Edited by: Daniel May
//
// Class: AlgorithmLBG
// 
// 
//---------------------------------------------------------------------

//----------------------
// import java packages
//----------------------
import java.util.*;
import java.awt.*;


public class AlgorithmLBG extends Algorithm
{

    //-----------------------------------------------------------------
    //
    // static data members
    //
    //-----------------------------------------------------------------

    //-----------------------------------------------------------------
    //
    // primitive data members
    //
    //-----------------------------------------------------------------

    int output_canvas_d[][];   
    int iterations;
    int currObject;
    int clusters;

    //-----------------------------------------------------------------
    //
    // instance data members
    //
    //-----------------------------------------------------------------
        
    String algo_id = "AlgorithmLBG"; 
    Vector support_vectors_d;
    Vector data_pool_d;
    Vector cbinary_d;
    DecisionRegion decision_regions_d;
    OutputPanel plain_data;

    //---------------------------------------------------------------
    //
    // class methods
    //
    //---------------------------------------------------------------


    //---------------------------------------------------------------
    // method: initialize
    //
    // arguments: none
    // return   : boolean
    //
    // description:  
    // overrides the initialize() method in the base class.  initializes
    // member data and prepares for execution of first step.  this method
    // "resets" the algorithm.
    //---------------------------------------------------------------
    public boolean initialize()
    {
	// Debug
	System.out.println(algo_id + ": initialize()");
	
	scale = output_panel_d.disp_area_d.getDisplayScale();
	data_pool_d = new Vector();
	decision_regions_d = new DecisionRegion();
	point_means_d = new Vector();
	support_vectors_d = new Vector();
	description_d = new Vector();
	step_count = 3;
	iterations = clusters;
	System.out.println("" + iterations);
	guesses_d = new Vector(2, 2);
	cbinary_d = new Vector();
	currObject = 0;

	// add the process description for the LBG algorithm
	if (description_d.size() == 0)
	    {
		String str = new String("   0. Initialize the original data.");
		description_d.addElement(str);
		
		str = new String("   1. Displaying the original data.");
		description_d.addElement(str);
		
		str = new String("   2. Computing the means for each class.");
		description_d.addElement(str);
		
		str = new String("   3. Stepping through iterations.");
		description_d.addElement(str);

		str = new String("Iteration");
		description_d.addElement(str);		
	    }
	
	// append message to process box
	pro_box_d.appendMessage("LBG Analysis:" + "\n");
	
	// set the data points for this algorithm
	set1_d = (Vector)data_points_d.dset1.clone();
	set2_d = (Vector)data_points_d.dset2.clone();
	set3_d = (Vector)data_points_d.dset3.clone();
	set4_d = (Vector)data_points_d.dset4.clone();
	
	// advance to step 1
	step_index_d = 0;
	
	// append message to process box
	pro_box_d.appendMessage((String)description_d.get(step_index_d));
		
	// exit gracefully
	return true;
	
    }

    //---------------------------------------------------------------
    // method: step1
    //
    // arguments: none
    // return   : boolean
    //
    // description:  
    // displays data sets from input box in output box.
    // 
    //---------------------------------------------------------------
    boolean step1()
    {
	// Debug
	System.out.println(algo_id + " : step1()");
	
	// set up progress bar
	pro_box_d.setProgressMin(0);
	pro_box_d.setProgressMax(1);
	pro_box_d.setProgressCurr(0);
	
	scaleToFitData();

	// Display original data
	output_panel_d.addOutput(set1_d, Classify.PTYPE_INPUT, 
				 data_points_d.color_dset1);
	output_panel_d.addOutput(set2_d, Classify.PTYPE_INPUT,
				 data_points_d.color_dset2);
	output_panel_d.addOutput(set3_d, Classify.PTYPE_INPUT,
				 data_points_d.color_dset3);
	output_panel_d.addOutput(set4_d, Classify.PTYPE_INPUT, 
				 data_points_d.color_dset4);
	
	plain_data = output_panel_d.copy();

	// step 1 completed
	pro_box_d.setProgressCurr(1);
	output_panel_d.repaint();
	
	return true;
    }

    //---------------------------------------------------------------
    // method: step2
    //
    // arguments: none
    // return   : boolean
    //
    // description:  
    // computes the means of each data set and displays the means graphically
    // and numerically
    // 
    //---------------------------------------------------------------
    boolean step2()
    {
	// Debug
	System.out.println(algo_id + " : step2()");
	
	// determine the within class scatter matrix
	generatePool();
	decision_regions_d.addRegion((Vector)data_pool_d.clone());

	MyPoint mean = MathUtil.computeClusterMean(data_pool_d);

	computeMeans();

	guesses_d.addElement(new MyPoint(mean.x, mean.y));

	decision_regions_d.setGuesses((Vector)guesses_d.clone());


	output_panel_d.addOutput(decision_regions_d.getGuesses(), 
				 Classify.PTYPE_OUTPUT_LARGE, 
				 Color.black);

	//cbinary_d.addElement(decision_regions_d);	

	pro_box_d.setProgressCurr(20);
	output_panel_d.repaint();
	
	return true;
    }
    
    //---------------------------------------------------------------
    // method: step3
    //
    // arguments: none
    // return   : boolean
    //
    // description:   
    // Computes the Decision Regions and the associated errors. 
    // 
    //---------------------------------------------------------------    
    boolean step3()
    {
	// Debug
	System.out.println(algo_id + " : step3()");
	
	if (currObject == 0)
	    pro_box_d.appendMessage((String)description_d.get(step_index_d));

	if (currObject < iterations)
	{
	    step_index_d--;

	    output_panel_d.clear();

	    output_panel_d = plain_data.copy();

	    output_panel_d.addOutput(set1_d, Classify.PTYPE_INPUT, 
	    		     data_points_d.color_dset1);
	    output_panel_d.addOutput(set2_d, Classify.PTYPE_INPUT,
	    		     data_points_d.color_dset2);
	    output_panel_d.addOutput(set3_d, Classify.PTYPE_INPUT,
	    		     data_points_d.color_dset3);
	    output_panel_d.addOutput(set4_d, Classify.PTYPE_INPUT, 
	                   data_points_d.color_dset4);
		    

	    output_panel_d.addOutput(decision_regions_d.getGuesses(), 
				     Classify.PTYPE_OUTPUT_LARGE, 
				     Color.black);


	    guesses_d = decision_regions_d.getGuesses();

	    System.out.println("Num Guesses" + guesses_d.size());

	    Vector guesses_d = decision_regions_d.;

	    Vector decisionRegions = decision_regions_d.getRegions();

	    //DecisionRegion region = new DecisionRegion(decision_regions_d);

	    decision_regions_d = new DecisionRegion();

	    // classify the data based on the guesses
	    //
	    classify(decision_regions_d);
	    
	    // compute the new means of the classified data
	    //
	    computeBinaryDeviates(decision_regions_d);
	    
	    // store the current iteration of the data set
	    //
	    //cbinary_d.addElement(decision_regions_d);
	    
	    output_panel_d.repaint();

	    currObject++;

	    pro_box_d.appendMessage("   Displaying Iteration: " + currObject  
				    + "\n");

	    //DecisionRegion region;

	    //region = (DecisionRegion)cbinary_d.elementAt(currObject);
	    //   System.out.println("Size of cbinary " + cbinary_d.size());

 	    // determine the total number of clusters
	    //
	    int numclusters = decision_regions_d.getNumRegions();
	    
	    // determine the classification error of each cluster
	    //
	    double error = 0.0;
	    double total = 0.0;   

	    System.out.println("numclusters: " + numclusters);
	    
	    for (int i=0; i<numclusters; i++) {
		
		// get the cluster associated with the region
		//
		Vector cluster = decision_regions_d.getRegion(i);
		
		// determine the mean of the current cluster
		//
		MyPoint mean = MathUtil.computeClusterMean(cluster);
		
		System.out.println(mean.toString());
		// display the mean for the current cluster
		//
		//double xval = setDecimal((mean.x) + Xmin, 2);
		//double yval = setDecimal(Ymax - (mean.y), 2);
		
		String message = new String("      Mean for cluster " +
					    i + ": " 
					    + mean.x + ", " + mean.y);
		pro_box_d.appendMessage(message + "\n");
		
		// determine the covariance matrix for the cluster
		//
		double x[] = new double[cluster.size()];
		double y[] = new double[cluster.size()];
		
		for (int j=0; j<cluster.size(); j++) {
		    MyPoint covarPoint =  (MyPoint)cluster.elementAt(j);
		    x[j] = (covarPoint.x);
		    y[j] = (covarPoint.y);
		}
		
		// declare the covariance object
		//
		Covariance cov = new Covariance();
		
		// declare the covariance matrix
		//
		Matrix covar = new Matrix();
		covar.row = covar.col = 2;
		covar.Elem = new double[2][2];
		
		// compute the covariance matrix of the first data set
		//
		covar.Elem = cov.computeCovariance(x, y);
		
		// display the covariance matrix for the cluster
		//
		double c11 = MathUtil.setDecimal(covar.Elem[0][0], 2);
		double c12 = MathUtil.setDecimal(covar.Elem[0][1], 2);
		double c21 = MathUtil.setDecimal(covar.Elem[1][0], 2);
		double c22 = MathUtil.setDecimal(covar.Elem[1][1], 2);
		
		message = new String("      Covariance matrix:\n" +
				     "         " + c11 
				     + "    " + c12 + "\n" +
				     "         " + c21 
				     + "    " + c22);
		
		pro_box_d.appendMessage(message + "\n");
		
		// determine the closest of the original data sets
		//
		int closest = getClosestSet(mean);
		
		// compute the classification error
		//
		total += (double)cluster.size();
		error += (double)displayClusterError(closest, 
						     cluster, i);
	    }
	    
	    double err = (error / total) * 100.0;
	    
	    // display the clasification error
	    //
	    String message =  new String("       Overall results:\n" +
					 "          Total number of samples: " + 
					 total + "\n" +
					 "          Misclassified samples: " + 
					 error + "\n" +
					 "          Classification error: " + 
					 MathUtil.setDecimal(err, 2) + "%");
	    pro_box_d.appendMessage(message + "\n");
	    
	    // update the output canvas
	    //
	    output_panel_d.repaint();
	}
	return true;
    }

    //---------------------------------------------------------------
    // method: run
    //
    // arguments: none
    // return   : none
    //
    // description: 
    // implementation of the run function from the Runnable interface.
    // determines what the current step is and calls the appropriate method.
    //--------------------------------------------------------------- 
    public void run()
    {
	// Debug
	System.out.println(algo_id + " : run()");
	
	if (step_index_d == 1)
	    {
		step1();
	    }
	
	else if (step_index_d == 2)
	    {
		step2(); 
	    }
	
	else if (step_index_d == 3)
	    {
		step3();
	    }
	// exit gracefully
	//
	return;
    }

    public void generatePool() {

	// determine the pool of points only once
	//
	if (data_pool_d.size() > 0) {

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区不卡在线播放 | 男男视频亚洲欧美| 欧美日韩一区中文字幕| 伊人婷婷欧美激情| 91精选在线观看| 精品一区二区精品| 久久精品免费在线观看| 成人黄色在线网站| 亚洲sss视频在线视频| 亚洲丝袜制服诱惑| 欧美系列在线观看| 狠狠久久亚洲欧美| 亚洲欧美在线视频| 91精品欧美综合在线观看最新| 蜜臂av日日欢夜夜爽一区| 久久久99精品久久| 91亚洲永久精品| 免费欧美日韩国产三级电影| wwww国产精品欧美| 91蜜桃免费观看视频| 国产精品视频yy9299一区| 成人欧美一区二区三区小说| 国产精品国产馆在线真实露脸| 手机精品视频在线观看| 色综合色狠狠综合色| 99久精品国产| 欧美高清视频不卡网| 日韩一区二区影院| 亚洲成人www| 色婷婷一区二区| 国产精品久久久久久妇女6080 | 三级欧美在线一区| 国产99久久久国产精品潘金 | 美女在线视频一区| 国产精品传媒入口麻豆| 亚洲成人你懂的| 91精品国产色综合久久ai换脸| 欧美一区二区三区的| 国产盗摄女厕一区二区三区| 欧美体内she精高潮| 国产一区二区精品久久99| 天堂影院一区二区| 欧美中文字幕一二三区视频| 综合网在线视频| 色欲综合视频天天天| 亚洲视频每日更新| 经典一区二区三区| 国产精品区一区二区三区| 另类专区欧美蜜桃臀第一页| 日韩美女一区二区三区| 成人高清视频免费观看| 极品瑜伽女神91| 欧美一区二区三区系列电影| 成人av电影在线观看| 久久电影网站中文字幕 | av电影一区二区| 精品一区二区三区欧美| 亚洲bt欧美bt精品777| 椎名由奈av一区二区三区| 日韩三级在线观看| 欧美一区二区三区免费| 欧美三级韩国三级日本一级| 色婷婷久久久久swag精品| 盗摄精品av一区二区三区| 国产一区二区三区免费在线观看| 亚洲国产精品久久人人爱蜜臀| 国产精品每日更新| 国产视频在线观看一区二区三区| 欧美mv日韩mv国产网站| 69p69国产精品| 91麻豆精品国产自产在线| 欧美最猛黑人xxxxx猛交| 一本久久a久久精品亚洲| 99久久亚洲一区二区三区青草| 99久久精品国产一区二区三区 | 奇米影视一区二区三区小说| 视频一区二区三区入口| 日韩在线卡一卡二| 日本sm残虐另类| 日本成人在线电影网| 91在线码无精品| 成人av午夜影院| 色综合亚洲欧洲| 欧美日韩精品电影| 欧美日韩精品一区二区| 欧美精品123区| 日韩美女一区二区三区| 精品国产乱码久久久久久牛牛| 日韩欧美一区二区不卡| 久久亚洲综合av| 欧美国产成人在线| 亚洲欧美日韩国产成人精品影院| 亚洲高清免费在线| 麻豆精品国产传媒mv男同| 精品一区二区精品| 成人国产精品免费观看| 在线观看国产日韩| 欧美一区二区啪啪| 久久亚洲精华国产精华液| 亚洲国产成人午夜在线一区| 亚洲免费电影在线| 三级影片在线观看欧美日韩一区二区| 久久综合综合久久综合| 国产成a人无v码亚洲福利| av中文字幕不卡| 欧美一区二区三区不卡| 国产亚洲婷婷免费| 亚洲精品久久久蜜桃| 免费视频一区二区| 粉嫩av一区二区三区粉嫩| 欧美网站一区二区| 久久久精品天堂| 亚洲一二三专区| 国产一区二区三区在线看麻豆| 99久久精品国产观看| 日韩一区二区三区免费看| 国产精品久久久爽爽爽麻豆色哟哟| 一区二区三区在线观看国产| 麻豆成人免费电影| av不卡在线播放| 欧美成人vr18sexvr| 亚洲欧美视频在线观看视频| 久久精品国产亚洲一区二区三区| 成人av在线资源| 日韩免费成人网| 亚洲精品成人少妇| 国产成人h网站| 日韩一级完整毛片| 亚洲精选免费视频| 极品瑜伽女神91| 欧美日韩成人在线| **欧美大码日韩| 国产一区二区三区黄视频 | 国产中文字幕一区| 欧美日韩免费电影| 综合自拍亚洲综合图不卡区| 久久电影网电视剧免费观看| 精品视频免费看| 亚洲精品乱码久久久久久黑人| 国产一区二区三区四| 在线播放欧美女士性生活| 亚洲欧美偷拍卡通变态| 懂色av一区二区夜夜嗨| 精品日韩99亚洲| 丝袜美腿一区二区三区| 99re视频这里只有精品| 亚洲国产成人自拍| 国产激情视频一区二区三区欧美 | 亚洲国产精品久久人人爱| 不卡欧美aaaaa| 国产亚洲精品福利| 精品一区二区三区影院在线午夜| 在线不卡中文字幕| 亚洲成人三级小说| 欧美主播一区二区三区| 亚洲精品视频免费看| 波多野结衣中文字幕一区| 国产欧美日韩在线视频| 国产一区二区精品久久91| 日韩亚洲欧美中文三级| 婷婷综合久久一区二区三区| 在线观看成人小视频| 亚洲乱码国产乱码精品精可以看| proumb性欧美在线观看| 国产欧美日韩亚州综合 | 亚洲欧洲av另类| av亚洲精华国产精华| 国产精品美女久久久久av爽李琼| 成人91在线观看| 中文字幕亚洲不卡| 一本久久a久久免费精品不卡| 亚洲精品欧美在线| 欧美日本一区二区| 美国十次了思思久久精品导航| 日韩一区二区三区电影在线观看| 蜜桃在线一区二区三区| 日韩欧美第一区| 国产麻豆欧美日韩一区| 国产精品美女久久久久aⅴ国产馆 国产精品美女久久久久av爽李琼 国产精品美女久久久久高潮 | 日韩一区二区视频| 精品中文字幕一区二区小辣椒| 精品国产sm最大网站| 懂色av中文字幕一区二区三区| 中文字幕日本不卡| 欧美日韩一区二区三区不卡| 日韩av中文在线观看| 精品av综合导航| 99在线精品视频| 天堂蜜桃91精品| 国产日本欧洲亚洲| 欧美中文字幕亚洲一区二区va在线| 日韩影院免费视频| 久久久精品国产免大香伊| 成人综合激情网| 亚洲午夜影视影院在线观看| 欧美一区二区三区男人的天堂| 国产一区二区免费视频| 亚洲视频在线一区观看| 在线成人免费视频| 国产很黄免费观看久久|