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

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

?? algorithmldapca.java

?? 完整的模式識別庫
?? JAVA
?? 第 1 頁 / 共 3 頁
字號:
//--------------------------------------------------------------------------
// AlgorithmLBG.java 6.0 03/15/2005
// Created       : Phil Trasatti     Edited : Daniel May
//                                   Edited : Sanjay Patil
//                              Last Edited : Ryan Irwin
//
// Description   : Describes the LDAPCA algorithm
// Remarks       : Code unchanged since created. Created 07/15/2003
//--------------------------------------------------------------------------


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

/**
 * Implements the combined LDA and PCA algorithm. The LDA is implemented
 * first and then PCA is implemented.
 */
public class AlgorithmLDAPCA extends Algorithm
{
    // Public Data Members
    //
    Vector<MyPoint> decision_regions_d;
    Vector<MyPoint> support_vectors_d;
    int output_canvas_d[][];
    
    // declare local Matrix objects
    // covariance matrix for CLDA
    Matrix W;
    Matrix LDA;
    Matrix CLDA; 
    Matrix B;
    Matrix S;
    Matrix invW;
    
    // for PCA declare
    //
    Matrix trans_matrix_d = new Matrix();
    Matrix cov_matrix_d = new Matrix();
    
    // declare LDA Class objects
    //  AlgorithmLDA ldaobject = new AlgorithmLDA();
    
    /**
     * Overrides the initialize() method in the base class. Initializes
     * member data and prepares for execution of first step. This method
     * "resets" the algorithm.
     *
     * @return   Returns true
     */
    public boolean initialize()
    {
	algo_id = "AlgorithmLDAPCA";
	    
 	// Debug
	// System.out.println(algo_id + " initialize()");
	
	step_count = 4;
	point_means_d = new Vector<MyPoint>();
	decision_regions_d = new Vector<MyPoint>();
	support_vectors_d = new Vector<MyPoint>();
	description_d = new Vector<String>();

	// for PCA 
	//
	trans_matrix_d = new Matrix();
	cov_matrix_d = new Matrix();
   
	// Initialize local Matrix objects
	//
	W = new Matrix();
	LDA = new Matrix();
	CLDA = new Matrix();
	B = new Matrix();
	S = new Matrix();
	invW = new Matrix();

	// Initialize LDA class object
	// ldaobject = new Algorithm();
	    
	// Add the process description for the LDA 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 and covariance for LDA.");
	    description_d.addElement(str);
		
	    str = new String("   3. Computing the means and covaricance for PCA followed by LDA algorithm.");
	    description_d.addElement(str);

	    str = new String("   4. Computing the decision regions based on the LDA followed by PCA class independent principal component analysis algorithm.");
	    description_d.addElement(str);
	}

	// append message to process box
	//
	pro_box_d.appendMessage("Class Independent LDA 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();
	//
	set1_d = data_points_d.dset1;
	set2_d = data_points_d.dset2;
	set3_d = data_points_d.dset3;
	set4_d = data_points_d.dset4;
   
	// set the step index
	//
	step_index_d = 0;
    
	// append message to process box
	//
	pro_box_d.appendMessage((String)description_d.get(step_index_d));
	    
	// exit initialize
	//
	return true;
    }

    /**
    * 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)
        {
	    disableControl();
	    step1();
	    enableControl();
	}
	
	else if (step_index_d == 2)
	{
	    disableControl();
	    step2(); 
	    enableControl();
	}
	
	else if (step_index_d == 3)
	{
	    disableControl();
	    step3();
	    enableControl(); 
	}
	
	else if (step_index_d == 4)
	{
	    disableControl();
	    step4();
	    pro_box_d.appendMessage("   Algorithm Complete");
	    enableControl(); 
	}
	return;
    }
    
    /**
    * Displays data sets from input box in output box.
    *
    * @return Returns true
    */
    boolean step1()
    {
	// Debug
	//
	// System.out.println(algo_id + " step1()");
	
	pro_box_d.setProgressMin(0);
	pro_box_d.setProgressMax(20);
	pro_box_d.setProgressCurr(0);
	
	// append message to process box
	//
	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);
	
