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

📄 trips.html

📁 交流 模糊控制 交流 模糊控制
💻 HTML
字号:
<!--This HTML is auto-generated from an m-file.Your changes will be overwritten.--><p xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd" style="color:#990000; font-weight:bold; font-size:x-large">Model Identification</p><p xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd">This is a demonstration of subtractive clustering and how it can be usedwith multi-dimensional data.</p><p xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd">Copyright 1994-2002 The MathWorks, Inc.$Revision: 1.12 $</p><p xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd" style="color:#990000; font-weight:bold; font-size:medium; page-break-before: auto;"><a name=""></a></p><p xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd">This is a plot of the input data for a model identificationproblem. We are interested in estimating the numberof auto trips generated from an area based on the area'sdemographics. Five factors were considered: population,number of houses, vehicle ownership, income, and employment.</p><pre xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd" style="position: relative; left:30px">tripdataplot(datin)</pre><img xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd" vspace="5" hspace="5" src="trips_img_02_01.gif"><p xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd" style="color:#990000; font-weight:bold; font-size:medium; page-break-before: auto;"><a name=""></a></p><p xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd">Using the GENFIS2 function (which is based on thesubtractive clustering algorithm in the SUBCLUST function),we generate a fuzzy inference system that calculates theoutput based on the five inputs.</p><pre xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd" style="position: relative; left:30px">a=genfis2(datin,datout,0.45);plotfis(a);</pre><img xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd" vspace="5" hspace="5" src="trips_img_03_01.gif"><p xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd" style="color:#990000; font-weight:bold; font-size:medium; page-break-before: auto;"><a name=""></a></p><p xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd">The upper plot displays 75 data points for the five inputvariables. The lower plot displays the corresponding outputsand the outputs predicted by the fuzzy model.</p><pre xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd" style="position: relative; left:30px">subplot(1,1,1)fuzout=evalfis(datin,a);subplot(2,1,1)plot(datin)subplot(2,1,2)plot([datout fuzout])</pre><pre xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd" style="color:gray; font-style:italic;">Warning: Implication method should be "prod" for Sugeno systems.</pre><img xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd" vspace="5" hspace="5" src="trips_img_04_01.gif"><p xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd" style="color:#990000; font-weight:bold; font-size:medium; page-break-before: auto;"><a name=""></a></p><p xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd">Here is a plot of the actual output values (X axis) versus thepredicted output values (Y axis). If the prediction were aperfect one, the data points would lie right along the diagonalline X = Y.</p><pre xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd" style="position: relative; left:30px">subplot(1,1,1)plot(datout,fuzout,<span style="color:#B20000">'bx'</span>,[0 10],[0 10],<span style="color:#B20000">'r:'</span>)xlabel(<span style="color:#B20000">'Actual Value'</span>)ylabel(<span style="color:#B20000">'Predicted Value'</span>)axis square</pre><img xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd" vspace="5" hspace="5" src="trips_img_05_01.gif"><p xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd" style="color:#990000; font-weight:bold; font-size:medium; page-break-before: auto;"><a name=""></a></p><p xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd">We set aside 25 of the original 100 data points as checkingdata. Since we did not use this data to create our model, itis a useful measure of how good our model is.</p><pre xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd" style="position: relative; left:30px">chkfuzout=evalfis(chkdatin,a);plot(chkdatout,chkfuzout,<span style="color:#B20000">'bx'</span>,[0 10],[0 10],<span style="color:#B20000">'r:'</span>)axis squarexlabel(<span style="color:#B20000">'Actual Value'</span>)ylabel(<span style="color:#B20000">'Predicted Value'</span>)</pre><pre xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd" style="color:gray; font-style:italic;">Warning: Implication method should be "prod" for Sugeno systems.</pre><img xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd" vspace="5" hspace="5" src="trips_img_06_01.gif"><p xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd" style="color:#990000; font-weight:bold; font-size:medium; page-break-before: auto;"><a name=""></a></p><p xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd">Clustering can be a very effective technique for dealing withlarge sets of data: the principal idea is to distill naturalgroupings of data from a large data set thereby allowingconcise representation of a model's behavior. This demo hasshown how accurate predictions can be made despite themulti-dimensional nature of the problem. With the results of thisclustering experiment in hand, we could now potentially go onto use other techniques, such as ANFIS.</p><originalCode xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd" code="%% Model Identification&#xA;% This is a demonstration of subtractive clustering and how it can be used&#xA;% with multi-dimensional data.&#xA;%&#xA;% Copyright 1994-2002 The MathWorks, Inc. &#xA;% $Revision: 1.12 $&#xA;&#xA;%%&#xA;% This is a plot of the input data for a model identification&#xA;% problem. We are interested in estimating the number&#xA;% of auto trips generated from an area based on the area's&#xA;% demographics. Five factors were considered: population,&#xA;% number of houses, vehicle ownership, income, and employment.&#xA;&#xA;tripdata&#xA;plot(datin)&#xA;&#xA;%%&#xA;% Using the GENFIS2 function (which is based on the&#xA;% subtractive clustering algorithm in the SUBCLUST function),&#xA;% we generate a fuzzy inference system that calculates the&#xA;% output based on the five inputs.&#xA;&#xA;a=genfis2(datin,datout,0.45);&#xA;plotfis(a);&#xA;&#xA;%%&#xA;% The upper plot displays 75 data points for the five input&#xA;% variables. The lower plot displays the corresponding outputs&#xA;% and the outputs predicted by the fuzzy model.&#xA;&#xA;subplot(1,1,1)&#xA;fuzout=evalfis(datin,a);&#xA;subplot(2,1,1)&#xA;plot(datin)&#xA;subplot(2,1,2)&#xA;plot([datout fuzout])&#xA;&#xA;%%&#xA;% Here is a plot of the actual output values (X axis) versus the&#xA;% predicted output values (Y axis). If the prediction were a&#xA;% perfect one, the data points would lie right along the diagonal&#xA;% line X = Y.&#xA;&#xA;subplot(1,1,1)&#xA;plot(datout,fuzout,'bx',[0 10],[0 10],'r:')&#xA;xlabel('Actual Value')&#xA;ylabel('Predicted Value')&#xA;axis square&#xA;&#xA;%%&#xA;% We set aside 25 of the original 100 data points as checking&#xA;% data. Since we did not use this data to create our model, it&#xA;% is a useful measure of how good our model is.&#xA;&#xA;chkfuzout=evalfis(chkdatin,a);&#xA;plot(chkdatout,chkfuzout,'bx',[0 10],[0 10],'r:')&#xA;axis square&#xA;xlabel('Actual Value')&#xA;ylabel('Predicted Value')&#xA;&#xA;%%&#xA;% Clustering can be a very effective technique for dealing with&#xA;% large sets of data: the principal idea is to distill natural&#xA;% groupings of data from a large data set thereby allowing&#xA;% concise representation of a model's behavior. This demo has&#xA;% shown how accurate predictions can be made despite the&#xA;% multi-dimensional nature of the problem. With the results of this&#xA;% clustering experiment in hand, we could now potentially go on&#xA;% to use other techniques, such as ANFIS.&#xA;"></originalCode>

⌨️ 快捷键说明

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