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

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

?? algorithmldapca.java

?? 完整的模式識別庫
?? JAVA
?? 第 1 頁 / 共 3 頁
字號:
	                  + set3_d.size() + set4_d.size();
	
	double pr1 = set1_d.size() / maxsamples;
	double pr2 = set2_d.size() / maxsamples;
	double pr3 = set3_d.size() / maxsamples;
	double pr4 = set4_d.size() / maxsamples;
	
	DisplayScale scale = output_panel_d.disp_area_d.getDisplayScale();

	// initialize the between class matrix
	//
	M.row = M.col = 2;
	M.Elem = new double[2][2];
	M.resetMatrix();
	
	int j = 0;

	// obtain the means of each individual class
	//
	if (set1_d.size() > 0)
	{	    
	    MyPoint p = (MyPoint)point_means_d.elementAt(j);
	    j++;
	    xmean1 = p.x;
	    ymean1 = p.y;    
	}
	
	if (set2_d.size() > 0)
	{
	    MyPoint p = (MyPoint)point_means_d.elementAt(j);
	    j++;
	    xmean2 = p.x;
	    ymean2 = p.y;    
	}
	
	if (set3_d.size() > 0)
	{
	    MyPoint p = (MyPoint)point_means_d.elementAt(j);
	    j++;
	    xmean3 = p.x;
	    ymean3 = p.y;    
	}

	if (set4_d.size() > 0)
	{
	    MyPoint p = (MyPoint)point_means_d.elementAt(j);
	    j++;
	    xmean4 = p.x;
	    ymean4 = p.y;    
	}
	
	// compute the global mean of all data sets
	//
	int samples = 0;
	
	for (int i = 0; i < set1_d.size(); samples++, i++)
	{
	    MyPoint p2 = (MyPoint)set1_d.elementAt(i);
	    xmean += p2.x;
	    ymean += p2.y;
	}
	
	for (int i = 0; i < set2_d.size(); samples++, i++)
	{
	    MyPoint p2 = (MyPoint)set2_d.elementAt(i);
	    xmean += p2.x;
	    ymean += p2.y;
	}

	for (int i = 0; i < set3_d.size(); samples++, i++)
	{
	    MyPoint p2 = (MyPoint)set3_d.elementAt(i);
	    xmean += p2.x;
	    ymean += p2.y;
	}
	
	for (int i = 0; i < set4_d.size(); samples++, i++)
	{
	    MyPoint p2 = (MyPoint)set4_d.elementAt(i);
	    xmean += p2.x;
	    ymean += p2.y;
	}

	xmean /= samples;
	ymean /= samples;
	
	// compute the between class scatter contribution of the first set
	//
	if (set1_d.size() > 0)
	{
	    Matrix S = new Matrix();
	    
	    mean[0][0] = xmean1 - xmean;
	    mean[0][1] = ymean1 - ymean;
	    M1.initMatrix(mean, 1, 2);
	    
	    transpose[0][0] = xmean1 - xmean;
	    transpose[1][0] = ymean1 - ymean;
	    T1.initMatrix(transpose, 2, 1);
	    
	    T1.multMatrix(M1, S);
	    M.addMatrix(S);
	}
	
	// compute the between class scatter contribution of the second set
	//
	if (set2_d.size() > 0)
	{
	    
	    Matrix S = new Matrix();
	    
	    mean[0][0] = xmean2 - xmean;
	    mean[0][1] = ymean2 - ymean;
	    M2.initMatrix(mean, 1, 2);
	    
	    transpose[0][0] = xmean2 - xmean;
	    transpose[1][0] = ymean2 - ymean;
	    T2.initMatrix(transpose, 2, 1);
	    
	    T2.multMatrix(M2, S);
	    M.addMatrix(S);
	}
	
	// compute the between class scatter contribution of the third set
	//
	if (set3_d.size() > 0)
	{
	    
	    Matrix S = new Matrix();
	    
	    mean[0][0] = xmean3 - xmean;
	    mean[0][1] = ymean3 - ymean;
	    M3.initMatrix(mean, 1, 2);
	    
	    transpose[0][0] = xmean3 - xmean;
	    transpose[1][0] = ymean3 - ymean;
	    T3.initMatrix(transpose, 2, 1);
	    
	    T3.multMatrix(M3, S);
	    M.addMatrix(S);
	}
	
	// compute the between class scatter contribution of the forth set
	//
	if (set4_d.size() > 0)
	{
	    
	    Matrix S = new Matrix();
	    
	    mean[0][0] = xmean4 - xmean;
	    mean[0][1] = ymean4 - ymean;
	    M4.initMatrix(mean, 1, 2);
	    
	    transpose[0][0] = xmean4 - xmean;
	    transpose[1][0] = ymean4 - ymean;
	    T4.initMatrix(transpose, 2, 1);
	    
	    T4.multMatrix(M4, S);
	    M.addMatrix(S);
	}
    }

    /**
     * Display two matrices - covariance matrix and the transformation
     * matrix in the text message window
     */
    public void displayMatrices()
    {
	
	// declare local variables
	//
	double a11 = 0.0;
	double a12 = 0.0;
	double a21 = 0.0;
	double a22 = 0.0;
	
	String text;
	
	a11 = MathUtil.setDecimal(CLDA.Elem[0][0], 2);
	a12 = MathUtil.setDecimal(CLDA.Elem[0][1], 2);
	a21 = MathUtil.setDecimal(CLDA.Elem[1][0], 2);
	a22 = MathUtil.setDecimal(CLDA.Elem[1][1], 2);
	
	text =
	    new String(
		       "      Covariance matrix:\n"
		       + "         "
		       + a11
		       + "    "
		       + a12
		       + "\n"
		       + "         "
		       + a21
		       + "    "
		       + a22);
	
	// append message to process box
	//
	pro_box_d.appendMessage(text);
	
	a11 = MathUtil.setDecimal(LDA.Elem[0][0], 2);
	a12 = MathUtil.setDecimal(LDA.Elem[0][1], 2);
	a21 = MathUtil.setDecimal(LDA.Elem[1][0], 2);
	a22 = MathUtil.setDecimal(LDA.Elem[1][1], 2);
	
	text =
	    new String(
		       "      Transformation matrix:\n"
		       + "         "
		       + a11
		       + "    "
		       + a12
		       + "\n"
		       + "         "
		       + a21
		       + "    "
		       + a22);
	
	// append message to process box
	//
	pro_box_d.appendMessage(text);
	
    }

    /**
     * Displays the caovariance and LDA transform data matrix
     */
    public void printMatrices()
    {
	double a11, a12, a21, a22;
	String text;

	a11 = MathUtil.setDecimal(cov_matrix_d.Elem[0][0], 2);
	a12 = MathUtil.setDecimal(cov_matrix_d.Elem[0][1], 2);
	a21 = MathUtil.setDecimal(cov_matrix_d.Elem[1][0], 2);
	a22 = MathUtil.setDecimal(cov_matrix_d.Elem[1][1], 2);
	
	text = new String("      Covariance matrix:\n" +
			  "         " + a11 + "    " + a12 + "\n" +
			  "         " + a21 + "    " + a22);
	
	pro_box_d.appendMessage(text + "\n");
	
	a11 = MathUtil.setDecimal(trans_matrix_d.Elem[0][0], 2);
	a12 = MathUtil.setDecimal(trans_matrix_d.Elem[0][1], 2);
	a21 = MathUtil.setDecimal(trans_matrix_d.Elem[1][0], 2);
	a22 = MathUtil.setDecimal(trans_matrix_d.Elem[1][1], 2);
	
	text = new String("      Transformation matrix:\n" +
			  "         " + a11 + "    " + a12 + "\n" +
			  "         " + a21 + "    " + a22);
	
	pro_box_d.appendMessage(text + "\n");

    }

    /**
     * Transforms a given set of points to a new space
     * using the class independent principal component analysis algorithm
     */
    public void transformPCA()
    {
	// Debug
	//System.out.println(algo_id + ": transformPCA()");
	
	// declare local variables
	//
	int size = 0;
	int xsize = 0;
	int ysize = 0;
	
	// declare variables to compute the global mean
	//
	double xval = 0.0;
	double yval = 0.0;
	double xmean = 0.0;
	double ymean = 0.0;
		
	// declare the covariance object
	//
	Covariance cov = new Covariance();

	// declare the covariance matrix
	//
	Matrix covariance = new Matrix();
	covariance.row = covariance.col = 2;
	covariance.Elem = new double[2][2];

	// declare arrays for the eigenvalues
	//
	double eigVal[] = null;

	// declare an array to store the eigen vectors
	//
	double eigVec[] = new double[2];

	// declare matrix objects
	//
	Matrix T = new Matrix();
	Matrix M = new Matrix();
	Matrix W = new Matrix();

	// allocate memory for the matrix elements
	//
	T.Elem = new double[2][2];
	M.Elem = new double[2][2];
	W.Elem = new double[2][2];

	// declare arrays to store the samples
	//
	double x[] = null;
	double y[] = null;

	// declare the maximum size of all data sets together
	//
	int maxsize = set1_d.size() + set2_d.size() 
	            + set3_d.size() + set4_d.size();

	// initialize arrays to store the samples
	//
	x = new double[maxsize];
	y = new double[maxsize];

	// get the samples from the first data set
	//
	size = set1_d.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);
	    xval += p.x;
	    yval += p.y;
	    x[xsize++] = p.x;
	    y[ysize++] = p.y;
	}
	
	// get the samples from the second data set
	//
	size = set2_d.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);
	    xval += p.x;
	    yval += p.y;
	    x[xsize++] = p.x;
	    y[ysize++] = p.y;
	}
	
	// get the samples from the third data set
	//
	size = set3_d.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);
	    xval += p.x;
	    yval += p.y;
	    x[xsize++] = p.x;
	    y[ysize++] = p.y;
	}
	
	// get the samples from the first data set
	//
	size = set4_d.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);
	    xval += p.x;
	    yval += p.y;
	    x[xsize++] = p.x;
	    y[ysize++] = p.y;
	}
	
	if (maxsize > 0)
	{

	    // initialize the transformation matrix dimensions
	    //
	    W.row = 2;
	    W.col = 2;

	    // reset the matrices
	    //
	    W.resetMatrix();

	    // compute the covariance matrix of the first data set
	    //
	    covariance.Elem = cov.computeCovariance(x, y);
	    cov_matrix_d = covariance;

	    // initialize the matrix needed to compute the eigenvalues
	    //
	    T.initMatrix(covariance.Elem, 2, 2);

	    // make a copy of the original matrix
	    //
	    M.copyMatrix(T);

	    // compute the eigen values
	    eigVal = Eigen.compEigenVal(T);

	    // compute the eigen vectors
	    //
	    for (int i = 0; i < 2; i++)
	    {
		Eigen.calcEigVec(M, eigVal[i], eigVec);
		for (int j = 0; j < 2; j++)
		{
		    W.Elem[j][i] = eigVec[j] / Math.sqrt(eigVal[i]);
		}
	    }
	    
	    // save the transformation matrix 
	    //
	    trans_matrix_d = W;
	}

	// compute the global mean of the data sets
	//
	xmean = xval / xsize;
	ymean = yval / ysize;

	// determine points for the support regions
	//
	double val[][] = new double[2][1];

	Matrix invT = new Matrix();
	Matrix supp = new Matrix();
	Matrix temp = new Matrix();

	// set up the angle with which to rotate the axis
	//
	double theta = 0.0;
	double alpha = cov_matrix_d.Elem[0][0] - cov_matrix_d.Elem[1][1];
	double beta = -2 * cov_matrix_d.Elem[0][1];

	if (eigVal[0] > eigVal[1])
	{
	    theta = Math.atan2((alpha - Math.sqrt((alpha * alpha) 
						  + (beta * beta))), beta);
	}
	else
	{
	    theta = Math.atan2((alpha + Math.sqrt((alpha * alpha) 
						  + (beta * beta))), beta);
	}

	// compute the inverse of the transformation matrix
	//
	trans_matrix_d.invertMatrix(invT);

	// loop through all points on the circumference of the 
	// gaussian sphere in the transformed space
	//
	for (int i = 0; i < 360; i++)
	{

	    // get the x and y co-ordinates
	    //
	    val[0][0] = 1.5 * Math.cos(i);
	    val[1][0] = 1.5 * Math.sin(i);

	    // set up the points as a matrix in order for multiplication
	    //
	    temp.initMatrix(val, 2, 1);

	    // transform the points from the feature space back to the
	    // original space to create the support region for the data set
	    //
	    invT.multMatrix(temp, supp);

	    // rotate the points after transforming them to the new space
	    //
	    xval = (supp.Elem[0][0] * Math.cos(theta)) 
		 - (supp.Elem[1][0] * Math.sin(theta));
	    yval = (supp.Elem[0][0] * Math.sin(theta)) 
		 + (supp.Elem[1][0] * Math.cos(theta));

	    // time shift the co-ordinates to the global mean
	    //
	    xval = xval + xmean;
	    yval = yval + ymean;

	    // add the point to the support region vector
	    //
	    MyPoint pt = new MyPoint(xval, yval);
	    support_vectors_d.addElement(pt);
	}
    }
    
    /** Transforms a given set of points to a new space
     * using the class independent linear discrimination analysis algorithm
     *
     * @param  d DataPoints to be transformed
     * @param  S transformed matrix    
     */
    public void transformLDA(DataPoints d, Matrix S)
    {
	// Debug
	// System.out.println(algo_id + " transformLDA(Data d, Matrix S)");
	
	// declare arrays for the eigenvalues
	//
	double eigVal[] = null;
	
	// declare an array to store the eigen vectors
	//
	double eigVec[] = new double[2];
	
	// declare matrix objects
	//
	Matrix T = new Matrix();
	Matrix M = new Matrix();
	Matrix W = new Matrix();
	
	// allocate memory for the matrix elements
	//
	T.Elem = new double[2][2];
	M.Elem = new double[2][2];
	W.Elem = new double[2][2];
	
	// initialize the transformation matrix dimensions
	//
	W.row = 2;
	W.col = 2;
	
	// reset the matrices
	//
	W.resetMatrix();
	
	// initialize the matrix needed to compute the eigenvalues
	//
	T.initMatrix(S.Elem, 2, 2);
	
	// make a copy of the original matrix
	//
	M.copyMatrix(T);
	
	// compute the eigen values
	//
	eigVal = Eigen.compEigenVal(T);
	
	// compute the eigen vectors
	//
	for (int i = 0; i < 2; i++)
	{
	    Eigen.calcEigVec(M, eigVal[i], eigVec);
	    for (int j = 0; j < 2; j++)
	    {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
不卡视频在线看| 国产色一区二区| 国产色综合一区| 亚洲成人资源网| 成人美女视频在线看| 欧美日韩精品一区二区| 国产欧美日韩另类视频免费观看| 婷婷中文字幕综合| 在线亚洲免费视频| 1000精品久久久久久久久| 精品无码三级在线观看视频| 欧美久久一区二区| 亚洲乱码中文字幕| 99综合影院在线| 精品处破学生在线二十三| 亚洲第一在线综合网站| 欧美日韩激情在线| 亚洲美女免费视频| 高潮精品一区videoshd| 精品国产一区a| 激情五月婷婷综合网| 精品日韩99亚洲| 久久疯狂做爰流白浆xx| 91精品婷婷国产综合久久竹菊| 亚洲欧美视频一区| 色综合一区二区| 亚洲精品视频在线| 色综合久久综合| 亚洲精品国产成人久久av盗摄| 丁香一区二区三区| 欧美激情一区三区| fc2成人免费人成在线观看播放| 中文字幕av在线一区二区三区| 国产精品香蕉一区二区三区| 久久久精品免费免费| 国产福利精品导航| 国产精品国产自产拍高清av| 99精品视频在线播放观看| 亚洲欧美另类综合偷拍| 日本久久精品电影| 午夜a成v人精品| 日韩三区在线观看| 国产乱码精品一区二区三区忘忧草 | 亚洲综合精品自拍| 欧美无人高清视频在线观看| 亚洲一区二区在线播放相泽| 91精品国产综合久久国产大片| 美女一区二区三区在线观看| 久久久噜噜噜久久人人看| 岛国精品在线观看| 亚洲乱码国产乱码精品精的特点| 色88888久久久久久影院按摩| 亚洲国产精品欧美一二99| 777久久久精品| 国产一区二区剧情av在线| 欧美—级在线免费片| 91电影在线观看| 蜜臀99久久精品久久久久久软件| 久久精品一二三| 一本色道**综合亚洲精品蜜桃冫| 日韩av电影免费观看高清完整版在线观看| 欧美一卡二卡在线| 国产91在线|亚洲| 亚洲妇熟xx妇色黄| 欧美激情在线免费观看| 欧美视频自拍偷拍| 国产91在线观看丝袜| 亚洲国产精品一区二区久久恐怖片| 欧美mv和日韩mv的网站| 一本一本久久a久久精品综合麻豆 一本一道波多野结衣一区二区 | 亚洲天堂2014| 欧美一级免费大片| 99久久久精品| 国产精品综合网| 性做久久久久久免费观看欧美| 久久久久国产精品人| 欧美性受xxxx| 高清国产一区二区三区| 日韩一区精品字幕| 亚洲精品老司机| 久久综合狠狠综合| 欧美日韩精品免费| 色婷婷亚洲综合| 国产成人精品www牛牛影视| 青青草成人在线观看| 亚洲在线观看免费视频| 国产欧美一区视频| 日韩手机在线导航| 欧美人牲a欧美精品| 91福利视频久久久久| 成人激情免费电影网址| 久久99国产精品久久99| 日韩高清在线一区| 一区二区三区美女| 日韩一区在线播放| 国产精品乱人伦| 久久久国产精品不卡| 日韩女优av电影在线观看| 欧美日韩在线不卡| 欧美综合在线视频| 91美女片黄在线观看91美女| 成人av动漫在线| 国产91清纯白嫩初高中在线观看| 麻豆一区二区在线| 蜜臀久久99精品久久久画质超高清| 午夜成人在线视频| 香蕉久久夜色精品国产使用方法| 亚洲激情中文1区| 亚洲三级小视频| 亚洲人妖av一区二区| 最新国产の精品合集bt伙计| 中文字幕av一区二区三区高 | 精品播放一区二区| 久久久久久亚洲综合| 久久久综合激的五月天| 久久免费电影网| 国产女人水真多18毛片18精品视频| 久久女同互慰一区二区三区| 精品国产网站在线观看| 久久综合成人精品亚洲另类欧美 | 国产91丝袜在线播放0| 成人小视频免费观看| 成人激情小说网站| 在线观看亚洲一区| 欧美精品一级二级| 欧美一二三区在线观看| 精品日韩一区二区三区| 久久精品亚洲乱码伦伦中文 | 久久久不卡网国产精品一区| 久久精品人人爽人人爽| 国产精品二三区| 亚洲一级二级三级在线免费观看| 午夜日韩在线观看| 国产在线不卡一卡二卡三卡四卡| 懂色av一区二区三区蜜臀| 91免费视频网| 日韩一区二区视频| 亚洲国产精品av| 一区二区三区四区激情| 日韩不卡在线观看日韩不卡视频| 激情偷乱视频一区二区三区| 成人国产一区二区三区精品| 欧美性大战xxxxx久久久| 日韩手机在线导航| 最新国产成人在线观看| 秋霞国产午夜精品免费视频| 成人av资源下载| 欧美精品一级二级| 国产精品家庭影院| 日本在线不卡视频| 成人app网站| 91精品国产美女浴室洗澡无遮挡| 国产午夜精品一区二区三区嫩草| 亚洲自拍偷拍网站| 国产一区欧美日韩| 欧美日韩在线播| 国产精品久久免费看| 奇米精品一区二区三区在线观看 | 久久久久久久久岛国免费| 亚洲欧美日韩国产成人精品影院 | 日本91福利区| 91麻豆.com| 久久精品在线免费观看| 午夜精品福利一区二区蜜股av| voyeur盗摄精品| 精品欧美一区二区久久| 亚洲一区二区三区四区不卡| 国产精品正在播放| 日韩免费性生活视频播放| 亚洲网友自拍偷拍| 99久久精品国产麻豆演员表| 欧美精品一区二区三区久久久| 亚洲一本大道在线| 91丨九色丨尤物| 亚洲国产精品成人综合| 久久疯狂做爰流白浆xx| 91精品国产色综合久久不卡蜜臀 | 综合色天天鬼久久鬼色| 国产一区二区女| 精品欧美一区二区三区精品久久| 亚洲福中文字幕伊人影院| 色香蕉成人二区免费| 国产精品伦理在线| 国产精品一区二区视频| 日韩三级电影网址| 日韩高清不卡一区二区| 欧美日韩亚洲综合一区二区三区| 成人免费在线观看入口| 成人黄色片在线观看| 国产日产欧美一区二区三区| 黄页视频在线91| 日韩精品一区二区三区视频播放| 日本不卡视频一二三区| 欧美一区二区免费视频| 首页国产丝袜综合| 91精品国产一区二区| 久久国产精品无码网站| 精品女同一区二区| 国产91在线看| 亚洲欧洲色图综合|