📄 decisionboundaryplot.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 decisionBoundaryPlot</title> <meta name="keywords" content="decisionBoundaryPlot"> <meta name="description" content="decisionBoundaryPlot: Plot of the decision boundary of a classification problem"> <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> > decisionBoundaryPlot.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>decisionBoundaryPlot</h1><h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2><div class="box"><strong>decisionBoundaryPlot: Plot of the decision boundary of a classification problem</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 out=decisionBoundaryPlot(surfObj) </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"> decisionBoundaryPlot: Plot of the decision boundary of a classification problem
Usage: out=decisionBoundaryPlot(surfObj)
surfObj is generated by sgcSurface.m.</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="decisionBoundaryPlot.html" class="code" title="function out=decisionBoundaryPlot(surfObj)">decisionBoundaryPlot</a> decisionBoundaryPlot: Plot of the decision boundary of a classification problem</li><li><a href="getClassDataCount.html" class="code" title="function count=getClassDataCount(DS)">getClassDataCount</a> classDataCount: Get the data count for each class</li><li><a href="prData.html" class="code" title="function [DS, TS]=prData(dataName)">prData</a> prData: Various data set for PR</li><li><a href="sgcSurface.html" class="code" title="function surfObj=sgcSurface(DS, pointNum, classParam)">sgcSurface</a> </li><li><a href="sgcTrain.html" class="code" title="function [classParam, recogRate, hitIndex]=sgcTrain(DS, prior, plotOpt)">sgcTrain</a> sgcTrain: Training for single Gaussian classifier training</li></ul>This function is called by:<ul style="list-style-image:url(../matlabicon.gif)"><li><a href="decisionBoundaryPlot.html" class="code" title="function out=decisionBoundaryPlot(surfObj)">decisionBoundaryPlot</a> decisionBoundaryPlot: Plot of the decision boundary of a classification problem</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 out=decisionBoundaryPlot(surfObj)</a>0002 <span class="comment">% decisionBoundaryPlot: Plot of the decision boundary of a classification problem</span>0003 <span class="comment">% Usage: out=decisionBoundaryPlot(surfObj)</span>0004 <span class="comment">% surfObj is generated by sgcSurface.m.</span>0005 0006 <span class="comment">% Roger Jang, 20041201</span>0007 0008 <span class="keyword">if</span> nargin<1, <a href="#_sub1" class="code" title="subfunction selfdemo">selfdemo</a>; <span class="keyword">return</span>; <span class="keyword">end</span>0009 0010 class=surfObj.class;0011 classNum=length(class);0012 xx=surfObj.xx;0013 yy=surfObj.yy;0014 data = [xx(:), yy(:)]';0015 0016 matlabVersion=version;0017 matlabVersion=eval(matlabVersion(1));0018 0019 hold on0020 <span class="keyword">for</span> i=1:classNum0021 tempClass=class;0022 tempClass(i)=[];0023 maxSurf=max(cat(3, tempClass.surface), [], 3);0024 tt=class(i).surface-maxSurf;0025 <span class="keyword">if</span> matlabVersion==60026 [c, h]=contourf(xx, yy, tt, 0*[1 1]);0027 <span class="keyword">else</span>0028 [c, h]=contourf(<span class="string">'v6'</span>, xx, yy, tt, 0*[1 1]);0029 <span class="keyword">end</span>0030 class(i).contourx=get(h(1), <span class="string">'xdata'</span>);0031 class(i).contoury=get(h(1), <span class="string">'ydata'</span>);0032 out(i)=patch(<span class="string">'xdata'</span>, class(i).contourx, <span class="string">'ydata'</span>, class(i).contoury, <span class="string">'faceColor'</span>, getColorLight(i));0033 <span class="keyword">end</span>0034 hold off0035 axis image;0036 0037 <span class="comment">% ====== selfdemo</span>0038 <a name="_sub1" href="#_subfunctions" class="code">function selfdemo</a>0039 DS=<a href="prData.html" class="code" title="function [DS, TS]=prData(dataName)">prData</a>(<span class="string">'iris'</span>);0040 DS.input=DS.input(3:4, :); <span class="comment">% Only take dimensions 3 and 4 for 2d visualization</span>0041 prior=<a href="getClassDataCount.html" class="code" title="function count=getClassDataCount(DS)">getClassDataCount</a>(DS); <span class="comment">% Use the class size as the class prior probability</span>0042 [classParam, recogRate]=<a href="sgcTrain.html" class="code" title="function [classParam, recogRate, hitIndex]=sgcTrain(DS, prior, plotOpt)">sgcTrain</a>(DS, prior);0043 pointNum=50;0044 surfObj=<a href="sgcSurface.html" class="code" title="function surfObj=sgcSurface(DS, pointNum, classParam)">sgcSurface</a>(DS, pointNum, classParam); <span class="comment">% Compute the Gaussian surface for each class</span>0045 <a href="decisionBoundaryPlot.html" class="code" title="function out=decisionBoundaryPlot(surfObj)">decisionBoundaryPlot</a>(surfObj); <span class="comment">% Plot the decision boundary</span>0046 title(<span class="string">'Decision boundaries using SGC'</span>);0047 <a href="sgcTrain.html" class="code" title="function [classParam, recogRate, hitIndex]=sgcTrain(DS, prior, plotOpt)">sgcTrain</a>(DS, prior, 1); <span class="comment">% Overlay the training data</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 + -