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

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

?? algorithmlda.java,v

?? 完整的模式識別庫
?? JAVA,V
?? 第 1 頁 / 共 4 頁
字號:
head	1.7;access;symbols;locks; strict;comment	@# @;1.7date	2005.06.10.16.48.53;	author rirwin;	state Exp;branches;next	1.6;1.6date	2005.05.23.18.39.36;	author rirwin;	state Exp;branches;next	1.5;1.5date	2005.04.18.20.17.35;	author patil;	state Exp;branches;next	1.4;1.4date	2005.03.16.19.00.57;	author patil;	state Exp;branches;next	1.3;1.3date	2005.03.08.01.45.30;	author patil;	state Exp;branches;next	1.2;1.2date	2005.01.20.02.41.42;	author patil;	state Exp;branches;next	1.1;1.1date	2004.12.28.00.04.32;	author patil;	state Exp;branches;next	;desc@No changes made.@1.7log@establishing version in rcs.@text@//--------------------------------------------------------------------------
// AlgorithmLDA.java 6.0 03/15/2005
// Created       : Phil Trasatti     Edited : Daniel May
//                                   Edited : Sanjay Patil
//                              Last Edited : Ryan Irwin
//
// Description   : Describes the LDA algorithm
// Remarks       : Code unchanged since created. Created 07/15/2003
//--------------------------------------------------------------------------


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

/**
 * Implements the Linear Discriminant Analysis Algorithm
 */
