📄 dcdata.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"><html><head> <title>Description of dcData</title> <meta name="keywords" content="dcData"> <meta name="description" content="DCDATA Test data sets for data clustering (no class label)."> <meta http-equiv="Content-Type" content="text/html; charset=big5"> <meta name="generator" content="m2html © 2003 Guillaume Flandin"> <meta name="robots" content="index, follow"> <link type="text/css" rel="stylesheet" href="../m2html.css"></head><body><a name="_top"></a><div><a href="../index.html">Home</a> > <a href="index.html">dcpr</a> > dcData.m</div><!--<table width="100%"><tr><td align="left"><a href="../index.html"><img alt="<" border="0" src="../left.png"> Master index</a></td><td align="right"><a href="index.html">Index for dcpr <img alt=">" border="0" src="../right.png"></a></td></tr></table>--><h1>dcData</h1><h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2><div class="box"><strong>DCDATA Test data sets for data clustering (no class label).</strong></div><h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2><div class="box"><strong>function DS = dcdata(dataID) </strong></div><h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2><div class="fragment"><pre class="comment"> DCDATA Test data sets for data clustering (no class label).
Usage: DS = dcdata(dataID)
DS: Data set</pre></div><!-- crossreference --><h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>This function calls:<ul style="list-style-image:url(../matlabicon.gif)"><li><a href="dcprDataPlot.html" class="code" title="function dcprDataPlot(DS, plotTitle, displayAnnotation)">dcprDataPlot</a> dcprDataPlot: Plot of 2D data for data clustering or pattern recognition</li><li><a href="randn2.html" class="code" title="function z = randn2(n)">randn2</a> RANDN2 2D Gaussian random samples with mean 0 and variance 1</li></ul>This function is called by:<ul style="list-style-image:url(../matlabicon.gif)"><li><a href="gmmGrowDemo.html" class="code" title="">gmmGrowDemo</a> Example of using gmmGrow.m for growing a GMM (gaussian mixture models).</li><li><a href="gmmTrainDemo1d.html" class="code" title="">gmmTrainDemo1d</a> Example of using GMM (gaussian mixture model) for 1-D data</li><li><a href="gmmTrainDemo2dCovType01.html" class="code" title="">gmmTrainDemo2dCovType01</a> Animation of GMM training with covType=1 (isotropic) for 2D data</li><li><a href="gmmTrainDemo2dCovType02.html" class="code" title="">gmmTrainDemo2dCovType02</a> Animation of GMM training with covType=2 (diagonal cov. matrix) for 2D data</li><li><a href="gmmTrainDemo2dCovType03.html" class="code" title="">gmmTrainDemo2dCovType03</a> Animation of GMM training with covType=3 (full cov. matrix) for 2D data</li><li><a href="vqKmeans.html" class="code" title="function [center, U, distortion, allCenter] = vqKmeans(data, clusterNum, plotOpt)">vqKmeans</a> vqKmeans: Vector quantization using K-means clustering (Forgy's batch-mode method)</li></ul><!-- crossreference --><h2><a name="_subfunctions"></a>SUBFUNCTIONS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2><ul style="list-style-image:url(../matlabicon.gif)"><li><a href="#_sub1" class="code">function selfdemo</a></li></ul><h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2><div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function DS = dcdata(dataID)</a>0002 <span class="comment">% DCDATA Test data sets for data clustering (no class label).</span>0003 <span class="comment">% Usage: DS = dcdata(dataID)</span>0004 <span class="comment">% DS: Data set</span>0005 0006 <span class="comment">% Roger Jang</span>0007 0008 <span class="keyword">if</span> nargin==0, <a href="#_sub1" class="code" title="subfunction selfdemo">selfdemo</a>; <span class="keyword">return</span>; <span class="keyword">end</span>0009 0010 <span class="keyword">if</span> dataID==10011 d1 = <a href="randn2.html" class="code" title="function z = randn2(n)">randn2</a>(100)*0.25 + ones(100,1)*[1 1.5];0012 d2 = <a href="randn2.html" class="code" title="function z = randn2(n)">randn2</a>(100)*0.25 + ones(100,1)*[2 0];0013 d3 = <a href="randn2.html" class="code" title="function z = randn2(n)">randn2</a>(100)*0.25 + ones(100,1)*[1 -1.5];0014 DS.clusterNum = 6;0015 DS.input = [d1; d2; d3; -d1; -d2; -d3]';0016 <span class="keyword">elseif</span> dataID==20017 d1=<a href="randn2.html" class="code" title="function z = randn2(n)">randn2</a>(6000);0018 mag = sqrt(sum(d1'.^2));0019 DS.clusterNum = 8;0020 DS.input = d1(mag>0.4 & mag<1.0,:)';0021 <span class="keyword">elseif</span> dataID==30022 d1 = <a href="randn2.html" class="code" title="function z = randn2(n)">randn2</a>(1000)*.5;0023 d2 = <a href="randn2.html" class="code" title="function z = randn2(n)">randn2</a>(1500)*5 + 10;0024 d3 = <a href="randn2.html" class="code" title="function z = randn2(n)">randn2</a>(2000)*7 + 30;0025 DS.clusterNum = 3;0026 DS.input = [d1; d2; d3]';0027 <span class="keyword">elseif</span> dataID==40028 d1 = <a href="randn2.html" class="code" title="function z = randn2(n)">randn2</a>(500)*20 + ones(500,1)*[50,0];0029 d2 = <a href="randn2.html" class="code" title="function z = randn2(n)">randn2</a>(200)*3 + ones(200,1)*[20,35];0030 d3 = <a href="randn2.html" class="code" title="function z = randn2(n)">randn2</a>(200)*3 + ones(200,1)*[10,5];0031 DS.clusterNum = 3;0032 DS.input = [d1; d2; d3]';0033 <span class="keyword">elseif</span> dataID==5 0034 dataNum = 150;0035 data1 = ones(dataNum, 1)*[0 0] + randn(dataNum, 2)/5;0036 data2 = ones(dataNum, 1)*[0 1] + randn(dataNum, 2)/5;0037 data3 = ones(dataNum, 1)*[1 0] + randn(dataNum, 2)/5;0038 data4 = ones(dataNum, 1)*[1 1] + randn(dataNum, 2)/5;0039 DS.clusterNum = 4;0040 DS.input = [data1; data2; data3; data4]';0041 <span class="keyword">elseif</span> dataID==60042 n=100;0043 dim=2;0044 c1 = [0.125 0.25]'; data1 = randn(dim,n)/8 + c1*ones(1,n);0045 c2 = [0.625 0.25]'; data2 = randn(dim,n)/8 + c2*ones(1,n);0046 c3 = [0.375 0.75]'; data3 = randn(dim,n)/8 + c3*ones(1,n);0047 c4 = [0.875 0.75]'; data4 = randn(dim,n)/8 + c4*ones(1,n);0048 DS.clusterNum = 4;0049 DS.input = [data1, data2, data3, data4];0050 <span class="keyword">elseif</span> dataID==7 <span class="comment">% ?@???????I</span>0051 dataNum = 1000;0052 data1 = randn(1,2*dataNum);0053 data2 = randn(1,3*dataNum)/2+2;0054 data3 = randn(1,1*dataNum)/3-2;0055 DS.clusterNum=3;0056 DS.input = [data1, data2, data3];0057 <span class="keyword">else</span>0058 error(<span class="string">'Unknown Data ID!'</span>)0059 <span class="keyword">end</span>0060 0061 <span class="comment">% ====== Self demo</span>0062 <a name="_sub1" href="#_subfunctions" class="code">function selfdemo</a>0063 <span class="keyword">for</span> i = 1:60064 DS = feval(mfilename, i);0065 subplot(2,3,i);0066 <a href="dcprDataPlot.html" class="code" title="function dcprDataPlot(DS, plotTitle, displayAnnotation)">dcprDataPlot</a>(DS);0067 title([<span class="string">'dataID = '</span>, num2str(i)]);0068 <span class="keyword">end</span></pre></div><hr><address>Generated on Thu 30-Oct-2008 12:53:56 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/">m2html</a></strong> © 2003</address></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -