📄 kohonen.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">
</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">Kohonen maps</span>
<BR>
<BR>
<div id="tab_duo_text">
<div id="tab_space_lateral"><a href="#sub_1" class="lnk_text">Starting the model</a></div>
<div id="tab_space_lateral"><a href="#sub_2" class="lnk_text">How to read the results</a></div>
<div id="tab_space_lateral"><a href="#sub_3" class="lnk_text">How to plot the results</a></div>
<div id="tab_space_lateral"><a href="#sub_4" class="lnk_text">Prediction of new samples</a></div>
</div>
<BR><a name="sub_1"></a>
<BR>
<span class="title_paragraph">_ Starting the model</span>
<BR>
<BR>
Once <a href="start.htm#sub_1" class="lnk_text">data</a> have been prepeared and <a href="start.htm#sub_2" class="lnk_text">settings</a> have been defined, you can build a model based on Kohonen Maps by typing the following code in the MATLAB command window:
<BR>
<BR>
<div id="tab_duo_text" class="text_math">
model = model_kohonen(X,settings);
</div>
<BR>
where X is the <a href="start.htm#sub_1" class="lnk_text">data matrix</a> (with dimension [n x p], n samples, p variables) and settings is the <a href="start.htm#sub_2" class="lnk_text">setting structure</a>. Depending on the size and epochs used to train the model, MATLAB could take some minutes to calculate it. Anyway, in the MATLAB command window the number of processed epochs will be displayed.<BR>
<BR>
[<a href="#top" class="lnk_text">-> top</a>]
<BR>
<BR> <a name="sub_2"></a>
<BR>
<span class="title_paragraph">_ How to read the results</span>
<BR>
<BR>
The given output (model) is a structure, with several fields containing all the Kohonen Map results.
<BR><BR>
<B>model.net.W</B><BR>
this field contains the kohonen weights with dimension [size x size x p]
<BR><BR>
<B>model.net.settings</B><BR>
contains the used settings (epochs, size, etc...)
<BR><BR>
<B>model.scal</B><BR>
is a structure containing all the scaling parameters (minimum and maximum values for all the variables)
<BR>
<BR>
<B>model.res.top_map</B><BR>
contains the sample positions (coordinates) in the Kohonen Map, with dimensions [n x 2]. The top map coordinates are coded in the following way:
<BR>
<BR>
<center><img src="kohonen_top_map.gif" width="393" height="311" border="1"></center>
<BR>
where, for example, the red point represents a generic sample placed in the neuron with coordinates [3,2];
<BR>
<BR>
[<a href="#top" class="lnk_text">-> top</a>]
<BR>
<BR><a name="sub_3"></a>
<BR>
<span class="title_paragraph">_ How to plot the results</span>
<BR>
<BR>
You can open a MATLAB GUI to visualize the results. To do so, type:
<BR>
<BR>
<div id="tab_duo_text" class="text_math">
visualize_model(model);
</div>
<BR>
where <a href="#sub_1" class="lnk_text">model</a> is the previously described model structure.
If you want to plot specific sample labels you can type:
<BR>
<BR>
<div id="tab_duo_text" class="text_math">
visualize_model(model,labels);
</div>
<BR>
where labels is a numeric or string vector with dimension [n x 1]. The follwoing GUI will appear:
<BR>
<BR>
<center>
<img src="kohonen_visualize.gif" width="550" height="450"> </center>
<BR>
this plot represent the Kohonen top map, where samples and variable weights can be displayed. "Display labels" and "Display weights" set the sample labels and variable weights respectivly. Neurons can be coloured from white (weight equal to zero, minimum value) to black (weight equal to 1, maximum value). "Update" is the button for updating the plot. You can move the map ("up", "down", "right" and "left"), while "get neuron weights" opens a new plot displaying all the weights of a selected neuron and "get neuron labels" opens a new plot with the list of all the sample labels of a selected neuron. <BR>
<BR>
[<a href="#top" class="lnk_text">-> top</a>]
<BR>
<BR><a name="sub_4"></a>
<BR>
<span class="title_paragraph">_ Prediction of new samples</span>
<BR>
<BR>
In order to project new samples in an existing net, type:
<BR>
<BR>
<div id="tab_duo_text" class="text_math">
pred = pred_kohonen(Xnew,model);
</div>
<BR>
where Xnew is the data matrix of the samples to be predicted (with dimension [n x p], n new samples, p variables)
and <a href="#sub_1" class="lnk_text">model</a> is the previously described model structure.
Pred is a structure, containing the following field:
<BR><BR>
<B>pred.top_map</B><BR>
contains the positions (coordinates) of the predicted samples in the Kohonen Map.
<BR>
<BR>
[<a href="#top" class="lnk_text">-> top</a>]
<BR>
<BR>
<BR>
</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 + -