	// step 1 completed
	//
	pro_box_d.setProgressCurr(20);
	output_panel_d.repaint();
	
	return true;
    }

    /**
     * Calculates the within class and between class scatter matrix,
     * transforms the data sets ans displays the mean graphically
     * and numerically
     *
     * @return Returns true
     */
    boolean step2()
    {
	// Debug
	//
	// System.out.println(algo_id + " step2()");
	
	pro_box_d.setProgressMin(0);
	pro_box_d.setProgressMax(20);
	pro_box_d.setProgressCurr(0);
	
	computeMeans();
	
	// determine the within class scatter matrix
	//
	withinClass(W);
	
	// determine the between class scatter matrix
	//
	betweenClass(B);
	
	// determine the ratio of the between class scatter matrix
	// to the within class scatter matrix
	//
	W.invertMatrix(invW);
	invW.multMatrix(B, S);
	
	// transform the samples from all data sets
	//
	transformLDA(data_points_d, S);
	
	displayMatrices();
	
	// display means
	//
	output_panel_d.addOutput(point_means_d, Classify.PTYPE_OUTPUT_LARGE, 
				 Color.black);
	    
	// display support vectors
	//
	output_panel_d.addOutput(support_vectors_d, Classify.PTYPE_INPUT, 
				 Color.black );
	
	// display support vectors
	//
	pro_box_d.setProgressCurr(20);
	output_panel_d.repaint();
	
	return true;
    }

    /**
     * Transforms the data set using PCA and computes mean on the transformed
     * data. Displays the transformed Matrices.
     *
     * @return Returns true
     */
    boolean step3()
    {
	// Debug
	//
	// System.out.println(algo_id + ": step3()");
	
	    
	pro_box_d.setProgressMin(0);
	pro_box_d.setProgressMax(20);
	pro_box_d.setProgressCurr(0);
	    
	// append message to process box
	//
	transformPCA();
	printMatrices();
	computeMeans();
	    
	// display means
	//
	output_panel_d.addOutput(point_means_d, 
				 Classify.PTYPE_OUTPUT_LARGE, Color.black);
	    
	// display support vectors
	//
	output_panel_d.addOutput(support_vectors_d, 
				 Classify.PTYPE_INPUT, Color.cyan);
	    
	// display support vectors
	//
	pro_box_d.setProgressCurr(20);
	output_panel_d.repaint();
	    
	// exit gracefully
	//
	return true;
    }

    /**
     * Computes the decision regions and totals the data points in error,
     * as well displays the decision region
     *
     * @return Returns true
     */
     boolean step4()
    {
	// Debug
	//
	// System.out.println(algo_id + ": step4()");
	    
	pro_box_d.setProgressMin(0);
	pro_box_d.setProgressMax(20);
	pro_box_d.setProgressCurr(0);
	    
	// compute the decision regisions
	//
	computeDecisionRegions();
	    
	// compute errors
	//
	computeErrors();
	    
	// display support vectors
	//
	output_panel_d.addOutput(decision_regions_d, 
				 Classify.PTYPE_INPUT, new Color(255, 200, 0));
	    
	output_panel_d.repaint();
	    
	// exit gracefully
	//
	return true;
    }
    
    /**
     * Determines the within class scatter matrix
     *
     * @param   M Matrix for within class scatter matrix
     * @see     Matrix
     */
   public void withinClass(Matrix M)
    {

	// declare local variables
	//
	int size = 0;
	double x[] = null;
	double y[] = null;
	    
	DisplayScale scale = output_panel_d.disp_area_d.getDisplayScale();

	// declare the covariance object
	//
	Covariance cov = new Covariance();
	    
	// declare local matrices
	//
	Matrix M1 = new Matrix();
	Matrix M2 = new Matrix();
	Matrix M3 = new Matrix();
	Matrix M4 = new Matrix();
	    
	// compute the propabilities of each data set
	//
	double maxsamples = set1_d.size() + set2_d.size() 
	                  + set3_d.size() + set4_d.size();
	    
	double p1 = set1_d.size() / maxsamples;
	double p2 = set2_d.size() / maxsamples;
	double p3 = set3_d.size() / maxsamples;
	double p4 = set4_d.size() / maxsamples;
	    
	// get the first data set size
	//
	size = set1_d.size();
	    
	    // initialize arrays to store the samples
	    //
	x = new double[size];
	y = new double[size];
	    
	    // set up the initial random vectors i.e., the vectors of
	    // X and Y coordinate points form the display
	    //
	for (int i = 0; i < size; i++)
	{
	    MyPoint p = (MyPoint)set1_d.elementAt(i);
	    x[i] = p.x;
	    y[i] = p.y;
	}
	
	// compute the covariance matrix of the first data set
	//
	M1.row = M1.col = 2;
	M1.Elem = new double[2][2];
	M1.resetMatrix();
	
	if (size > 0)
	{
	    M1.Elem = cov.computeCovariance(x, y);
	}
	
	// get the second data set size
	//
	size = set2_d.size();
	
	// initialize arrays to store the samples
	//
	x = new double[size];
	y = new double[size];
	
	// set up the initial random vectors i.e., the vectors of
	// X and Y coordinate points form the display
	//
	for (int i = 0; i < size; i++)
	{
	    MyPoint p = (MyPoint)set2_d.elementAt(i);
	    x[i] = p.x;
	    y[i] = p.y;
	}
	
	// compute the covariance matrix of the second data set
	//
	M2.row = M2.col = 2;
	M2.Elem = new double[2][2];
	M2.resetMatrix();
	
	if (size > 0)
	{
	    M2.Elem = cov.computeCovariance(x, y);
	}
	
	// get the third data set size
	//
	size = set3_d.size();
	
	// initialize arrays to store the samples
	//
	x = new double[size];
	y = new double[size];
	
	// set up the initial random vectors i.e., the vectors of
	// X and Y coordinate points form the display
	//
	for (int i = 0; i < size; i++)
	{
	    MyPoint p = (MyPoint)set3_d.elementAt(i);
	    x[i] = p.x;
	    y[i] = p.y;
	}
	
	// compute the covariance matrix of the third data set
	//
	M3.row = M3.col = 2;
	M3.Elem = new double[2][2];
	M3.resetMatrix();
	    
	if (size > 0)
	{
	    M3.Elem = cov.computeCovariance(x, y);
	}
	    
	// get the fourth data set size
	//
	size = set4_d.size();
	    
	// initialize arrays to store the samples
	//
	x = new double[size];
	y = new double[size];
	    
	// set up the initial random vectors i.e., the vectors of
	// X and Y coordinate points form the display
	//
	for (int i = 0; i < size; i++)
	{
	    MyPoint p = (MyPoint)set4_d.elementAt(i);
	    x[i] = p.x;
	    y[i] = p.y;
	}
	    
	// compute the covariance matrix of the fourth data set
	//
	M4.row = M4.col = 2;
	M4.Elem = new double[2][2];
	M4.resetMatrix();
	    
	if (size > 0)
        {
	    M4.Elem = cov.computeCovariance(x, y);
	}
	    
	// compute the within class scatter matrix
	//
	M.row = M.col = 2;
	M.Elem = new double[2][2];
	M.resetMatrix();
	M.addMatrix(M1);
	M.addMatrix(M2);
	M.addMatrix(M3);
	M.addMatrix(M4);
	CLDA = M;
    }
    
    /**    
     * Determines the between class scatter matrix for
     * the class independent linear discrimination algorithm
     *
     * @param   M Matrix for storing between class scatter matrix
     * @see     Matrix
     */
    public void betweenClass(Matrix M)
    {
	
	// declare local variables
	//
	int capacity = 0;
	int size = 0;
	
	double xmean = 0.0;
	double ymean = 0.0;
	
	double xmean1 = 0.0;
	double ymean1 = 0.0;
	double xmean2 = 0.0;
	double ymean2 = 0.0;
	double xmean3 = 0.0;
	double ymean3 = 0.0;
	double xmean4 = 0.0;
	double ymean4 = 0.0;
	
	// declare local matrices
	//
	Matrix M1 = new Matrix();
	Matrix T1 = new Matrix();
	Matrix M2 = new Matrix();
	Matrix T2 = new Matrix();
	Matrix M3 = new Matrix();
	Matrix T3 = new Matrix();
	Matrix M4 = new Matrix();
	Matrix T4 = new Matrix();
	
	// declare the covariance object
	//
	Covariance cov = new Covariance();
		
	// declare the initial random variables
	//
	double transpose[][] = new double[2][1];
	double mean[][] = new double[1][2];
	
	// compute the propabilities of each data set
	//
	double maxsamples = set1_d.size() + set2_d.size() 

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成av人片一区二区| 日韩午夜av一区| 制服丝袜在线91| 久久精品一区八戒影视| 亚洲v精品v日韩v欧美v专区| 国产精品一区二区三区乱码| 欧美男生操女生| 亚洲另类在线制服丝袜| 国产成人免费9x9x人网站视频| 91久久国产综合久久| 国产亚洲va综合人人澡精品| 首页国产丝袜综合| 91亚洲午夜精品久久久久久| 2020日本不卡一区二区视频| 亚洲电影视频在线| 欧洲一区在线电影| 中文字幕在线观看一区| 国产精品一二三在| 欧美videofree性高清杂交| 午夜精品福利视频网站| 色88888久久久久久影院野外| 国产偷国产偷亚洲高清人白洁| 蜜桃精品在线观看| 欧美一区二区三区四区视频| 视频一区二区三区在线| 欧美色综合久久| 一区二区免费在线播放| 99麻豆久久久国产精品免费| 国产精品丝袜在线| 国产91丝袜在线播放0| wwww国产精品欧美| 国产综合色在线| 欧美精品一区二区三区蜜臀| 国内精品久久久久影院一蜜桃| 欧美一区二区成人6969| 免费在线看成人av| 日韩一区二区三区免费观看| 青青草国产精品97视觉盛宴| 日韩三级视频在线看| 男女性色大片免费观看一区二区| 欧美日韩黄色一区二区| 日韩av在线播放中文字幕| 欧美高清性hdvideosex| 秋霞成人午夜伦在线观看| 精品久久人人做人人爽| 另类调教123区 | 三级一区在线视频先锋| 欧美日精品一区视频| 亚洲一二三四久久| 欧美精品精品一区| 美洲天堂一区二卡三卡四卡视频| 欧美成人精品福利| 国产精品88av| 亚洲精品五月天| 欧美在线观看禁18| 喷白浆一区二区| 国产亚洲一本大道中文在线| 一本到高清视频免费精品| 亚洲高清视频的网址| 欧美一级高清大全免费观看| 国产精品一区二区久久精品爱涩| 国产精品每日更新在线播放网址| 欧美亚洲免费在线一区| 国模无码大尺度一区二区三区| 国产欧美日韩精品在线| 欧美日韩中字一区| 国产一区二区电影| 亚洲蜜臀av乱码久久精品 | 亚洲mv在线观看| 2022国产精品视频| 在线亚洲人成电影网站色www| 秋霞影院一区二区| 中文字幕在线不卡一区二区三区| 欧美视频中文一区二区三区在线观看 | 久久这里只精品最新地址| eeuss鲁一区二区三区| 日韩国产精品久久| 国产精品的网站| 欧美岛国在线观看| 欧美午夜电影网| 国产成人av一区二区三区在线观看| 亚洲精品伦理在线| 国产视频一区二区三区在线观看| 欧美喷水一区二区| 91亚洲男人天堂| 国产伦精品一区二区三区免费迷| 艳妇臀荡乳欲伦亚洲一区| 久久久欧美精品sm网站| 在线播放国产精品二区一二区四区| 成人性生交大合| 久久国产精品99久久人人澡| 亚洲一区二区三区免费视频| 国产精品视频看| 26uuu国产在线精品一区二区| 欧美三日本三级三级在线播放| 国产jizzjizz一区二区| 国产在线麻豆精品观看| 日韩高清一区二区| 亚洲国产一区二区视频| 樱花草国产18久久久久| 中文字幕日韩av资源站| 久久精品夜色噜噜亚洲aⅴ| 日韩欧美国产午夜精品| 欧美精品日韩综合在线| 欧美视频一区二区三区在线观看| 成人高清在线视频| 成人毛片在线观看| 成人av动漫在线| 成人精品一区二区三区四区| 国产成人午夜精品5599| 国产精品99久久久久久久vr | 一区二区在线看| 中文字幕在线观看不卡视频| 欧美国产欧美综合| 国产欧美一区二区在线观看| 国产情人综合久久777777| 久久久激情视频| 久久蜜桃av一区精品变态类天堂| 精品国产露脸精彩对白| 久久综合久色欧美综合狠狠| 精品久久一区二区三区| 久久久久久麻豆| 国产精品免费久久| 《视频一区视频二区| 亚洲日本成人在线观看| 樱花影视一区二区| 五月天国产精品| 老司机午夜精品| 国产一区二区三区免费| 成人动漫精品一区二区| 色婷婷亚洲一区二区三区| 欧美日韩精品一区二区三区| 欧美高清dvd| 久久久亚洲欧洲日产国码αv| 久久综合成人精品亚洲另类欧美| 欧美极品少妇xxxxⅹ高跟鞋| 亚洲欧洲成人精品av97| 亚洲第一二三四区| 久久精品国产在热久久| 国产69精品久久久久777| 日本久久电影网| 日韩一级片网址| 亚洲国产精品v| 一区二区三区精品在线观看| 日韩国产在线观看一区| 国产福利91精品一区| 色婷婷亚洲一区二区三区| 日韩一区二区三区视频| 国产精品久99| 日韩中文字幕亚洲一区二区va在线 | 成人性生交大合| 91高清在线观看| 精品久久免费看| 亚洲精品ww久久久久久p站| 午夜久久久久久| 成人免费福利片| 欧美一区二区三区日韩视频| 国产精品乱人伦| 日韩中文字幕不卡| 99视频精品在线| 欧美一区二区三区男人的天堂| 欧美激情在线免费观看| 偷窥少妇高潮呻吟av久久免费| 国产乱码精品1区2区3区| 欧美色图第一页| 亚洲国产精品v| 久久精品国产久精国产爱| 色婷婷av久久久久久久| 国产亚洲欧美一级| 蜜臀av性久久久久av蜜臀妖精 | 美女视频免费一区| 99re这里只有精品6| 久久这里只有精品6| 日韩成人一级大片| 91久久精品网| 日韩理论电影院| 国产精品白丝jk白祙喷水网站| 欧美日韩久久不卡| 亚洲精品一卡二卡| 成人综合婷婷国产精品久久蜜臀| 欧美一区二区三区思思人| 一区二区成人在线视频| 处破女av一区二区| 国产亚洲欧美中文| 韩国v欧美v日本v亚洲v| 日韩一二三区视频| 丝袜a∨在线一区二区三区不卡| 91麻豆免费看片| 国产精品盗摄一区二区三区| 国产黄人亚洲片| 国产亚洲视频系列| 国内精品久久久久影院色| 欧美一区二区三区在线看| 视频一区在线播放| 欧美区视频在线观看| 日韩精品高清不卡| 欧美大胆一级视频| 国产一区二区在线观看视频| 国产亚洲综合av| voyeur盗摄精品|