⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 example.htm

📁 this file is leverage algorithm written in matlab as m-file and tested in matlab.so anyone can ue th
💻 HTM
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Kohonen and CPANN toolbox</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<meta name="generator" content="HAPedit 3.0">

<link href = "style_structure.css" rel="stylesheet" type="text/css">
<link href = "style_text.css" rel="stylesheet" type="text/css">
<link href = "style_tables.css" rel="stylesheet" type="text/css">

<style type="text/css">
<!--
.style1 {
	color: #FF0000;
	font-weight: bold;
}
-->
</style>
</head>
<body>
<div id="container">
<a name="top"></a>

    <div id="header">
		<iframe src="header.htm" width="740" height="60" scrolling="no" frameborder="0">
  			no i_frames allowed :: change browser
	  	</iframe>
    </div>

    <div id="content">

		<table width="740" border="0" cellpadding="0" cellspacing="0">
  		<tr>
		<td width="150" valign="top">
		
		<iframe src="menu_lateral.htm" width="135" height="268" scrolling="no" frameborder="0">
  			no i_frames allowed :: change browser
	  	</iframe>
		
		</td>

    	<td valign="top">

		  <div align="justify">
		    <div id="tab_duo_contenitor" class="text">
		    <span class="title_page">Example</span>		
		    <BR>
		    <BR>
    
		<div id="tab_duo_text">
		      <div id="tab_space_lateral"><a href="#sub_1" class="lnk_text">Classification of IRIS dataset </a></div>
		      <div id="tab_space_lateral"><a href="#sub_2" class="lnk_text">Graphical results </a></div>
		      <div id="tab_space_lateral"><a href="#sub_3" class="lnk_text">Cross validating the model </a></div>
	   	</div>
    
		<BR><a name="sub_1"></a>
		    <BR>
		    
		<span class="title_paragraph">_ Classification of IRIS dataset</span>
		    <BR>
		    <BR>
		    IRIS dataset is a classical data set used by statisticians and chemometricians to check classification methods. It is composed by 150 samples of flowers divided into 3 classes (50 setosa, 50 versicolor, 50 virginica) and described by 4 variables (petal length, petal width, sepal length, sepal width). It has been published by Fisher in the following paper: 
			<BR><BR>
			Fisher RA. (<strong>1936</strong>) The use of multiple measurements in taxonomic problems. <em>Annals of Eugenics</em> <strong>7</strong> 179-188.
			<BR>
		    <BR>
			Type:<BR>
		    <BR>
			
			<div id="tab_duo_text" class="text_math">
		      load iris </div>
			<BR>

		    on the MATLAB command window to load the data. Then, we can build a defualt setting structure, define the number of epochs (50) and the size of the net (11) and have a look to the final setting structure:
			<BR>
		    <BR>
			
			<div id="tab_duo_text" class="text_math">
		      settings = som_settings('cpann'); <BR>
			  settings.epochs = 50;<BR>
			  settings.nsize = 11;<BR>
			  settings
			</div>
			<BR>

		    After that, we can run the classification model based on CPANNs by typing:
			<BR>
		    <BR>
			
			<div id="tab_duo_text" class="text_math">
		      model = model_cpann(X,class,settings);
			</div>
			<BR>
			
		    At the end of the calculation, we will have a structure (model) that contains all the classification results.
			We can evaluate the quality of the classification model by looking at the classification indices (non-error rate, error rate, etc..):
			<BR>
		    <BR>
			
			<div id="tab_duo_text" class="text_math">
		      model.res.class_param
			</div>
			<BR>  
			We'll get something like this in the MATLAB command window (<span class="style1">PAY ATTENTION</span>: since CPANNs are randomly initialised, each model you build will be different, even if repeated): 
			<BR>
		    <BR>
			
			<div id="tab_duo_text" class="text_math">
			ans = <BR><BR>

       		conf_mat: [3x4 double]<BR>
            ner: 0.9867<BR>
            er: 0.0133<BR>
        	not_ass: 0<BR>
      		precision: [1&nbsp;&nbsp;&nbsp;&nbsp; 0.9800&nbsp;&nbsp;&nbsp;&nbsp; 0.9800]<BR>
    		sensitivity: [1&nbsp;&nbsp;&nbsp;&nbsp; 0.9800&nbsp;&nbsp;&nbsp;&nbsp; 0.9800]<BR>
    		specificity: [1&nbsp;&nbsp;&nbsp;&nbsp; 0.9900&nbsp;&nbsp;&nbsp;&nbsp; 0.9900]<BR>
			</div>
					<BR>
		    This means that the error rate of our model (percentage of wrong assignations) is equal to 1.3%; considering precision, specificity and sensitivity, class 1 results prefectly separated, while class 2 and class 3 overlaps a little bit. This is confirmed by the confusion matrix:
			<BR><BR>
			<div id="tab_duo_text" class="text_math">
			model.res.class_param.conf_mat<BR><BR>

			ans =<BR><BR>

   			 50&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;     0&nbsp;&nbsp;&nbsp;&nbsp;     0<BR>
    			 0&nbsp;&nbsp;&nbsp;&nbsp;    49&nbsp;&nbsp;&nbsp;&nbsp;     1&nbsp;&nbsp;&nbsp;&nbsp;     0<BR>
     			0&nbsp;&nbsp;&nbsp;&nbsp;     1&nbsp;&nbsp;&nbsp;&nbsp;    49&nbsp;&nbsp;&nbsp;&nbsp;     0<BR>
			</div>

		    <BR>
			We can also analyse the top map position of the samples and the map weights on the MATLAB command window, but it would be better to do that by using the GUI interface (see next paragraph).
		    <BR>
		    <BR>
			[<a href="#top" class="lnk_text">-> top</a>]
		    <BR>
		    <BR> <a name="sub_2"></a>
		    <BR>
		    
		<span class="title_paragraph">_ Graphical results</span>
		    <BR>
		    <BR>
		    Open the GUI interface by typing:
			<BR>
		    <BR>
			
			<div id="tab_duo_text" class="text_math">
		      visualize_model(model)
			</div>
			<BR>
			Then, we can inspect the results. For example, we can plot the class labels and the weights of the third variable (by selectin 'class labels' in the Display labels combo, 'variable 3' in the Display weights combo and then pressing the update button) and verify that this variable has low values in the samples of the first class:
		    <BR>
		    <BR>
			<center>
			<img src="example_visualize_1.gif" width="550" height="450">
			</center>
		    <BR>
			After that, we can have a look to the output weights of class 1 (of course, neurons where samples of class 1 are placed will have high weights).
		    <BR>
		    <BR>
			<center>
			<img src="example_visualize_2.gif" width="550" height="450">
			</center>
		    <BR>
			Again, we can look at the assignation of each neuron (i.e. each neuron will be coloured on the basis of the assigned class).<BR>
		    <BR>
			<center>
			<img src="example_visualize_3.gif" width="550" height="450">
			</center>	    
				<BR>
			Finally, we can look at the weights of a specific neuron and at the labels of the samples placed in that neuron by using the 'get neuron weights' and 'get neuron labels' buttons:
		    <BR><BR>
			<center>
			<img src="example_visualize_4.gif" width="550" height="488">
			</center>	    
		    <BR>
			<center>
			<img src="example_visualize_5.gif" width="234" height="302">
			</center>	    
			<BR>
		    <BR>
			[<a href="#top" class="lnk_text">-> top</a>]		    
    		    <BR>
		    <BR><a name="sub_3"></a>
		    <BR>
		    
		<span class="title_paragraph">_ Cross validating the model</span>
		    <BR>
		    <BR>
		    Finally, in order to validate the model, we can use 3 cross validation groups by typing:
			<BR>
		    <BR>
			
			<div id="tab_duo_text" class="text_math">
		      cv =  cv_cpann(X,class,3);
			</div>
			<BR>
			At the end of the calculation, we can look at the results by typing cv.class_param:
			<BR>
		    <BR>
			
			<div id="tab_duo_text" class="text_math">
		      cv.class_param<BR><BR>
				ans:<BR><BR>
       conf_mat: [3x4 double]<BR>
            ner: 0.9400<BR>
             er: 0.0600<BR>
        not_ass: 0<BR>
      precision: [1 0.9020 0.9184]<BR>
    sensitivity: [1 0.9200 0.9000]<BR>
    specificity: [1 0.9500 0.9600]
			</div>
		    <BR>
		    <BR>
			[<a href="#top" class="lnk_text">-> top</a>]
			<BR>
			<BR>
			<BR>&nbsp;  	     
		 </div>
  
		  </div></td>
  		</tr>
	  </table>

    </div>

    <div id="footer">
		<iframe src="footer.htm" width="700" height="13" scrolling="no" frameborder="0">
  			no i_frames allowed :: change browser
	  	</iframe>
	</div>
</div>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -