📄 example.htm
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>MOLMAP multiway 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 simulated data</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">Predicting unknown samples </a></div>
</div>
<BR><a name="sub_1"></a>
<BR>
<span class="title_paragraph">_ Classification of simulated data</span>
<BR>
<BR>
This simulated dataset is composed by 50 three-way samples divided into 2 classes. The dimension of the dataset is 50x15x25. For more information on how this dataset has been built, read the relative paragraph in:<BR>
<BR>
Ballabio D, Consonni V, Todeschini R. (<strong>2007</strong>) Classification of multiway analytical data based on MOLMAP approach. <em>Analytica Chimica Acta</em> <strong>in press</strong>, doi:10.1016/j.aca.2007.10.029<BR>
<BR>
Type:<BR>
<BR>
<div id="tab_duo_text"><span class="text_math">
load simulated_data </span></div>
<BR>
on the MATLAB command window to load the data. Then, we can build a defualt setting structure, define the number of epochs (40) and the size of the net (7) and have a look to the final setting structure:
<BR>
<BR>
<div id="tab_duo_text"><span class="text_math">
settings = som_settings('multiway'); <BR>
settings.epochs = 40;<BR>
settings.nsize = 7;<BR>
settings
</span></div>
<BR>
After that, we can run the MOLMAP modeling and calculate the relative MOLMAP scores:
<BR>
<BR>
<div id="tab_duo_text"><span class="text_math">
model = model_multiway(X,class,settings);
</span></div>
<BR>
At the end of the calculation, we will have a structure (model) that contains all the results.
<BR><BR><span class="style1">Pay attention:</span> you can not directly develop classification models with this toolbox. You can use the <strong>MOLMAP multiway toolbox</strong> to calculate MOLMAP scores and then apply what you prefer on the MOLMAP score matrix. In order to extract the MOLMAP scores from the result structure, type: <BR>
<BR>
<div id="tab_duo_text"><span class="text_math">
S = model.res.score;</span></div>
<BR>
In this case, S (the MOLMAP score matrix) is a matrix with 50 rows (samples) and 49 columns (the scores, that are equal to the number of neurons, i.e. 7*7). Just as an example, we can apply Principal Component Analysis (with a different software/MATLAB code) on this matrix and obtain the following score plot (where the classes are clearly separated):<BR>
<BR><center>
<img src="example_visualize_0.gif" width="424" height="331" border="1">
</center>
<BR>
<span class="style1">Pay attention</span>: since Kohonen maps are randomly initialised, each model you build will be different, even if repeated. 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"><span class="text_math">
visualize_model(model)
</span></div>
<BR>
Then, we can inspect the results. For example, we can plot the profile labels (i.e. the variable on the second mode) and the weights of the 19th variable of the third mode (by selecting 'profile labels' in the Display labels combo, 'variable 19' in the Display weights combo and then pressing the update button) and verify that this variable has high values in profiles 11th and 12th.<BR>
<BR>
<center>
<img src="example_visualize_1_small.gif" width="500" height="409"><BR><BR>
<a href="example_visualize_1.gif" target="_blank" class="lnk_text">enlarge figure
</a>
</center>
<BR>
The different kinds of labels you can plot are: <BR>
<strong>ID</strong>: identification number of the input vector (from 1 to I*J, in a three-way dataset with dimensions IxJxK). <BR>
<strong>sample identifier</strong>: is a string that specifies which multiway sample and which second mode variable the input vector belongs to. For example, an input vector showing a label equal to 5-s37 is the 5th variable on the second mode (J=5) of sample 37 (I=37).<BR>
<strong>profile label</strong>: is the label stored in model.label.label_profile, i.e. the number of the second mode variable the input vector belongs to.<BR>
Moreover, you can add <strong>optional labels</strong>. For example, we can plot the same data, but with the multiway sample class labels that are stored in the class vector:<BR>
<BR>
<div id="tab_duo_text"><span class="text_math"> visualize_model(model,class) </span></div>
<BR>
and then choosing "optional labels" in the combo label. We can highlighting profile 11. In this way we can see that samples of class 2 have different values of the 11th profile with respect to samples of class 1. We can also export these plots as figures by clicking "get map as figure".<BR>
<BR>
<center>
<img src="example_visualize_2_small.gif" width="500" height="409"><BR><BR>
<a href="example_visualize_2.gif" target="_blank" class="lnk_text">enlarge figure</a>
</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>
[<a href="#top" class="lnk_text">-> top</a>]<BR>
<BR>
<a name="sub_3"></a>
<BR>
<span class="title_paragraph">_ Predicting unknown samples</span>
<BR>
<BR>
Finally, in order to predict the MOLMAP scores of new samples, we can type:
<BR>
<BR>
<div id="tab_duo_text"><span class="text_math">
pred = pred_multiway(Xnew,model);
</span></div>
<BR>
At the end of the calculation, we can look at the results by extracting the predicted MOLMAP scores:
<BR>
<BR>
<div id="tab_duo_text"><span class="text_math">pred_score = pred.score;</span></div>
<BR>
[<a href="#top" class="lnk_text">-> top</a>]
<BR>
<BR>
<BR>
</center>
</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 + -