public class AlgorithmLDA 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 CLDA1
    //
    Matrix W;
    Matrix LDA;
    Matrix CLDA; 
    Matrix B;
    Matrix S;
    Matrix invW;
    
   /**
    * 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 = "AlgorithmLDA";
	
	// Debug 
	//
	// System.out.println(algo_id + " initialize()");

	step_count = 3;
	point_means_d      = new Vector<MyPoint>();
	decision_regions_d = new Vector<MyPoint>();
	support_vectors_d  = new Vector<MyPoint>();
	description_d      = new Vector<String>();
	
	// Initialize local Matrix objects
	//
	W    = new Matrix();
	LDA  = new Matrix();
	CLDA = new Matrix();
	B    = new Matrix();
	S    = new Matrix();
	invW = new Matrix();
	
	// 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.");
	    description_d.addElement(str);
	    
	    str = new String("   3. Computing the decision regions based on the class independent LDA 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<MyPoint>)data_points_d.dset1.clone();
	//	set2_d = (Vector)data_points_d.dset2.clone();
	//	set3_d = data_points_d.dset3.clone();
	//	set4_d = 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;
    }

    /**
    * 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;
    }
    
    /**
     * Computes the decision regions and totals the data points in error,
     * as well displays the decision region
     *
     * @@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);
	
	// compute the decision regions
	//
	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();
	
	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() 
	                  + 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)
	{	    

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品美女一区二区| 色香色香欲天天天影视综合网| 欧美蜜桃一区二区三区| 亚洲自拍另类综合| 在线一区二区三区四区五区 | 午夜精品久久久久久久久| 在线观看日韩国产| 日韩国产精品大片| 26uuu国产电影一区二区| 国产成人av影院| 亚洲精选在线视频| 欧美一区二区三区精品| 国产一区二区看久久| 国产精品久久久久久亚洲毛片| 91麻豆国产香蕉久久精品| 午夜激情久久久| 欧美国产精品劲爆| 欧美中文字幕久久| 六月婷婷色综合| 国产精品福利影院| 91久久精品日日躁夜夜躁欧美| 午夜欧美在线一二页| 久久精品日产第一区二区三区高清版| 国产盗摄一区二区| 亚洲成人激情自拍| 国产亚洲人成网站| 欧美挠脚心视频网站| 成人禁用看黄a在线| 日韩av高清在线观看| 国产精品成人网| 欧美一级二级三级蜜桃| 白白色亚洲国产精品| 日韩一区精品字幕| 亚洲视频一区在线观看| 精品免费国产一区二区三区四区| 色综合久久久久综合| 国产乱码精品1区2区3区| 亚洲va欧美va天堂v国产综合| 精品国产乱码久久久久久图片| 91久久人澡人人添人人爽欧美| 韩国欧美一区二区| 日韩精品久久理论片| 中文字幕亚洲在| 久久婷婷久久一区二区三区| 欧美视频三区在线播放| 97久久精品人人澡人人爽| 国产精品中文字幕日韩精品| 三级久久三级久久| 夜色激情一区二区| 国产精品女同一区二区三区| 精品国产免费一区二区三区四区| 欧美色网站导航| 91片在线免费观看| 成人性色生活片免费看爆迷你毛片| 视频一区中文字幕| 亚洲香蕉伊在人在线观| 自拍偷拍亚洲欧美日韩| 欧美国产精品中文字幕| 337p日本欧洲亚洲大胆色噜噜| 在线播放日韩导航| 欧美日韩中文字幕精品| 91成人免费在线| 色94色欧美sute亚洲线路二| caoporn国产精品| 高清在线成人网| 国产精品99久久久久久久女警| 黄网站免费久久| 另类小说综合欧美亚洲| 麻豆免费精品视频| 日本成人在线看| 蜜桃av一区二区| 日本亚洲天堂网| 久久激情综合网| 免费高清视频精品| 激情综合网最新| 国产一区二区三区电影在线观看| 蜜乳av一区二区| 国内精品在线播放| 国产精品一区二区男女羞羞无遮挡 | 在线一区二区三区四区五区 | 免费成人性网站| 日韩国产欧美三级| 毛片不卡一区二区| 精品影院一区二区久久久| 狠狠v欧美v日韩v亚洲ⅴ| 国产一区二区三区黄视频| 风间由美一区二区av101| 成人一区二区三区视频| av成人老司机| 在线精品亚洲一区二区不卡| 欧美色图免费看| 日韩区在线观看| 久久精品人人做人人爽人人| 国产精品电影一区二区| 亚洲影视在线播放| 蜜桃视频在线观看一区二区| 久久99久久99小草精品免视看| 国产精品综合久久| 99vv1com这只有精品| 在线电影国产精品| 国产日韩欧美精品一区| 亚洲美女偷拍久久| 日本大胆欧美人术艺术动态| 国产风韵犹存在线视精品| 日本黄色一区二区| 欧美大片一区二区三区| 中文av字幕一区| 婷婷丁香久久五月婷婷| 国产精品小仙女| 欧美在线免费观看视频| 日韩小视频在线观看专区| 久久精品视频一区| 亚洲成va人在线观看| 国产美女av一区二区三区| 色综合久久久久综合体| 精品女同一区二区| 亚洲一区二区三区四区在线免费观看| 免费看日韩精品| 色猫猫国产区一区二在线视频| 日韩欧美国产不卡| 亚洲欧美另类小说视频| 九九精品视频在线看| 日本精品一区二区三区高清 | www.一区二区| 欧美一区二区视频在线观看| 国产精品电影一区二区三区| 久久国产剧场电影| 日本二三区不卡| 欧美精品一区二区三区高清aⅴ | 亚洲日本va午夜在线电影| 日本亚洲视频在线| 在线观看亚洲精品视频| 国产亚洲欧洲一区高清在线观看| 亚洲地区一二三色| 波多野结衣在线aⅴ中文字幕不卡| 欧美一区二区三区视频在线观看| 亚洲欧美日韩电影| 国产宾馆实践打屁股91| 日韩美女主播在线视频一区二区三区| 亚洲欧美一区二区不卡| 国产91露脸合集magnet| 日韩午夜在线影院| 午夜av区久久| 欧美伊人久久久久久午夜久久久久| 国产日产欧美一区| 极品少妇xxxx偷拍精品少妇| 欧美精品1区2区3区| 一区二区三区四区在线| a4yy欧美一区二区三区| 国产女同互慰高潮91漫画| 久久99国产精品免费网站| 欧美精品vⅰdeose4hd| 亚洲成av人片在www色猫咪| 在线免费不卡视频| 伊人色综合久久天天人手人婷| 成人精品电影在线观看| 国产精品三级久久久久三级| 激情综合网av| 欧美精品三级在线观看| 亚洲成a人片在线不卡一二三区| 91成人免费在线视频| 一级特黄大欧美久久久| 色婷婷综合久色| 亚洲一二三区不卡| 欧美色图第一页| 婷婷激情综合网| 日韩三级.com| 国内精品国产成人国产三级粉色 | 色婷婷精品大视频在线蜜桃视频| 中文字幕成人在线观看| 成人综合婷婷国产精品久久| 欧美极品少妇xxxxⅹ高跟鞋| 高清国产一区二区三区| 国产精品日产欧美久久久久| 成人av片在线观看| 亚洲同性gay激情无套| 91黄色激情网站| 亚洲第一搞黄网站| 日韩色视频在线观看| 国产一区日韩二区欧美三区| 欧美极品aⅴ影院| 91麻豆视频网站| 亚洲成a人片在线观看中文| 欧美一区二区视频在线观看| 国产做a爰片久久毛片| 国产精品美女视频| 欧美三区在线观看| 玖玖九九国产精品| 国产日本欧美一区二区| 色www精品视频在线观看| 亚洲国产精品一区二区www| 91精品国产aⅴ一区二区| 国产综合一区二区| 亚洲品质自拍视频网站| 91精品国产综合久久蜜臀| 亚洲国产综合色| 欧美sm美女调教| 色诱亚洲精品久久久久久| 日韩高清电影一区| 国产精品毛片无遮挡高清|