锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲综合激情另类小说区,亚洲精品电影在线,亚洲а∨精品天堂在线http://m.tkk7.com/changedi/category/43518.html鍏堢煡cd鈥斺旂儹鐖辯敓媧繪槸涓鍒囪壓鏈殑寮濮?/description>zh-cnWed, 24 Oct 2012 10:20:18 GMTWed, 24 Oct 2012 10:20:18 GMT60鑱氱被綆楁硶瀛︿範絎旇錛堜簲錛夆斺斿垝鍒嗚仛綾?/title><link>http://m.tkk7.com/changedi/archive/2010/05/11/320631.html</link><dc:creator>changedi</dc:creator><author>changedi</author><pubDate>Tue, 11 May 2010 13:07:00 GMT</pubDate><guid>http://m.tkk7.com/changedi/archive/2010/05/11/320631.html</guid><wfw:comment>http://m.tkk7.com/changedi/comments/320631.html</wfw:comment><comments>http://m.tkk7.com/changedi/archive/2010/05/11/320631.html#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://m.tkk7.com/changedi/comments/commentRss/320631.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/changedi/services/trackbacks/320631.html</trackback:ping><description><![CDATA[  <h1 style="text-indent: -18pt; margin-left: 18pt">1.<span style="font: 7pt 'Times New Roman'">     </span><span style="font-family: 瀹嬩綋">鍒掑垎鑱氱被</span></h1> <p style="text-indent: 21pt" class="MsoNormal"><span style="font-family: 瀹嬩綋">鍏跺疄浠庢煇縐嶈搴﹁錛屽垝鍒嗚仛綾繪槸瀹屽叏涓嶇敤璧樿堪鐨勪竴縐嶈仛綾繪柟娉曪紝鍙兘涔熸槸鏈甯歌鐨勮仛綾葷畻娉曚簡銆傝憲鍚嶇殑</span>k-means<span style="font-family: 瀹嬩綋">綆楁硶灝辨槸涓腑鍏稿瀷銆傝繖嬈$殑鍐呭涓昏鏄氳繃</span>k-means<span style="font-family: 瀹嬩綋">鑱氱被綆楁硶鏉ユ諱綋浠嬬粛涓涓嬪垝鍒嗚仛綾匯?/span></p> <p style="text-indent: 21pt" class="MsoNormal"><span style="font-family: 瀹嬩綋">綆鍗曟潵璁詫紝</span>k<span style="font-family: 瀹嬩綋">鍧囧艱仛綾葷┒绔熷仛浜嗕粈涔堜簨錛屾垜浠彲浠ヨ繖鏍鋒潵鐪嬶紝鏈?/span>N<span style="font-family: 瀹嬩綋">涓暟鎹偣鐨勯泦鍚?/span>D={x1,x2,…,xn}<span style="font-family: 瀹嬩綋">錛屾瘡涓?/span>xi<span style="font-family: 瀹嬩綋">浠h〃涓涓壒寰佸悜閲忥紝鐩爣鏄皢榪?/span>N<span style="font-family: 瀹嬩綋">涓偣鏍規嵁鏌愮鐩鎬技鍑嗗垯灝嗗叾鍒掑垎鍒?/span>K<span style="font-family: 瀹嬩綋">涓垎綾諱腑銆傝?/span>k<span style="font-family: 瀹嬩綋">鍧囧兼墍琛ㄨ揪鐨勯噸瑕佸湪浜庣浉浼煎噯鍒欑殑閫夊彇錛屽嵆涓嶆柇鐨勪嬌鐢ㄧ被綈囩殑鍧囧兼潵瀹屾垚榪欐牱鐨勫垝鍒嗐傚綋鐒朵篃鏈変功鎶婅繖縐嶇浉浼煎噯鍒欑О涔嬩負璇勫垎鍑芥暟銆傚熀浜庡垝鍒嗙殑鑱氱被綆楁硶瀵逛簬</span>homogeneity<span style="font-family: 瀹嬩綋">鐨勫疄鐜版槸閫氳繃閫夊彇閫傚綋鐨勮瘎鍒嗗嚱鏁板茍浣挎瘡涓涓暟鎹偣鍒板畠鎵灞炵殑鑱氱被涓績鐨勮窛紱繪渶灝忓寲銆傝屽叧閿氨鏄浣曞畾涔夎繖縐嶈窛紱伙紝鍜屾墍璋撶殑鑱氱被涓績銆備婦涓緥瀛愭潵璁詫紝濡傛灉瀹氫箟鑱氱被闂磋窛紱諱負嬈у紡璺濈錛岄偅涔堝彲浠ヤ嬌鐢ㄥ崗鏂瑰樊鐨勬蹇墊潵瀹氫箟閫氱敤鐨勮瘎鍒嗗嚱鏁般傚垝鍒嗚仛綾葷殑鎬濇兂鏄渶鐩磋鍜屾槗鎳傜殑鍒嗙被鎬濇兂錛屽洜姝ゆ垜涔熶笉鍦ㄨ繖閲岄暱綃囦粙緇嶏紝榪樻槸浠ョ畻娉曠殑瀹炵幇鍜屼唬鐮佹潵鐩磋琛ㄧ幇鍒掑垎鑱氱被鐨勬ц兘銆?/span></p> <h1>2. <span style="font-family: 瀹嬩綋">綆楁硶瀹炵幇</span></h1> <p>       <span style="font-family: 瀹嬩綋">鎴戜滑浠?/span>k-means<span style="font-family: 瀹嬩綋">綆楁硶涓轟緥鏉ュ疄鐜板垝鍒嗚仛綾匯傝綆楁硶鐨勫鏉傚害涓?/span>O(KnI)<span style="font-family: 瀹嬩綋">錛屽叾涓?/span>I<span style="font-family: 瀹嬩綋">鏄凱浠f鏁般傝繖縐嶇畻娉曠殑涓涓彉浣撴槸渚濇鍒嗘瀽姣忎釜鏁版嵁鐐癸紝鑰屼笖涓鏃︽湁鏁版嵁鐐硅閲嶆柊鍒嗛厤灝辨洿鏂拌仛綾諱腑蹇冿紝鍙嶅鐨勫湪鏁版嵁鐐逛腑寰幆鐩村埌瑙d笉鍐嶅彉鍖栥?/span>k-means<span style="font-family: 瀹嬩綋">綆楁硶鐨勬悳绱㈣繃紼嬪眬闄愪簬鍏ㄩ儴鍙兘鐨勫垝鍒嗙┖闂寸殑涓涓緢灝忕殑閮ㄥ垎銆傚洜姝ゆ湁鍙兘鍥犱負綆楁硶鏀舵暃鍒拌瘎鍒嗗嚱鏁扮殑灞閮ㄨ岄潪鍏ㄥ眬鏈灝忚岄敊榪囨洿濂界殑瑙c傚綋鐒剁紦瑙f柟娉曞彲浠ラ氳繃閫夊彇闅忔満璧峰鐐規潵鏀硅繘鎼滅儲錛堟垜浠緥瀛愪腑鐨?/span>KMPP<span style="font-family: 瀹嬩綋">綆楁硶錛夛紝鎴栬呭埄鐢ㄦā鎷熼鐏瓑絳栫暐鏉ユ敼鍠勬悳绱㈡ц兘銆傚洜姝わ紝浠庤繖涓搴︽潵鐞嗚В錛岃仛綾誨垎鏋愬疄璐ㄤ笂鏄竴涓湪搴炲ぇ鐨勮В絀洪棿涓紭鍖栫壒瀹氳瘎鍒嗗嚱鏁扮殑鎼滅儲闂銆?/span></p> <p style="text-indent: 21pt" class="MsoNormal"><span style="font-family: 瀹嬩綋">涓嶅璇翠簡錛岀洿鎺ヤ笂浠g爜鍚э紒錛侊紒</span></p> <p>k-means<span style="font-family: 瀹嬩綋">綆楁硶錛?/span></p> <p>for k = 1, … , K <span style="font-family: 瀹嬩綋">浠?/span> r(k) <span style="font-family: 瀹嬩綋">涓轟粠</span>D<span style="font-family: 瀹嬩綋">涓殢鏈洪夊彇鐨勪竴涓偣錛?/span></p> <p>while <span style="font-family: 瀹嬩綋">鍦ㄨ仛綾?/span>Ck<span style="font-family: 瀹嬩綋">涓湁鍙樺寲鍙戠敓</span> do</p> <p>       <span style="font-family: 瀹嬩綋">褰㈡垚鑱氱被錛?/span></p> <p>       For k = 1, … , K do</p> <p>              Ck = { x <span style="font-family: 瀹嬩綋">∈</span> D | d(rk,x) <= d(rj,x) <span style="font-family: 瀹嬩綋">瀵規墍鏈?/span>j=1, … , K, j != k}<span style="font-family: 瀹嬩綋">錛?/span></p> <p>       End;</p> <p>       <span style="font-family: 瀹嬩綋">璁$畻鏂拌仛綾諱腑蹇冿細</span></p> <p>       For k = 1, … , K do</p> <p>              Rk = Ck <span style="font-family: 瀹嬩綋">鍐呯偣鐨勫潎鍊煎悜閲?/span></p> <p>       End;</p> <p>End;</p> <p style="text-indent: 21pt" class="MsoNormal"><span style="font-family: 瀹嬩綋">鍏蜂綋瀹炵幇閮ㄥ垎鍥犱負鏈?/span>Apache Commons Math<span style="font-family: 瀹嬩綋">鐨勭幇鎴愪唬鐮侊紝縐夌潃</span>Eric Raymond<span style="font-family: 瀹嬩綋">鐨?/span>TAOUP<span style="font-family: 瀹嬩綋">涓殑鏋佸ぇ鍒╃敤宸ュ叿鍘熷垯錛屾垜娌℃湁鍐?/span>k-means<span style="font-family: 瀹嬩綋">鐨勫疄鐜幫紝鑰屾槸鐩存帴鍒╃敤</span>Apache Commons Math<span style="font-family: 瀹嬩綋">涓殑</span>k-means plus plus<span style="font-family: 瀹嬩綋">浠g爜鏉ヤ綔涓轟緥瀛愩?/span></p> <p><span style="font-family: 瀹嬩綋">鍏蜂綋濡備綍嫻嬭瘯榪欎竴綆楁硶錛岀粰鍑轟簡嫻嬭瘯浠g爜濡備笅錛?br /> </p> <div style="border-bottom: #cccccc 1px solid; border-left: #cccccc 1px solid; padding-bottom: 4px; background-color: #eeeeee; padding-left: 4px; width: 98%; padding-right: 5px; font-size: 13px; word-break: break-all; border-top: #cccccc 1px solid; border-right: #cccccc 1px solid; padding-top: 4px"><span style="color: #008080"> 1</span><img id="Codehighlighter1_34_719_Open_Image" onclick="this.style.display='none'; Codehighlighter1_34_719_Open_Text.style.display='none'; Codehighlighter1_34_719_Closed_Image.style.display='inline'; Codehighlighter1_34_719_Closed_Text.style.display='inline';" alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" /><img style="display: none" id="Codehighlighter1_34_719_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_34_719_Closed_Text.style.display='none'; Codehighlighter1_34_719_Open_Image.style.display='inline'; Codehighlighter1_34_719_Open_Text.style.display='inline';" alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" /><span style="color: #0000ff">private</span><span style="color: #000000"> </span><span style="color: #0000ff">static</span><span style="color: #000000"> </span><span style="color: #0000ff">void</span><span style="color: #000000"> testKMeansPP()</span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_34_719_Closed_Text"><img alt="" src="http://m.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_34_719_Open_Text"><span style="color: #000000">{<br /> </span><span style="color: #008080"> 2</span><span style="color: #000000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" /><br /> </span><span style="color: #008080"> 3</span><span style="color: #000000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" />        </span><span style="color: #008000">//</span><span style="color: #008000">ori is sample as n instances with m features, here n=8,m=2</span><span style="color: #008000"><br /> </span><span style="color: #008080"> 4</span><span style="color: #008000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" /></span><span style="color: #000000"><br /> </span><span style="color: #008080"> 5</span><span style="color: #000000"><img id="Codehighlighter1_128_176_Open_Image" onclick="this.style.display='none'; Codehighlighter1_128_176_Open_Text.style.display='none'; Codehighlighter1_128_176_Closed_Image.style.display='inline'; Codehighlighter1_128_176_Closed_Text.style.display='inline';" alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" /><img style="display: none" id="Codehighlighter1_128_176_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_128_176_Closed_Text.style.display='none'; Codehighlighter1_128_176_Open_Image.style.display='inline'; Codehighlighter1_128_176_Open_Text.style.display='inline';" alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" />       </span><span style="color: #0000ff">int</span><span style="color: #000000"> ori[][] </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_128_176_Closed_Text"><img alt="" src="http://m.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_128_176_Open_Text"><span style="color: #000000">{</span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_129_133_Closed_Text"><img alt="" src="http://m.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_129_133_Open_Text"><span style="color: #000000">{</span><span style="color: #000000">2</span><span style="color: #000000">,</span><span style="color: #000000">5</span><span style="color: #000000">}</span></span><span style="color: #000000">,</span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_135_139_Closed_Text"><img alt="" src="http://m.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_135_139_Open_Text"><span style="color: #000000">{</span><span style="color: #000000">6</span><span style="color: #000000">,</span><span style="color: #000000">4</span><span style="color: #000000">}</span></span><span style="color: #000000">,</span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_141_145_Closed_Text"><img alt="" src="http://m.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_141_145_Open_Text"><span style="color: #000000">{</span><span style="color: #000000">5</span><span style="color: #000000">,</span><span style="color: #000000">3</span><span style="color: #000000">}</span></span><span style="color: #000000">,</span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_147_151_Closed_Text"><img alt="" src="http://m.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_147_151_Open_Text"><span style="color: #000000">{</span><span style="color: #000000">2</span><span style="color: #000000">,</span><span style="color: #000000">2</span><span style="color: #000000">}</span></span><span style="color: #000000">,</span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_153_157_Closed_Text"><img alt="" src="http://m.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_153_157_Open_Text"><span style="color: #000000">{</span><span style="color: #000000">1</span><span style="color: #000000">,</span><span style="color: #000000">4</span><span style="color: #000000">}</span></span><span style="color: #000000">,</span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_159_163_Closed_Text"><img alt="" src="http://m.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_159_163_Open_Text"><span style="color: #000000">{</span><span style="color: #000000">5</span><span style="color: #000000">,</span><span style="color: #000000">2</span><span style="color: #000000">}</span></span><span style="color: #000000">,</span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_165_169_Closed_Text"><img alt="" src="http://m.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_165_169_Open_Text"><span style="color: #000000">{</span><span style="color: #000000">3</span><span style="color: #000000">,</span><span style="color: #000000">3</span><span style="color: #000000">}</span></span><span style="color: #000000">,</span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_171_175_Closed_Text"><img alt="" src="http://m.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_171_175_Open_Text"><span style="color: #000000">{</span><span style="color: #000000">2</span><span style="color: #000000">,</span><span style="color: #000000">3</span><span style="color: #000000">}</span></span><span style="color: #000000">}</span></span><span style="color: #000000">;<br /> </span><span style="color: #008080"> 6</span><span style="color: #000000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" /><br /> </span><span style="color: #008080"> 7</span><span style="color: #000000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" />       </span><span style="color: #0000ff">int</span><span style="color: #000000"> n </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">8</span><span style="color: #000000">;<br /> </span><span style="color: #008080"> 8</span><span style="color: #000000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" /><br /> </span><span style="color: #008080"> 9</span><span style="color: #000000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" />       Collection</span><span style="color: #000000"><</span><span style="color: #000000">EuclideanIntegerPoint</span><span style="color: #000000">></span><span style="color: #000000"> col </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> ArrayList</span><span style="color: #000000"><</span><span style="color: #000000">EuclideanIntegerPoint</span><span style="color: #000000">></span><span style="color: #000000">();<br /> </span><span style="color: #008080">10</span><span style="color: #000000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" /><br /> </span><span style="color: #008080">11</span><span style="color: #000000"><img id="Codehighlighter1_314_422_Open_Image" onclick="this.style.display='none'; Codehighlighter1_314_422_Open_Text.style.display='none'; Codehighlighter1_314_422_Closed_Image.style.display='inline'; Codehighlighter1_314_422_Closed_Text.style.display='inline';" alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" /><img style="display: none" id="Codehighlighter1_314_422_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_314_422_Closed_Text.style.display='none'; Codehighlighter1_314_422_Open_Image.style.display='inline'; Codehighlighter1_314_422_Open_Text.style.display='inline';" alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" />       </span><span style="color: #0000ff">for</span><span style="color: #000000">(</span><span style="color: #0000ff">int</span><span style="color: #000000"> i</span><span style="color: #000000">=</span><span style="color: #000000">0</span><span style="color: #000000">;i</span><span style="color: #000000"><</span><span style="color: #000000">n;i</span><span style="color: #000000">++</span><span style="color: #000000">)</span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_314_422_Closed_Text"><img alt="" src="http://m.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_314_422_Open_Text"><span style="color: #000000">{<br /> </span><span style="color: #008080">12</span><span style="color: #000000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" /><br /> </span><span style="color: #008080">13</span><span style="color: #000000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" />           EuclideanIntegerPoint ec </span><span style="color: #000000">=</span><span style="color: #000000"> new EuclideanIntegerPoint(ori[i]);<br /> </span><span style="color: #008080">14</span><span style="color: #000000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" /><br /> </span><span style="color: #008080">15</span><span style="color: #000000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" />           col.add(ec);<br /> </span><span style="color: #008080">16</span><span style="color: #000000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" /><br /> </span><span style="color: #008080">17</span><span style="color: #000000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" />       }</span></span><span style="color: #000000"><br /> </span><span style="color: #008080">18</span><span style="color: #000000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" /><br /> </span><span style="color: #008080">19</span><span style="color: #000000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" />       KMeansPlusPlusClusterer</span><span style="color: #000000"><</span><span style="color: #000000">EuclideanIntegerPoint</span><span style="color: #000000">></span><span style="color: #000000"> km </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> KMeansPlusPlusClusterer</span><span style="color: #000000"><</span><span style="color: #000000">EuclideanIntegerPoint</span><span style="color: #000000">></span><span style="color: #000000">(</span><span style="color: #0000ff">new</span><span style="color: #000000"> Random(n));<br /> </span><span style="color: #008080">20</span><span style="color: #000000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" /><br /> </span><span style="color: #008080">21</span><span style="color: #000000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" />       List</span><span style="color: #000000"><</span><span style="color: #000000">Cluster</span><span style="color: #000000"><</span><span style="color: #000000">EuclideanIntegerPoint</span><span style="color: #000000">>></span><span style="color: #000000"> list </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> ArrayList</span><span style="color: #000000"><</span><span style="color: #000000">Cluster</span><span style="color: #000000"><</span><span style="color: #000000">EuclideanIntegerPoint</span><span style="color: #000000">>></span><span style="color: #000000">();<br /> </span><span style="color: #008080">22</span><span style="color: #000000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" /><br /> </span><span style="color: #008080">23</span><span style="color: #000000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" />       list </span><span style="color: #000000">=</span><span style="color: #000000"> km.cluster(col, </span><span style="color: #000000">3</span><span style="color: #000000">, </span><span style="color: #000000">100</span><span style="color: #000000">);<br /> </span><span style="color: #008080">24</span><span style="color: #000000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" /><br /> </span><span style="color: #008080">25</span><span style="color: #000000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" />       output(list);<br /> </span><span style="color: #008080">26</span><span style="color: #000000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" /><br /> </span><span style="color: #008080">27</span><span style="color: #000000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" />    }</span></span><span style="color: #000000"><br /> </span><span style="color: #008080">28</span><span style="color: #000000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" /><br /> </span><span style="color: #008080">29</span><span style="color: #000000"><img id="Codehighlighter1_791_1344_Open_Image" onclick="this.style.display='none'; Codehighlighter1_791_1344_Open_Text.style.display='none'; Codehighlighter1_791_1344_Closed_Image.style.display='inline'; Codehighlighter1_791_1344_Closed_Text.style.display='inline';" alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" /><img style="display: none" id="Codehighlighter1_791_1344_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_791_1344_Closed_Text.style.display='none'; Codehighlighter1_791_1344_Open_Image.style.display='inline'; Codehighlighter1_791_1344_Open_Text.style.display='inline';" alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" /></span><span style="color: #0000ff">private</span><span style="color: #000000"> </span><span style="color: #0000ff">static</span><span style="color: #000000"> </span><span style="color: #0000ff">void</span><span style="color: #000000"> output(List</span><span style="color: #000000"><</span><span style="color: #000000">Cluster</span><span style="color: #000000"><</span><span style="color: #000000">EuclideanIntegerPoint</span><span style="color: #000000">>></span><span style="color: #000000"> list)</span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_791_1344_Closed_Text"><img alt="" src="http://m.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_791_1344_Open_Text"><span style="color: #000000">{<br /> </span><span style="color: #008080">30</span><span style="color: #000000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" /><br /> </span><span style="color: #008080">31</span><span style="color: #000000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" />       </span><span style="color: #0000ff">int</span><span style="color: #000000"> ind </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">1</span><span style="color: #000000">;<br /> </span><span style="color: #008080">32</span><span style="color: #000000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" /><br /> </span><span style="color: #008080">33</span><span style="color: #000000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" />       Iterator</span><span style="color: #000000"><</span><span style="color: #000000">Cluster</span><span style="color: #000000"><</span><span style="color: #000000">EuclideanIntegerPoint</span><span style="color: #000000">>></span><span style="color: #000000"> it </span><span style="color: #000000">=</span><span style="color: #000000"> list.iterator();<br /> </span><span style="color: #008080">34</span><span style="color: #000000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" /><br /> </span><span style="color: #008080">35</span><span style="color: #000000"><img id="Codehighlighter1_912_1337_Open_Image" onclick="this.style.display='none'; Codehighlighter1_912_1337_Open_Text.style.display='none'; Codehighlighter1_912_1337_Closed_Image.style.display='inline'; Codehighlighter1_912_1337_Closed_Text.style.display='inline';" alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" /><img style="display: none" id="Codehighlighter1_912_1337_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_912_1337_Closed_Text.style.display='none'; Codehighlighter1_912_1337_Open_Image.style.display='inline'; Codehighlighter1_912_1337_Open_Text.style.display='inline';" alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" />       </span><span style="color: #0000ff">while</span><span style="color: #000000">(it.hasNext())</span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_912_1337_Closed_Text"><img alt="" src="http://m.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_912_1337_Open_Text"><span style="color: #000000">{<br /> </span><span style="color: #008080">36</span><span style="color: #000000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" /><br /> </span><span style="color: #008080">37</span><span style="color: #000000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" />           Cluster</span><span style="color: #000000"><</span><span style="color: #000000">EuclideanIntegerPoint</span><span style="color: #000000">></span><span style="color: #000000"> cl </span><span style="color: #000000">=</span><span style="color: #000000"> it.next();<br /> </span><span style="color: #008080">38</span><span style="color: #000000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" /><br /> </span><span style="color: #008080">39</span><span style="color: #000000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" />           System.out.print(</span><span style="color: #000000">"</span><span style="color: #000000">Cluster</span><span style="color: #000000">"</span><span style="color: #000000">+</span><span style="color: #000000">(ind</span><span style="color: #000000">++</span><span style="color: #000000">)</span><span style="color: #000000">+</span><span style="color: #000000">"</span><span style="color: #000000"> :</span><span style="color: #000000">"</span><span style="color: #000000">);<br /> </span><span style="color: #008080">40</span><span style="color: #000000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" /><br /> </span><span style="color: #008080">41</span><span style="color: #000000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" />           List</span><span style="color: #000000"><</span><span style="color: #000000">EuclideanIntegerPoint</span><span style="color: #000000">></span><span style="color: #000000"> li </span><span style="color: #000000">=</span><span style="color: #000000"> cl.getPoints();<br /> </span><span style="color: #008080">42</span><span style="color: #000000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" /><br /> </span><span style="color: #008080">43</span><span style="color: #000000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" />           Iterator</span><span style="color: #000000"><</span><span style="color: #000000">EuclideanIntegerPoint</span><span style="color: #000000">></span><span style="color: #000000"> ii </span><span style="color: #000000">=</span><span style="color: #000000"> li.iterator();<br /> </span><span style="color: #008080">44</span><span style="color: #000000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" /><br /> </span><span style="color: #008080">45</span><span style="color: #000000"><img id="Codehighlighter1_1183_1293_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1183_1293_Open_Text.style.display='none'; Codehighlighter1_1183_1293_Closed_Image.style.display='inline'; Codehighlighter1_1183_1293_Closed_Text.style.display='inline';" alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" /><img style="display: none" id="Codehighlighter1_1183_1293_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_1183_1293_Closed_Text.style.display='none'; Codehighlighter1_1183_1293_Open_Image.style.display='inline'; Codehighlighter1_1183_1293_Open_Text.style.display='inline';" alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" />           </span><span style="color: #0000ff">while</span><span style="color: #000000">(ii.hasNext())</span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_1183_1293_Closed_Text"><img alt="" src="http://m.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_1183_1293_Open_Text"><span style="color: #000000">{<br /> </span><span style="color: #008080">46</span><span style="color: #000000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" /><br /> </span><span style="color: #008080">47</span><span style="color: #000000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" />              EuclideanIntegerPoint eip </span><span style="color: #000000">=</span><span style="color: #000000"> ii.next();<br /> </span><span style="color: #008080">48</span><span style="color: #000000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" /><br /> </span><span style="color: #008080">49</span><span style="color: #000000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" />              System.out.print(eip</span><span style="color: #000000">+</span><span style="color: #000000">"</span><span style="color: #000000"> </span><span style="color: #000000">"</span><span style="color: #000000">);<br /> </span><span style="color: #008080">50</span><span style="color: #000000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" /><br /> </span><span style="color: #008080">51</span><span style="color: #000000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" />           }</span></span><span style="color: #000000"><br /> </span><span style="color: #008080">52</span><span style="color: #000000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" /><br /> </span><span style="color: #008080">53</span><span style="color: #000000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" />           System.out.println();<br /> </span><span style="color: #008080">54</span><span style="color: #000000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" /><br /> </span><span style="color: #008080">55</span><span style="color: #000000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" />       }</span></span><span style="color: #000000"><br /> </span><span style="color: #008080">56</span><span style="color: #000000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" /><br /> </span><span style="color: #008080">57</span><span style="color: #000000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" />    }</span></span><span style="color: #000000"><br /> </span><span style="color: #008080">58</span><span style="color: #000000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" /><br /> </span><span style="color: #008080">59</span><span style="color: #000000"><img id="Codehighlighter1_1351_1379_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1351_1379_Open_Text.style.display='none'; Codehighlighter1_1351_1379_Closed_Image.style.display='inline'; Codehighlighter1_1351_1379_Closed_Text.style.display='inline';" alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" /><img style="display: none" id="Codehighlighter1_1351_1379_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_1351_1379_Closed_Text.style.display='none'; Codehighlighter1_1351_1379_Open_Image.style.display='inline'; Codehighlighter1_1351_1379_Open_Text.style.display='inline';" alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" />    </span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_1351_1379_Closed_Text">/** */</span><span id="Codehighlighter1_1351_1379_Open_Text"><span style="color: #008000">/**</span><span style="color: #008000"><br /> </span><span style="color: #008080">60</span><span style="color: #008000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" /><br /> </span><span style="color: #008080">61</span><span style="color: #008000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" />    *</span><span style="color: #808080">@param</span><span style="color: #008000"> args<br /> </span><span style="color: #008080">62</span><span style="color: #008000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" /><br /> </span><span style="color: #008080">63</span><span style="color: #008000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" />    </span><span style="color: #008000">*/</span></span><span style="color: #000000"><br /> </span><span style="color: #008080">64</span><span style="color: #000000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" /><br /> </span><span style="color: #008080">65</span><span style="color: #000000"><img id="Codehighlighter1_1425_1537_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1425_1537_Open_Text.style.display='none'; Codehighlighter1_1425_1537_Closed_Image.style.display='inline'; Codehighlighter1_1425_1537_Closed_Text.style.display='inline';" alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" /><img style="display: none" id="Codehighlighter1_1425_1537_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_1425_1537_Closed_Text.style.display='none'; Codehighlighter1_1425_1537_Open_Image.style.display='inline'; Codehighlighter1_1425_1537_Open_Text.style.display='inline';" alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" />    </span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">static</span><span style="color: #000000"> </span><span style="color: #0000ff">void</span><span style="color: #000000"> main(String[] args) </span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_1425_1537_Closed_Text"><img alt="" src="http://m.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_1425_1537_Open_Text"><span style="color: #000000">{<br /> </span><span style="color: #008080">66</span><span style="color: #000000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" /><br /> </span><span style="color: #008080">67</span><span style="color: #000000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" />       </span><span style="color: #008000">//</span><span style="color: #008000">testHierachicalCluster();</span><span style="color: #008000"><br /> </span><span style="color: #008080">68</span><span style="color: #008000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" /></span><span style="color: #000000"><br /> </span><span style="color: #008080">69</span><span style="color: #000000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" />       testKMeansPP();<br /> </span><span style="color: #008080">70</span><span style="color: #000000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" /><br /> </span><span style="color: #008080">71</span><span style="color: #000000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" />       </span><span style="color: #008000">//</span><span style="color: #008000">testBSAS();<br /> </span><span style="color: #008080">72</span><span style="color: #008000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" /><br /> </span><span style="color: #008080">73</span><span style="color: #008000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" />       </span><span style="color: #008000">//</span><span style="color: #008000">testMBSAS();</span><span style="color: #008000"><br /> </span><span style="color: #008080">74</span><span style="color: #008000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" /></span><span style="color: #000000"><br /> </span><span style="color: #008080">75</span><span style="color: #000000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" />    }</span></span><span style="color: #000000"><br /> </span><span style="color: #008080">76</span><span style="color: #000000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" /><br /> </span><span style="color: #008080">77</span><span style="color: #000000"><img alt="" align="top" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" /></span></div> <p><br /> </span></p> <h1>3. <span style="font-family: 瀹嬩綋">灝忕粨</span></h1> <p>       <span style="font-family: 瀹嬩綋">鍒掑垎鑱氱被鏄仛綾誨垎鏋愪腑鏈甯哥敤鐨勪竴縐嶈仛綾葷畻娉曚簡錛屽浜庡叾鐮旂┒鐨勮鏂囦篃鏄濡傜墰姣涖傛劅鍏磋叮鐨勬湅鍙嬩滑瀹屽叏鍙互閫氳繃闃呰鍚勭鐩稿叧璁烘枃鏉ユ劅鍙楄繖涓綆楁硶鐨勭編濡欍傚綋鐒惰繕瑕佸啀嬈℃劅璋?/span>Apache Commons Math<span style="font-family: 瀹嬩綋">瀵逛簬璇稿甯哥敤鏁板璁$畻鐨勫疄鐜般傚浜庤仛綾誨垎鏋愮殑鎬葷粨瀛︿範鏆傛椂鍒版鍛婁竴孌佃惤錛屾渶榪戣蹇欑潃鍐欒鏂囷紝絳夎繃孌墊椂闂存湁絀哄彲浠ヨ冭檻緇х畫鑱氱被綆楁硶鐨勭爺絀跺涔犮?/span></p> <h1>4. <span style="font-family: 瀹嬩綋">鍙傝冩枃鐚強鎺ㄨ崘闃呰</span></h1> <p>[1]PatternRecognitionThird Edition, Sergios Theodoridis, Konstantinos Koutroumbas</p> <p>[2]<span style="font-family: 瀹嬩綋">妯″紡璇嗗埆絎笁鐗?/span>, Sergios Theodoridis, Konstantinos Koutroumbas<span style="font-family: 瀹嬩綋">钁?/span>, <span style="font-family: 瀹嬩綋">鏉庢櫠鐨?/span>, <span style="font-family: 瀹嬩綋">鐜嬬埍渚?/span>, <span style="font-family: 瀹嬩綋">寮犲箍婧愮瓑璇?/span></p> <p>[3]<span style="font-family: 瀹嬩綋">鏁版嵁鎸栨帢鍘熺悊</span>, David Hand and et al, <span style="font-family: 瀹嬩綋">寮犻摱濂庣瓑璇?/span></p> <p>[4]http://commons.apache.org/math/</p> <img src ="http://m.tkk7.com/changedi/aggbug/320631.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/changedi/" target="_blank">changedi</a> 2010-05-11 21:07 <a href="http://m.tkk7.com/changedi/archive/2010/05/11/320631.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鑱氱被綆楁硶瀛︿範絎旇錛堝洓錛夆斺斿眰嬈¤仛綾?/title><link>http://m.tkk7.com/changedi/archive/2010/03/19/315963.html</link><dc:creator>changedi</dc:creator><author>changedi</author><pubDate>Fri, 19 Mar 2010 12:08:00 GMT</pubDate><guid>http://m.tkk7.com/changedi/archive/2010/03/19/315963.html</guid><wfw:comment>http://m.tkk7.com/changedi/comments/315963.html</wfw:comment><comments>http://m.tkk7.com/changedi/archive/2010/03/19/315963.html#Feedback</comments><slash:comments>15</slash:comments><wfw:commentRss>http://m.tkk7.com/changedi/comments/commentRss/315963.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/changedi/services/trackbacks/315963.html</trackback:ping><description><![CDATA[     鎽樿:   1.    灞傛鑱氱被 灞傛鑱氱被綆楁硶涓庝箣鍓嶆墍璁茬殑欏哄簭鑱氱被鏈夊緢澶т笉鍚岋紝瀹冧笉鍐嶄駭鐢熷崟涓鑱氱被錛岃屾槸浜х敓涓涓仛綾誨眰嬈°傝鐧戒簡灝辨槸涓媯靛眰嬈℃爲銆備粙緇嶅眰嬈¤仛綾諱箣鍓嶏紝瑕佸厛浠嬬粛涓涓蹇?#8212;—宓屽鑱氱被銆傝鐨勭畝鍗曠偣錛岃仛綾葷殑宓屽涓庣▼搴忕殑宓屽涓鏍鳳紝涓涓仛綾諱腑R1鍖呭惈浜嗗彟涓涓猂2錛岄偅榪欏氨鏄疪2宓屽鍦≧1涓紝鎴栬呰鏄疪1宓屽浜哛2銆傚叿浣撹鎬庝箞綆楀祵濂楀憿錛熻仛綾籖1...  <a href='http://m.tkk7.com/changedi/archive/2010/03/19/315963.html'>闃呰鍏ㄦ枃</a><img src ="http://m.tkk7.com/changedi/aggbug/315963.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/changedi/" target="_blank">changedi</a> 2010-03-19 20:08 <a href="http://m.tkk7.com/changedi/archive/2010/03/19/315963.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鑱氱被綆楁硶瀛︿範絎旇錛堜笁錛夆斺旈『搴忚仛綾?/title><link>http://m.tkk7.com/changedi/archive/2010/03/06/314698.html</link><dc:creator>changedi</dc:creator><author>changedi</author><pubDate>Sat, 06 Mar 2010 07:02:00 GMT</pubDate><guid>http://m.tkk7.com/changedi/archive/2010/03/06/314698.html</guid><wfw:comment>http://m.tkk7.com/changedi/comments/314698.html</wfw:comment><comments>http://m.tkk7.com/changedi/archive/2010/03/06/314698.html#Feedback</comments><slash:comments>13</slash:comments><wfw:commentRss>http://m.tkk7.com/changedi/comments/commentRss/314698.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/changedi/services/trackbacks/314698.html</trackback:ping><description><![CDATA[<p>   </p> <h1 style="margin-left: 18pt; text-indent: -18pt">1.<span style="font: 7pt 'Times New Roman'">    </span><span style="font-family: 瀹嬩綋">欏哄簭鑱氱被</span></h1> <p style="text-indent: 21pt"><span style="font-family: 瀹嬩綋">浜嬪疄涓婏紝灝?/span>n<span style="font-family: 瀹嬩綋">涓璞★紝鑱氱被鍒?/span>k<span style="font-family: 瀹嬩綋">涓仛綾諱腑榪欎歡浜嬫湰韜槸涓涓?/span>NP<span style="font-family: 瀹嬩綋">闅鵑棶棰樸傜啛鎮夌粍鍚堟暟瀛﹀簲璇ョ煡閬撹繖涓棶棰樼殑瑙d簨絎簩綾?/span>Stirling<span style="font-family: 瀹嬩綋">鏁幫細<img alt="" src="http://m.tkk7.com/images/blogjava_net/changedi/3.2.jpg" border="0" /></span><span style="font-family: 瀹嬩綋">銆傝繖鏍烽棶棰樹篃灝卞嚭鐜頒簡錛屽鏋?/span>k<span style="font-family: 瀹嬩綋">鍊煎浐瀹氾紝閭d箞璁$畻榪樻槸鍙鐨勶紝濡傛灉</span>k<span style="font-family: 瀹嬩綋">鍊間笉鍥哄畾錛屽氨瑕佸鎵鏈夌殑鍙兘</span>k<span style="font-family: 瀹嬩綋">閮借繘琛岃綆楋紝閭h繍琛屾椂闂村彲鎯寵岀煡浜嗐傜劧鑰屽茍涓嶆槸鎵鏈夌殑鍙鑱氱被鏂規閮芥槸鍚堢悊鐨勶紝鎵璋撶殑鍚堢悊錛屾垜鐞嗚В灝辨槸璇存帴榪戜綘鐨勮仛綾葷洰鏍囩殑錛屼箣鎵浠ユ垜浠鍒嗙被錛屽繀鐒舵湁鍒濆鍔ㄦ満錛岄偅涔堝彲浠ユ牴鎹繖涓姩鏈哄埗瀹氬彲琛岀殑鑱氱被鏂規錛岃繖鏍鳳紝澶嶆潅搴︾殑闂灝卞洖閬夸簡銆?/span></p> <p style="text-indent: 21pt"><span style="font-family: 瀹嬩綋">欏哄簭綆楁硶錛?/span>sequential algorithms<span style="font-family: 瀹嬩綋">錛夋槸涓縐嶉潪甯哥畝鍗曠殑鑱氱被綆楁硶錛屽ぇ澶氭暟閮借嚦灝戝皢鎵鏈夌壒寰佸悜閲忎嬌鐢ㄤ竴嬈℃垨鍑犳錛屾渶鍚庣殑緇撴灉渚濊禆浜庡悜閲忓弬涓庣畻娉曠殑欏哄簭銆傝繖縐嶈仛綾葷畻娉曚竴鑸槸涓嶉鍏堢煡閬撹仛綾繪暟閲?/span>k<span style="font-family: 瀹嬩綋">鐨勶紝浣嗘湁鍙兘緇欏嚭涓涓仛綾繪暟涓婄晫</span>q<span style="font-family: 瀹嬩綋">銆傛湰鏂囧皢涓昏浠嬬粛鍩烘湰欏哄簭綆楁硶錛?/span>Basic Sequential Algorithmic Scheme,BSAS<span style="font-family: 瀹嬩綋">錛夊拰鍏跺嚑涓彉縐嶏紝騫剁粰鍑轟唬鐮佸疄鐜般?/span></p> <p style="text-indent: 21pt"><span style="font-family: 瀹嬩綋">棣栧厛鐪?/span>BSAS<span style="font-family: 瀹嬩綋">錛岃繖涓畻娉曟柟妗堥渶瑕佺敤鎴峰畾涔夊弬鏁幫細涓嶇浉浼兼ч槇鍊?#952;鍜屽厑璁哥殑鏈澶ц仛綾繪暟</span>q<span style="font-family: 瀹嬩綋">銆傜畻娉曠殑鍩烘湰鎬濇兂錛氱敱浜庤鑰冭檻姣忎釜鏂板悜閲忥紝鏍規嵁鍚戦噺鍒板凡鏈夎仛綾葷殑璺濈錛屽皢瀹冨垎閰嶅埌涓涓凡鏈夌殑鑱氱被涓紝鎴栬呬竴涓柊鐢熸垚鐨勮仛綾諱腑銆傜畻娉曠殑浼爜鎻忚堪濡備笅錛?/span></p> <p style="margin-left: 18pt; text-indent: -18pt"><em>1.<span style="font: 7pt 'Times New Roman'">       </span></em><em>m</em>=1   /*{<span style="font-family: 瀹嬩綋">鑱氱被鏁伴噺</span>}*/</p> <p style="margin-left: 18pt; text-indent: -18pt"><em>2.<span style="font: 7pt 'Times New Roman'">       </span></em><em>C<sub>m</sub></em>={<em><u>x</u></em><sub>1</sub>}</p> <p style="margin-left: 18pt; text-indent: -18pt"><em>3.<span style="font: 7pt 'Times New Roman'">       </span></em>For <em>i</em>=2 to <em>N</em></p> <p style="margin-left: 18pt; text-indent: -18pt"><em>4.<span style="font: 7pt 'Times New Roman'">       </span></em>    <span style="font-family: 瀹嬩綋">鎵?/span><em>C<sub>k</sub>: d</em>(<em><u>x</u><sub>i</sub>,C<sub>k</sub></em>)=<em>min</em><sub>1</sub><sub><span style="font-family: Symbol">£</span><em>j</em></sub><sub><span style="font-family: Symbol">£</span><em>m</em></sub><em>d</em>(<em><u>x</u><sub>i</sub>,C<sub>j</sub></em>)</p> <p style="margin-left: 18pt; text-indent: -18pt"><em>5.<span style="font: 7pt 'Times New Roman'">       </span></em>    If (<em>d</em>(<em><u>x</u><sub>i</sub>,C<sub>k</sub></em>)><em>Θ</em>) <em>AND </em>(<em>m</em><<em>q</em>) then</p> <p style="margin-left: 18pt; text-indent: -18pt"><em>6.<span style="font: 7pt 'Times New Roman'">       </span></em><em>        m</em>=<em>m</em>+1</p> <p style="margin-left: 18pt; text-indent: -18pt"><em>7.<span style="font: 7pt 'Times New Roman'">       </span></em><em>        C<sub>m</sub></em>={<em><u>x</u><sub>i</sub></em>}</p> <p style="margin-left: 18pt; text-indent: -18pt"><em>8.<span style="font: 7pt 'Times New Roman'">       </span></em>    Else</p> <p style="margin-left: 18pt; text-indent: -18pt"><em>9.<span style="font: 7pt 'Times New Roman'">       </span></em><em>        C<sub>k</sub></em>=<em>C<sub>k</sub></em><span style="font-family: Symbol">È</span>{<em><u>x</u><sub>i</sub></em>}</p> <p style="margin-left: 18pt; text-indent: -18pt"><em>10.<span style="font: 7pt 'Times New Roman'">   </span></em>        <span style="font-family: 瀹嬩綋">濡傛灉闇瑕侊紝鏇存柊鍚戦噺琛ㄨ揪</span></p> <p style="margin-left: 18pt; text-indent: -18pt"><em>11.<span style="font: 7pt 'Times New Roman'">   </span></em>    End {if}</p> <p style="margin-left: 18pt; text-indent: -18pt"><em>12.<span style="font: 7pt 'Times New Roman'">   </span></em>End {for}</p> <p style="text-indent: 21pt"><span style="font-family: 瀹嬩綋">鐢變笂闈㈢殑鎻忚堪鍙互鐪嬪嚭</span>BSAS<span style="font-family: 瀹嬩綋">綆楁硶瀵瑰悜閲忛『搴忛潪甯鎬緷璧栵紝鏃犺鏄仛綾繪暟閲忚繕鏄仛綾繪湰韜紝涓嶅悓鐨勫悜閲忛『搴忎細瀵艱嚧瀹屽叏涓嶅悓鐨勮仛綾葷粨鏋溿傚彟涓涓獎鍝嶈仛綾葷畻娉曠粨鏋滅殑閲嶈鍥犵礌鏄槇鍊?#952;鐨勯夋嫨錛岃繖涓肩洿鎺ュ獎鍝嶆渶緇堣仛綾葷殑鏁伴噺錛屽鏋?#952;澶皬錛屽氨浼氱敓鎴愬緢澶氫笉蹇呰鐨勮仛綾伙紝鍥犱負寰堝鎯呭喌涓嬪悜閲忎笌鑱氱被鐨勫悎騫舵潯浠墮兘鍙楀埌θ鐨勯檺鍒訛紝鑰屽鏋?#952;澶ぇ錛屽垯鑱氱被鏁伴噺鍙堜細涓嶅銆?/span>BSAS<span style="font-family: 瀹嬩綋">姣旇緝閫傚悎鑷村瘑鑱氱被錛屽叾瀵規暟鎹泦榪涜涓嬈℃壂鎻忥紝姣忔榪唬涓綆楀綋鍓嶅悜閲忎笌鑱氱被闂寸殑璺濈錛屽洜涓烘渶鍚庣殑鑱氱被鏁?/span><em>m</em><span style="font-family: 瀹嬩綋">琚涓鴻繙灝忎簬</span><em>N</em><span style="font-family: 瀹嬩綋">錛屾晠</span>BSAS<span style="font-family: 瀹嬩綋">鐨勬椂闂村鏉傚害涓?/span><em>O(N)</em><span style="font-family: 瀹嬩綋">銆?/span></p> <p style="text-indent: 21pt"><span style="font-family: 瀹嬩綋">鐢變簬</span>BSAS<span style="font-family: 瀹嬩綋">綆楁硶渚濊禆浜?/span>q<span style="font-family: 瀹嬩綋">錛屽洜姝よ繖閲屼粙緇嶄竴縐嶈嚜鍔ㄤ及璁¤仛綾繪暟</span>q<span style="font-family: 瀹嬩綋">鐨勭畝鍗曟柟娉曪紝璇ユ柟娉曚篃閫傜敤浜庡叾浠栫殑鑱氱被綆楁硶錛屼護</span><em>BSAS</em>(<em>Θ</em>)<span style="font-family: 瀹嬩綋">涓哄叿鏈夌粰瀹氫笉鐩鎬技闃堝?#952;鐨?/span>BSAS<span style="font-family: 瀹嬩綋">綆楁硶銆?/span></p> <p style="margin-left: 18pt; text-indent: -18pt">1.<span style="font: 7pt 'Times New Roman'">       </span>For <em>Θ</em>=<em>a</em> to <em>b</em> step <em>c</em></p> <p style="margin-left: 18pt; text-indent: -18pt">2.<span style="font: 7pt 'Times New Roman'">       </span>   <span style="font-family: 瀹嬩綋">綆楁硶</span><em>BSAS</em>(<em>Θ</em>)<span style="font-family: 瀹嬩綋">鎵ц</span>s<span style="font-family: 瀹嬩綋">嬈?/span><span style="font-family: 瀹嬩綋">錛屾瘡涓嬈¢兘浣跨敤涓嶅悓鐨勯『搴忚〃紺烘暟鎹?/span></p> <p style="margin-left: 18pt; text-indent: -18pt">3.<span style="font: 7pt 'Times New Roman'">       </span>   <span style="font-family: 瀹嬩綋">浼拌鑱氱被鏁幫紝</span><em>m</em><em><sub>Θ</sub></em><span style="font-family: 瀹嬩綋">浣滀負浠?/span>s<span style="font-family: 瀹嬩綋">嬈?/span><em>BSAS</em>(<em>Θ</em>)<span style="font-family: 瀹嬩綋">綆楁硶寰楁潵鐨勬渶甯稿嚭鐜扮殑鑱氱被鏁般?/span></p> <p style="margin-left: 18pt; text-indent: -18pt">4.<span style="font: 7pt 'Times New Roman'">       </span>Next <em>Θ</em></p> <p style="text-indent: 21pt"><span style="font-family: 瀹嬩綋">鍏朵腑</span>a<span style="font-family: 瀹嬩綋">鍜?/span>b<span style="font-family: 瀹嬩綋">鏄暟鎹泦鐨勬墍鏈夊悜閲忓鐨勬渶灝忓拰鏈澶т笉鐩鎬技綰у埆錛?/span>c<span style="font-family: 瀹嬩綋">鐨勯夋嫨鐩存帴鍙?/span><em>d</em>(<em><u>x</u>,C</em>)<span style="font-family: 瀹嬩綋">鐨勫獎鍝嶃?/span></p> <h1>2. <span style="font-family: 瀹嬩綋">綆楁硶瀹炵幇<br /> </span></h1> <h1> <div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><span style="color: #0000ff">package</span><span style="color: #000000"> util.clustering;<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> java.util.ArrayList;<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> java.util.Collection;<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> java.util.Iterator;<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="color: #0000ff">import</span><span style="color: #000000"> java.util.List;<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /><br /> <img id="Codehighlighter1_134_161_Open_Image" onclick="this.style.display='none'; Codehighlighter1_134_161_Open_Text.style.display='none'; Codehighlighter1_134_161_Closed_Image.style.display='inline'; Codehighlighter1_134_161_Closed_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_134_161_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_134_161_Closed_Text.style.display='none'; Codehighlighter1_134_161_Open_Image.style.display='inline'; Codehighlighter1_134_161_Open_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span><span id="Codehighlighter1_134_161_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">/** */</span><span id="Codehighlighter1_134_161_Open_Text"><span style="color: #008000">/**</span><span style="color: #008000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /> * </span><span style="color: #808080">@author</span><span style="color: #008000"> Jia Yu<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /> *<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" /> </span><span style="color: #008000">*/</span></span><span style="color: #000000"><br /> <img id="Codehighlighter1_208_2007_Open_Image" onclick="this.style.display='none'; Codehighlighter1_208_2007_Open_Text.style.display='none'; Codehighlighter1_208_2007_Closed_Image.style.display='inline'; Codehighlighter1_208_2007_Closed_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_208_2007_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_208_2007_Closed_Text.style.display='none'; Codehighlighter1_208_2007_Open_Image.style.display='inline'; Codehighlighter1_208_2007_Open_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">class</span><span style="color: #000000"> BSAS </span><span style="color: #000000"><</span><span style="color: #000000">T </span><span style="color: #0000ff">extends</span><span style="color: #000000"> Clusterable</span><span style="color: #000000"><</span><span style="color: #000000">T</span><span style="color: #000000">>></span><span style="color: #000000"> </span><span id="Codehighlighter1_208_2007_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://m.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_208_2007_Open_Text"><span style="color: #000000">{<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /><br /> <img id="Codehighlighter1_212_271_Open_Image" onclick="this.style.display='none'; Codehighlighter1_212_271_Open_Text.style.display='none'; Codehighlighter1_212_271_Closed_Image.style.display='inline'; Codehighlighter1_212_271_Closed_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_212_271_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_212_271_Closed_Text.style.display='none'; Codehighlighter1_212_271_Open_Image.style.display='inline'; Codehighlighter1_212_271_Open_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />    </span><span id="Codehighlighter1_212_271_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">/** */</span><span id="Codehighlighter1_212_271_Open_Text"><span style="color: #008000">/**</span><span style="color: #008000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />     * Basic Sequential Algorithmic Scheme<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />     * 閫傜敤浜庤嚧瀵嗚仛綾?br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />     </span><span style="color: #008000">*/</span></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />    <br /> <img id="Codehighlighter1_290_293_Open_Image" onclick="this.style.display='none'; Codehighlighter1_290_293_Open_Text.style.display='none'; Codehighlighter1_290_293_Closed_Image.style.display='inline'; Codehighlighter1_290_293_Closed_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_290_293_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_290_293_Closed_Text.style.display='none'; Codehighlighter1_290_293_Open_Image.style.display='inline'; Codehighlighter1_290_293_Open_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />    </span><span style="color: #0000ff">public</span><span style="color: #000000"> BSAS() </span><span id="Codehighlighter1_290_293_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://m.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_290_293_Open_Text"><span style="color: #000000">{<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />    }</span></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />    <br /> <img id="Codehighlighter1_298_547_Open_Image" onclick="this.style.display='none'; Codehighlighter1_298_547_Open_Text.style.display='none'; Codehighlighter1_298_547_Closed_Image.style.display='inline'; Codehighlighter1_298_547_Closed_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_298_547_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_298_547_Closed_Text.style.display='none'; Codehighlighter1_298_547_Open_Image.style.display='inline'; Codehighlighter1_298_547_Open_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />    </span><span id="Codehighlighter1_298_547_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">/** */</span><span id="Codehighlighter1_298_547_Open_Text"><span style="color: #008000">/**</span><span style="color: #008000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />     * Basic Sequential Algorithmic Scheme<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />     * 鑰冭檻鏍鋒湰絀洪棿涓瘡涓悜閲忥紝鏍規嵁鍚戦噺鍒板凡鏈夌殑鑱氱被涓績鐨勮窛紱伙紝灝嗗畠鍒嗛厤鍒頒竴涓凡鏈夎仛綾諱腑錛屾垨鑰呬竴涓柊鐢熸垚鐨勮仛綾諱腑銆?br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />     * time complexity is O(N)<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />     * BSAS綆楁硶瀵規暣涓暟鎹泦鍙繘琛屼竴嬈℃壂鎻忋?br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />     * </span><span style="color: #808080">@param</span><span style="color: #008000"> points 寰呰仛綾葷殑鍚戦噺<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />     * </span><span style="color: #808080">@param</span><span style="color: #008000"> Phi 鐢ㄦ埛瀹氫箟鐨勪笉鐩鎬技鎬ч槇鍊?br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />     * </span><span style="color: #808080">@param</span><span style="color: #008000"> q 鐢ㄦ埛瀹氫箟鐨勫厑璁哥殑鏈澶ц仛綾繪暟<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />     * </span><span style="color: #808080">@return</span><span style="color: #008000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />     </span><span style="color: #008000">*/</span></span><span style="color: #000000"><br /> <img id="Codehighlighter1_638_1839_Open_Image" onclick="this.style.display='none'; Codehighlighter1_638_1839_Open_Text.style.display='none'; Codehighlighter1_638_1839_Closed_Image.style.display='inline'; Codehighlighter1_638_1839_Closed_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_638_1839_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_638_1839_Closed_Text.style.display='none'; Codehighlighter1_638_1839_Open_Image.style.display='inline'; Codehighlighter1_638_1839_Open_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />    </span><span style="color: #0000ff">public</span><span style="color: #000000"> List</span><span style="color: #000000"><</span><span style="color: #000000">Cluster</span><span style="color: #000000"><</span><span style="color: #000000">T</span><span style="color: #000000">>></span><span style="color: #000000"> cluster(</span><span style="color: #0000ff">final</span><span style="color: #000000"> Collection</span><span style="color: #000000"><</span><span style="color: #000000">T</span><span style="color: #000000">></span><span style="color: #000000"> points,</span><span style="color: #0000ff">final</span><span style="color: #000000"> </span><span style="color: #0000ff">double</span><span style="color: #000000"> Phi,</span><span style="color: #0000ff">final</span><span style="color: #000000"> </span><span style="color: #0000ff">int</span><span style="color: #000000"> q)</span><span id="Codehighlighter1_638_1839_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://m.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_638_1839_Open_Text"><span style="color: #000000">{<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        </span><span style="color: #0000ff">int</span><span style="color: #000000"> m </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">;<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        </span><span style="color: #0000ff">int</span><span style="color: #000000"> n </span><span style="color: #000000">=</span><span style="color: #000000"> points.size();<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        </span><span style="color: #0000ff">double</span><span style="color: #000000"> disOfXandCj </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">;<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        </span><span style="color: #0000ff">double</span><span style="color: #000000"> disOfXandCk;<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        List</span><span style="color: #000000"><</span><span style="color: #000000">T</span><span style="color: #000000">></span><span style="color: #000000"> ptList </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> ArrayList</span><span style="color: #000000"><</span><span style="color: #000000">T</span><span style="color: #000000">></span><span style="color: #000000">(points);<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        Cluster</span><span style="color: #000000"><</span><span style="color: #000000">T</span><span style="color: #000000">></span><span style="color: #000000"> C </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> Cluster</span><span style="color: #000000"><</span><span style="color: #000000">T</span><span style="color: #000000">></span><span style="color: #000000">(ptList.get(m));<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        C.addPoint(ptList.get(m));<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        Cluster</span><span style="color: #000000"><</span><span style="color: #000000">T</span><span style="color: #000000">></span><span style="color: #000000"> Ck </span><span style="color: #000000">=</span><span style="color: #000000"> C;<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        List</span><span style="color: #000000"><</span><span style="color: #000000">Cluster</span><span style="color: #000000"><</span><span style="color: #000000">T</span><span style="color: #000000">></span><span style="color: #000000"> </span><span style="color: #000000">></span><span style="color: #000000"> cList </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> ArrayList</span><span style="color: #000000"><</span><span style="color: #000000">Cluster</span><span style="color: #000000"><</span><span style="color: #000000">T</span><span style="color: #000000">></span><span style="color: #000000"> </span><span style="color: #000000">></span><span style="color: #000000">();<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        cList.add(C);<br /> <img id="Codehighlighter1_965_1820_Open_Image" onclick="this.style.display='none'; Codehighlighter1_965_1820_Open_Text.style.display='none'; Codehighlighter1_965_1820_Closed_Image.style.display='inline'; Codehighlighter1_965_1820_Closed_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_965_1820_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_965_1820_Closed_Text.style.display='none'; Codehighlighter1_965_1820_Open_Image.style.display='inline'; Codehighlighter1_965_1820_Open_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />        </span><span style="color: #0000ff">for</span><span style="color: #000000">(</span><span style="color: #0000ff">int</span><span style="color: #000000"> i</span><span style="color: #000000">=</span><span style="color: #000000">1</span><span style="color: #000000">;i</span><span style="color: #000000"><</span><span style="color: #000000">n;i</span><span style="color: #000000">++</span><span style="color: #000000">)</span><span id="Codehighlighter1_965_1820_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://m.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_965_1820_Open_Text"><span style="color: #000000">{<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />            disOfXandCk </span><span style="color: #000000">=</span><span style="color: #000000"> Double.MAX_VALUE;<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />            Iterator</span><span style="color: #000000"><</span><span style="color: #000000">Cluster</span><span style="color: #000000"><</span><span style="color: #000000">T</span><span style="color: #000000">></span><span style="color: #000000"> </span><span style="color: #000000">></span><span style="color: #000000"> cListIt </span><span style="color: #000000">=</span><span style="color: #000000"> cList.iterator(); <br /> <img id="Codehighlighter1_1083_1272_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1083_1272_Open_Text.style.display='none'; Codehighlighter1_1083_1272_Closed_Image.style.display='inline'; Codehighlighter1_1083_1272_Closed_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_1083_1272_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_1083_1272_Closed_Text.style.display='none'; Codehighlighter1_1083_1272_Open_Image.style.display='inline'; Codehighlighter1_1083_1272_Open_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />            </span><span style="color: #0000ff">while</span><span style="color: #000000">(cListIt.hasNext())</span><span id="Codehighlighter1_1083_1272_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://m.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_1083_1272_Open_Text"><span style="color: #000000">{<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />                Cluster</span><span style="color: #000000"><</span><span style="color: #000000">T</span><span style="color: #000000">></span><span style="color: #000000"> Cj </span><span style="color: #000000">=</span><span style="color: #000000"> cListIt.next();<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />                disOfXandCj </span><span style="color: #000000">=</span><span style="color: #000000"> getDisOfPointAndCluster(ptList.get(i),Cj);<br /> <img id="Codehighlighter1_1215_1267_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1215_1267_Open_Text.style.display='none'; Codehighlighter1_1215_1267_Closed_Image.style.display='inline'; Codehighlighter1_1215_1267_Closed_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_1215_1267_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_1215_1267_Closed_Text.style.display='none'; Codehighlighter1_1215_1267_Open_Image.style.display='inline'; Codehighlighter1_1215_1267_Open_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />                </span><span style="color: #0000ff">if</span><span style="color: #000000">(disOfXandCk </span><span style="color: #000000">></span><span style="color: #000000"> disOfXandCj)</span><span id="Codehighlighter1_1215_1267_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://m.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_1215_1267_Open_Text"><span style="color: #000000">{<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />                    disOfXandCk </span><span style="color: #000000">=</span><span style="color: #000000"> disOfXandCj;<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />                    Ck </span><span style="color: #000000">=</span><span style="color: #000000"> Cj;<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />                }</span></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />            }</span></span><span style="color: #000000"><br /> <img id="Codehighlighter1_1307_1441_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1307_1441_Open_Text.style.display='none'; Codehighlighter1_1307_1441_Closed_Image.style.display='inline'; Codehighlighter1_1307_1441_Closed_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_1307_1441_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_1307_1441_Closed_Text.style.display='none'; Codehighlighter1_1307_1441_Open_Image.style.display='inline'; Codehighlighter1_1307_1441_Open_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />            </span><span style="color: #0000ff">if</span><span style="color: #000000">(disOfXandCk </span><span style="color: #000000">></span><span style="color: #000000"> Phi </span><span style="color: #000000">&&</span><span style="color: #000000"> m </span><span style="color: #000000"><</span><span style="color: #000000"> q)</span><span id="Codehighlighter1_1307_1441_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://m.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_1307_1441_Open_Text"><span style="color: #000000">{            </span><span style="color: #008000">//</span><span style="color: #008000">涓嶆弧瓚蟲潯浠訛紝鍒欎駭鐢熸柊鐨勮仛綾?/span><span style="color: #008000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="color: #000000">                m</span><span style="color: #000000">++</span><span style="color: #000000">;<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />                Cluster</span><span style="color: #000000"><</span><span style="color: #000000">T</span><span style="color: #000000">></span><span style="color: #000000"> cm </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> Cluster</span><span style="color: #000000"><</span><span style="color: #000000">T</span><span style="color: #000000">></span><span style="color: #000000">(ptList.get(i));<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />                cm.addPoint(ptList.get(i));<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />                cList.add(cm);<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />            }</span></span><span style="color: #000000"><br /> <img id="Codehighlighter1_1450_1816_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1450_1816_Open_Text.style.display='none'; Codehighlighter1_1450_1816_Closed_Image.style.display='inline'; Codehighlighter1_1450_1816_Closed_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_1450_1816_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_1450_1816_Closed_Text.style.display='none'; Codehighlighter1_1450_1816_Open_Image.style.display='inline'; Codehighlighter1_1450_1816_Open_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />            </span><span style="color: #0000ff">else</span><span id="Codehighlighter1_1450_1816_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://m.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_1450_1816_Open_Text"><span style="color: #000000">{            </span><span style="color: #008000">//</span><span style="color: #008000">婊¤凍鏉′歡鐨勫皢鐐瑰姞鍏ュ凡鏈夎仛綾伙紝騫舵洿鏂拌仛綾諱腑蹇?/span><span style="color: #008000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="color: #000000">                </span><span style="color: #0000ff">if</span><span style="color: #000000">(cList.contains(Ck))<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />                    cList.remove(Ck);<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />                Ck.addPoint(ptList.get(i));<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />                </span><span style="color: #0000ff">final</span><span style="color: #000000"> T newCenter </span><span style="color: #000000">=</span><span style="color: #000000"> Ck.getCenter().centroidOf(Ck.getPoints());<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />                Cluster</span><span style="color: #000000"><</span><span style="color: #000000">T</span><span style="color: #000000">></span><span style="color: #000000"> tempCluster </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> Cluster</span><span style="color: #000000"><</span><span style="color: #000000">T</span><span style="color: #000000">></span><span style="color: #000000">(newCenter);<br /> <img id="Codehighlighter1_1727_1783_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1727_1783_Open_Text.style.display='none'; Codehighlighter1_1727_1783_Closed_Image.style.display='inline'; Codehighlighter1_1727_1783_Closed_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_1727_1783_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_1727_1783_Closed_Text.style.display='none'; Codehighlighter1_1727_1783_Open_Image.style.display='inline'; Codehighlighter1_1727_1783_Open_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />                </span><span style="color: #0000ff">for</span><span style="color: #000000">(</span><span style="color: #0000ff">int</span><span style="color: #000000"> j</span><span style="color: #000000">=</span><span style="color: #000000">0</span><span style="color: #000000">;j</span><span style="color: #000000"><</span><span style="color: #000000">Ck.getPoints().size();j</span><span style="color: #000000">++</span><span style="color: #000000">)</span><span id="Codehighlighter1_1727_1783_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://m.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_1727_1783_Open_Text"><span style="color: #000000">{<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />                    tempCluster.addPoint(Ck.getPoints().get(j));<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />                }</span></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />                cList.add(tempCluster);<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />            }</span></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />        }</span></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        </span><span style="color: #0000ff">return</span><span style="color: #000000"> cList;<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />    }</span></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /><br /> <img id="Codehighlighter1_1843_1898_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1843_1898_Open_Text.style.display='none'; Codehighlighter1_1843_1898_Closed_Image.style.display='inline'; Codehighlighter1_1843_1898_Closed_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_1843_1898_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_1843_1898_Closed_Text.style.display='none'; Codehighlighter1_1843_1898_Open_Image.style.display='inline'; Codehighlighter1_1843_1898_Open_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />    </span><span id="Codehighlighter1_1843_1898_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">/** */</span><span id="Codehighlighter1_1843_1898_Open_Text"><span style="color: #008000">/**</span><span style="color: #008000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />     * 閫夋嫨涓嶅悓鐨勬祴搴︼紝鏈変笉鍚岀殑綆楁硶銆?br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />     * 榪欓噷榛樿dis(x,C)涓虹偣鍒拌仛綾諱腑蹇冪殑璺濈銆?br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />     </span><span style="color: #008000">*/</span></span><span style="color: #000000"><br /> <img id="Codehighlighter1_1960_2004_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1960_2004_Open_Text.style.display='none'; Codehighlighter1_1960_2004_Closed_Image.style.display='inline'; Codehighlighter1_1960_2004_Closed_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_1960_2004_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_1960_2004_Closed_Text.style.display='none'; Codehighlighter1_1960_2004_Open_Image.style.display='inline'; Codehighlighter1_1960_2004_Open_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />    </span><span style="color: #0000ff">private</span><span style="color: #000000"> </span><span style="color: #0000ff">double</span><span style="color: #000000"> getDisOfPointAndCluster(T t, Cluster</span><span style="color: #000000"><</span><span style="color: #000000">T</span><span style="color: #000000">></span><span style="color: #000000"> cj) </span><span id="Codehighlighter1_1960_2004_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://m.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_1960_2004_Open_Text"><span style="color: #000000">{<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        </span><span style="color: #0000ff">return</span><span style="color: #000000"> t.distanceFrom(cj.getCenter());<br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />    }</span></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" /><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />}</span></span><span style="color: #000000"><br /> <img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" /></span></div> </h1> <h1>3. <span style="font-family: 瀹嬩綋">紼嬪簭妗嗘灦</span></h1> <p>       <span style="font-family: 瀹嬩綋">鎴戠殑鑱氱被紼嬪簭涓昏鎵╁睍鑷?/span>Apache Commons Math<span style="font-family: 瀹嬩綋">寮婧愭鏋訛紝涓嬮潰鏄叾緇撴瀯錛屾垜綆鍗曞姞鍏ヤ簡</span>Clusterer<span style="font-family: 瀹嬩綋">綾諱綔涓烘娊璞℃ā鏉跨被錛屼嬌鐢ㄦā鏉挎柟娉曟ā寮忎慨鏀逛簡妗嗘灦錛屼負鍚庣畫鍔犲叆鐨勪緥濡?/span>BSAS<span style="font-family: 瀹嬩綋">綆楁硶鎻愪緵妯℃澘銆?br /> </span></p> <h1> <div align="center"><img alt="" src="http://m.tkk7.com/images/blogjava_net/changedi/1.png" border="0" /></div> </h1> <h1>4. <span style="font-family: 瀹嬩綋">灝忕粨</span></h1> <p>       <span style="font-family: 瀹嬩綋">欏哄簭綆楁硶綆鍗曟槗瀹炵幇錛屽浜庡涔犺仛綾繪潵璇存槸鍏ラ棬鐨勬渶濂介夋嫨錛岃冭檻鍒扮瘒騫呯殑闄愬埗錛屼笉鑳藉皢浠g爜鍏ㄩ儴鍙戜笂鏉ワ紝濡傛灉鏈夐渶瑕佸彲浠ュ悜鎴戠儲瑕侊紝</span>Apache Commons Math<span style="font-family: 瀹嬩綋">妗嗘灦鍙互鍒?/span>Apache<span style="font-family: 瀹嬩綋">鐨勭綉绔欎笂涓嬭澆銆傚彟澶栬繕鏈夊緢澶氫粙緇嶄笉澶熻緇嗭紝鎰熷叴瓚g殑鏈嬪弸鍙互緇х畫娣卞叆鐮旂┒</span>BSAS<span style="font-family: 瀹嬩綋">鐨勬墿灞曘?/span></p> <h1>5. <span style="font-family: 瀹嬩綋">鍙傝冩枃鐚強鎺ㄨ崘闃呰</span></h1> <p>[1]Pattern Recognition Third Edition, Sergios Theodoridis, Konstantinos Koutroumbas </p> <p>[2]<span style="font-family: 瀹嬩綋">妯″紡璇嗗埆</span><span style="font-family: 瀹嬩綋">絎笁鐗?/span>, Sergios Theodoridis, Konstantinos Koutroumbas<span style="font-family: 瀹嬩綋">钁?/span>, <span style="font-family: 瀹嬩綋">鏉庢櫠鐨?/span>, <span style="font-family: 瀹嬩綋">鐜嬬埍渚?/span>, <span style="font-family: 瀹嬩綋">寮犲箍婧愮瓑璇?/span></p> <img src ="http://m.tkk7.com/changedi/aggbug/314698.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/changedi/" target="_blank">changedi</a> 2010-03-06 15:02 <a href="http://m.tkk7.com/changedi/archive/2010/03/06/314698.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鑱氱被綆楁硶瀛︿範絎旇錛堜簩錛夆斺旇繎閭繪祴搴?/title><link>http://m.tkk7.com/changedi/archive/2010/01/17/309845.html</link><dc:creator>changedi</dc:creator><author>changedi</author><pubDate>Sun, 17 Jan 2010 05:10:00 GMT</pubDate><guid>http://m.tkk7.com/changedi/archive/2010/01/17/309845.html</guid><wfw:comment>http://m.tkk7.com/changedi/comments/309845.html</wfw:comment><comments>http://m.tkk7.com/changedi/archive/2010/01/17/309845.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/changedi/comments/commentRss/309845.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/changedi/services/trackbacks/309845.html</trackback:ping><description><![CDATA[  <h1 style="margin-left: 18pt; text-indent: -18pt">1.<span style="font: 7pt 'Times New Roman'">    </span><span style="font-family: 瀹嬩綋">嫻嬪害瀹氫箟</span></h1> <p style="text-indent: 21pt"><span style="font-family: 瀹嬩綋">“鏁板涓婏紝嫻嬪害</span>(Measure)<span style="font-family: 瀹嬩綋">鏄竴涓嚱鏁幫紝瀹冨涓涓粰瀹氶泦鍚堢殑鏌愪簺瀛愰泦鎸囧畾涓涓暟錛岃繖涓暟鍙互姣斾綔澶у皬銆佷綋縐佹鐜囩瓑絳夈備紶緇熺殑縐垎鏄湪鍖洪棿涓婅繘琛岀殑錛屽悗鏉ヤ漢浠笇鏈涙妸縐垎鎺ㄥ箍鍒頒換鎰忕殑闆嗗悎涓婏紝灝卞彂灞曞嚭嫻嬪害鐨勬蹇碉紝瀹冨湪鏁板鍒嗘瀽鍜屾鐜囪鏈夐噸瑕佺殑鍦頒綅”</span>                                          <span style="font-family: 瀹嬩綋">鈥斺?/span>wikipedia</p> <p style="text-indent: 21pt"><span style="font-family: 瀹嬩綋">鑱氱被涔嬪墠涓瀹氳瀹氫箟濂藉悜閲忎箣闂寸殑鐩鎬技紼嬪害鈥斺斿嵆榪戦偦嫻嬪害銆傚湪鑱氱被榪囩▼涓垜浠嬌鐢ㄧ殑嫻嬪害錛岃寖鍥磋鏇村箍娉涳紝棣栧厛瀹氫箟鍚戦噺涔嬮棿鐨勬祴搴︼紝鎺ョ潃灝辨槸闆嗗悎涓庡悜閲忥紝闆嗗悎涔嬮棿鐨勬祴搴︺?/span></p> <p style="text-indent: 21pt"><span style="font-family: 瀹嬩綋">瀵逛簬</span>X<span style="font-family: 瀹嬩綋">涓婄殑<strong>涓嶇浉浼兼祴搴?/strong></span>(Dissimilarity Measure, DM) <em>d</em> <span style="font-family: 瀹嬩綋">鏄竴涓嚱鏁幫細<img height="29" alt="" src="http://m.tkk7.com/images/blogjava_net/changedi/1.JPG" width="129" border="0" /></span> <span style="font-family: 瀹嬩綋">鍏朵腑</span>R<span style="font-family: 瀹嬩綋">鏄疄鏁伴泦鍚堬紝濡傛灉</span><em>d</em><span style="font-family: 瀹嬩綋">鏈変互涓嬬殑灞炴э細</span></p> <p style="text-indent: 21pt; text-align: center" align="center"><img height="29" alt="" src="http://m.tkk7.com/images/blogjava_net/changedi/1.1.JPG" width="366" border="0" />     <span style="font-family: 瀹嬩綋">錛?/span>1.1<span style="font-family: 瀹嬩綋">錛?/span></p> <p style="text-indent: 21pt; text-align: center" align="center"><img height="28" alt="" src="http://m.tkk7.com/images/blogjava_net/changedi/1.2.JPG" width="165" border="0" />               <span style="font-family: 瀹嬩綋">錛?/span>1.2<span style="font-family: 瀹嬩綋">錛?/span></p> <p style="text-indent: 21pt; text-align: center" align="center"><img height="28" alt="" src="http://m.tkk7.com/images/blogjava_net/changedi/1.3.JPG" width="220" border="0" />               <span style="font-family: 瀹嬩綋">錛?/span>1.3<span style="font-family: 瀹嬩綋">錛?/span></p> <p style="text-indent: 21pt"><span style="font-family: 瀹嬩綋">濡傛灉鍙堟弧瓚?/span></p> <p style="text-indent: 21pt; text-align: center" align="center"><img height="32" alt="" src="http://m.tkk7.com/images/blogjava_net/changedi/1.4.JPG" width="240" border="0" />                 <span style="font-family: 瀹嬩綋">錛?/span>1.4<span style="font-family: 瀹嬩綋">錛?/span></p> <p style="text-indent: 21pt; text-align: center" align="center"><img height="28" alt="" src="http://m.tkk7.com/images/blogjava_net/changedi/1.5.JPG" width="302" border="0" />                <span style="font-family: 瀹嬩綋">錛?/span>1.5<span style="font-family: 瀹嬩綋">錛?/span></p> <p style="text-indent: 21pt"><span style="font-family: 瀹嬩綋">閭d箞</span><em>d</em><span style="font-family: 瀹嬩綋">琚О涓哄害閲?/span>DM<span style="font-family: 瀹嬩綋">銆傚叾涓殑鍏紡錛?/span>1.5<span style="font-family: 瀹嬩綋">錛変篃鍙笁瑙掍笉絳夊紡銆傜◢紼嶈В閲婁竴涓嬶紙鍏跺疄澶ソ鐞嗚В浜嗭級錛屼笉鐩鎬技鎬ф祴搴﹀叾瀹炲氨鍍忔垜浠鐨勮窛紱諱竴鏍鳳紝涓や釜鍚戦噺浠h〃涓や釜瀵硅薄濂戒簡銆傚叕寮?/span>1.2<span style="font-family: 瀹嬩綋">瀹氫箟錛堝悜閲忥級瀵硅薄鑷繁鍜岃嚜宸辯殑璺濈鏄?/span><em>d<sub>0</sub></em><span style="font-family: 瀹嬩綋">錛涘叕寮?/span>1.1<span style="font-family: 瀹嬩綋">璇存槑浜嗕換鎰忎袱涓璞′箣闂寸殑璺濈瑕佸皬浜庢鏃犵┓鍗村ぇ浜庤嚜宸卞拰鑷繁鐨勮窛紱伙紙浣犲拰鍒漢鐨勮窛紱誨ぇ浜庝綘鍜岃嚜宸辯殑璺濈錛岃繖涓嶅簾璇濆悧錛撅伎錛撅級錛涘叕寮?/span>1.3<span style="font-family: 瀹嬩綋">璇存槑璺濈鐨勪氦浜掓э紱鍏紡</span>1.4<span style="font-family: 瀹嬩綋">涓嶈В閲婁簡錛屽叕寮?/span>1.5<span style="font-family: 瀹嬩綋">灝辨槸涓夎涓嶇瓑寮忥紙鍒濅腑姘村鉤錛夈?/span></p> <p style="text-indent: 21pt"><span style="font-family: 瀹嬩綋">鍚岀悊<strong>鐩鎬技鎬ф祴搴?/strong></span>(Similarity Measure, SM)<span style="font-family: 瀹嬩綋">瀹氫箟涓?img style="width: 128px; height: 29px" height="29" alt="" src="http://m.tkk7.com/images/blogjava_net/changedi/1.0.JPG" width="128" border="0" /></span><span style="font-family: 瀹嬩綋">婊¤凍錛?/span></p> <p style="text-indent: 21pt; text-align: center" align="center"><img height="28" alt="" src="http://m.tkk7.com/images/blogjava_net/changedi/1.6.JPG" width="358" border="0" />         <span style="font-family: 瀹嬩綋">錛?/span>1.6<span style="font-family: 瀹嬩綋">錛?/span></p> <p style="text-indent: 21pt; text-align: center" align="center"><img height="28" alt="" src="http://m.tkk7.com/images/blogjava_net/changedi/1.7.JPG" width="164" border="0" />        <span style="font-family: 瀹嬩綋">錛?/span>1.7<span style="font-family: 瀹嬩綋">錛?/span></p> <p style="text-indent: 21pt; text-align: center" align="center"><img height="28" alt="" src="http://m.tkk7.com/images/blogjava_net/changedi/1.8.JPG" width="218" border="0" />         <span style="font-family: 瀹嬩綋">錛?/span>1.8<span style="font-family: 瀹嬩綋">錛?/span></p> <p style="text-indent: 21pt"><span style="font-family: 瀹嬩綋">濡傛灉鍙堟弧瓚?/span></p> <p style="text-indent: 21pt; text-align: center" align="center"><img height="32" alt="" src="http://m.tkk7.com/images/blogjava_net/changedi/1.9.JPG" width="213" border="0" />          <span style="font-family: 瀹嬩綋">錛?/span>1.9<span style="font-family: 瀹嬩綋">錛?/span></p> <p style="text-indent: 21pt; text-align: center" align="center"><img height="28" alt="" src="http://m.tkk7.com/images/blogjava_net/changedi/1.10.JPG" width="406" border="0" />           <span style="font-family: 瀹嬩綋">錛?/span>1.10<span style="font-family: 瀹嬩綋">錛?/span></p> <p style="text-indent: 21pt"><span style="font-family: 瀹嬩綋">灝辨妸</span><em>s</em><span style="font-family: 瀹嬩綋">鍙仛搴﹂噺</span>SM<span style="font-family: 瀹嬩綋">銆傚叿浣撳悓</span>DM<span style="font-family: 瀹嬩綋">錛屽悇鍏紡鐨勮〃杈句竴鐩簡鐒跺摝</span>~~~</p> <p style="text-indent: 21pt"><span style="font-family: 瀹嬩綋">浠庡畾涔夊拰瀛楅潰涓婃垜浠兘鍙互鐪嬪嚭浜岃呯殑涓嶅悓錛屽湪琛ㄨ揪鐩鎬技鎬ф椂涓よ呴兘鍙互錛屽彧涓嶈繃搴﹂噺鐨勮搴︿笉鍚岋紝瀵逛簬鍒ゅ埆鐩鎬技錛?/span>DM<span style="font-family: 瀹嬩綋">瓚婂ぇ璇存槑瓚婁笉鐩鎬技錛岃秺灝忓垯瓚婄浉浼鹼紝鑰?/span>SM<span style="font-family: 瀹嬩綋">鍗存濂界浉鍙嶏紝鍥犳鎴戜滑涔熷彲浠ヨ仈鎯籌紝</span>DM<span style="font-family: 瀹嬩綋">涓?/span>SM<span style="font-family: 瀹嬩綋">鍙互鍒╃敤榪欑瀵圭珛鍏崇郴鏉ュ畾涔夈備婦渚嬫潵璇達紝濡傛灉</span><em>d</em><span style="font-family: 瀹嬩綋">鏄竴涓?/span>DM<span style="font-family: 瀹嬩綋">錛岄偅涔?/span><em>s=</em>1/<em>d</em><span style="font-family: 瀹嬩綋">灝辨槸涓涓?/span>SM<span style="font-family: 瀹嬩綋">銆?/span></p> <h1>2. <span style="font-family: 瀹嬩綋">鍚戦噺涔嬮棿鐨勮繎閭繪祴搴?/span></h1> <p style="text-indent: 21pt"><span style="font-family: 瀹嬩綋">涓婇潰鐨勫畾涔夊彧鏄竴涓畯瑙傜殑姒傛嫭錛岄偅涔堝叿浣撶殑鍚戦噺涔嬮棿鐨勬祴搴﹀浣曡綆楀憿錛熶笅闈㈠皢璇︾粏鐨勪粙緇嶃?/span></p> <p style="text-indent: 21pt"><span style="font-family: 瀹嬩綋">棣栧厛瀵逛簬瀹炲悜閲忕殑涓嶇浉浼兼祴搴︼紝瀹為檯搴旂敤涓渶閫氱敤鐨勫氨鏄?strong>鍔犳潈</strong></span><strong><em>l<sub>p</sub></em></strong><strong><span style="font-family: 瀹嬩綋">搴﹂噺</span></strong><span style="font-family: 瀹嬩綋">浜嗭細</span></p> <p style="text-indent: 21pt; text-align: center" align="center"><img height="48" alt="" src="http://m.tkk7.com/images/blogjava_net/changedi/2.1.JPG" width="242" border="0" />          <span style="font-family: 瀹嬩綋">錛?/span>2.1<span style="font-family: 瀹嬩綋">錛?/span></p> <p style="text-indent: 21pt"><span style="font-family: 瀹嬩綋">鍏朵腑鐨?/span><em>x<sub>i</sub></em><span style="font-family: 瀹嬩綋">鍜?/span><em>y<sub>i</sub></em><span style="font-family: 瀹嬩綋">鍒嗗埆鏄悜閲?/span><em><u>x</u></em><span style="font-family: 瀹嬩綋">鍜?/span><em><u>y</u></em><span style="font-family: 瀹嬩綋">涓殑絎?/span><em>i</em><span style="font-family: 瀹嬩綋">涓鹼紝</span><em>w<sub>i</sub></em><span style="font-family: 瀹嬩綋">鏄</span><em>i</em><span style="font-family: 瀹嬩綋">涓潈閲嶇郴鏁幫紝</span><em>l</em><span style="font-family: 瀹嬩綋">鏄悜閲忕殑緇存暟錛堜互涓嬪叕寮忓畾涔夊悓錛夈傝屾垜浠瘮杈冩劅鍏磋叮鐨勫氨鏄綋</span>p=1<span style="font-family: 瀹嬩綋">鏃訛紝璇ュ害閲忓氨鏄姞鏉?/span>Manhattan<span style="font-family: 瀹嬩綋">鑼冩暟錛岃屽綋</span>p=2<span style="font-family: 瀹嬩綋">鏃跺氨鏄姞鏉冩鍑犻噷寰楄寖鏁幫紝褰?/span>p=<span style="font-family: 瀹嬩綋">∞</span><span style="font-family: 瀹嬩綋">鏃跺氨鏄?/span>max<em><sub>1</sub></em><sub><span style="font-family: Symbol">£</span></sub><em><sub>i</sub></em><sub><span style="font-family: Symbol">£</span></sub><em><sub>l</sub></em> <em>w<sub>i</sub></em>|<em>x<sub>i</sub>-y<sub>i</sub></em>|<span style="font-family: 瀹嬩綋">浜嗐傛牴鎹繖浜?/span>DM<span style="font-family: 瀹嬩綋">錛屾垜浠畾涔?/span>SM<span style="font-family: 瀹嬩綋">涓?/span><em>b<sub>max </sub>- d<sub>p</sub>(<u>x</u>,<u>y</u>)</em><span style="font-family: 瀹嬩綋">銆?/span></p> <p style="text-indent: 21pt"><span style="font-family: 瀹嬩綋">鍙﹀榪樻湁涓浜涘叾浠栫殑瀹氫箟鏂規硶錛屾瘮濡?/span></p> <p style="text-indent: 21pt; text-align: center" align="center"><img height="54" alt="" src="http://m.tkk7.com/images/blogjava_net/changedi/2.2.JPG" width="288" border="0" />            <span style="font-family: 瀹嬩綋">錛?/span>2.2<span style="font-family: 瀹嬩綋">錛?/span></p> <p style="text-indent: 21pt; text-align: center" align="center"><img height="62" alt="" src="http://m.tkk7.com/images/blogjava_net/changedi/2.3.JPG" width="213" border="0" />          <span style="font-family: 瀹嬩綋">錛?/span>2.3<span style="font-family: 瀹嬩綋">錛?/span></p> <p style="text-indent: 21pt"><span style="font-family: 瀹嬩綋">鍏朵粬鎳掑緱鍒楀嚭浜嗭紝鍏堟煡闃呰祫鏂欙紝榪欓噷涓嶈榪頒簡銆?/span></p> <p style="text-indent: 21pt"><span style="font-family: 瀹嬩綋">瀵逛簬瀹炲悜閲忕殑鐩鎬技鎬ф祴搴︼紝瀹為檯涓父鐢ㄧ殑鏈夛細</span></p> <p style="text-indent: 21pt; text-align: center" align="center"><span style="font-family: 瀹嬩綋">鍐呯Н錛?img height="48" alt="" src="http://m.tkk7.com/images/blogjava_net/changedi/2.4.JPG" width="208" border="0" /></span>          <span style="font-family: 瀹嬩綋">錛?/span>2.4<span style="font-family: 瀹嬩綋">錛?/span></p> <p style="text-indent: 21pt; text-align: center" align="center"><em>Tanimoto</em><span style="font-family: 瀹嬩綋">嫻嬪害錛?img height="57" alt="" src="http://m.tkk7.com/images/blogjava_net/changedi/2.5.JPG" width="261" border="0" /></span>           <span style="font-family: 瀹嬩綋">錛?/span>2.5<span style="font-family: 瀹嬩綋">錛?/span></p> <p style="text-indent: 21pt; text-align: center" align="center"><span style="font-family: 瀹嬩綋">鍏朵粬錛?img height="50" alt="" src="http://m.tkk7.com/images/blogjava_net/changedi/2.6.JPG" width="229" border="0" /></span>           <span style="font-family: 瀹嬩綋">錛?/span>2.6<span style="font-family: 瀹嬩綋">錛?/span></p> <p style="text-indent: 21pt" align="center">------------------------------------------------take a nap------------------------------------------------------------</p> <p style="text-indent: 21pt"><span style="font-family: 瀹嬩綋">瀵逛簬紱繪暎鍊肩殑鍚戦噺錛岄鍏堝繀欏昏鎼炴竻妤氫竴涓蹇碉紝榪欓噷鍦ㄣ婃ā寮忚瘑鍒嬬殑涓枃璇戜綔涓垜鎰熻緲昏瘧鐨勫茍涓嶅ソ鐞嗚В錛屾墍浠ヨ繖閲屽睍寮璇存槑涓涓嬶紝閭e氨鏄竴涓彨鍋氱浉渚濊〃</span>(contingency table)<span style="font-family: 瀹嬩綋">鐨勬蹇點傚浜庝竴涓悜閲?/span><em><u>x</u></em><span style="font-family: 瀹嬩綋">錛屽叾鍏冪礌鍊煎睘浜庢湁闄愰泦</span><em>F=</em>{0<em>,</em>1<em>,…,k</em>-1}<span style="font-family: 瀹嬩綋">錛屽叾涓?/span>k<span style="font-family: 瀹嬩綋">鏄鏁存暟銆備護</span><em>A</em>(<em><u>x</u>,<u>y</u></em>)=[<em>a<sub>ij</sub></em>]<em>, i, j</em>=0<em>,</em>1<em>,…,k</em>-1<span style="font-family: 瀹嬩綋">鏄竴涓?/span><em>k</em><span style="font-family: 瀹嬩綋">闃舵柟闃碉紝鍏朵腑鍏冪礌</span><em>a<sub>ij</sub></em><span style="font-family: 瀹嬩綋">浠h〃鍦?/span><em><u>x</u></em><span style="font-family: 瀹嬩綋">涓墍鏈?/span><em>i</em><span style="font-family: 瀹嬩綋">鍊兼墍鍦ㄧ殑浣嶇疆鍦?/span><em><u>y</u></em><span style="font-family: 瀹嬩綋">鐨勫悓鏍蜂綅緗湁</span><em>j</em><span style="font-family: 瀹嬩綋">鍊肩殑涓暟銆傞檮鍘熸枃錛?/span>the number of places where <em><u>x</u></em> has the <em>i</em>-th symbol and <em><u>y</u></em> has the <em>j</em>-th symbol<span style="font-family: 瀹嬩綋">銆備婦渚嬫潵璇村惂錛?/span><em>k</em>=3<span style="font-family: 瀹嬩綋">錛屼笖</span><em><u>x</u></em>=[0,1,2,1,2,1]<span style="font-family: 瀹嬩綋">錛?/span><em><u>y</u></em>=[1,0,2,1,0,1]<span style="font-family: 瀹嬩綋">錛岄偅涔?/span><em>A(<u>x</u>,<u>y</u>)</em> = [0 1 0, 1 2 0, 1 0 1]<span style="font-family: 瀹嬩綋">銆備互絎竴涓?/span>0(<em>a<sub>00</sub></em>)<span style="font-family: 瀹嬩綋">涓轟緥璇存槑錛?/span>0<span style="font-family: 瀹嬩綋">鍦?/span><em>A</em><span style="font-family: 瀹嬩綋">涓殑浣嶇疆鍐沖畾</span><em>i</em>=0<span style="font-family: 瀹嬩綋">錛?/span><em>j</em>=0<span style="font-family: 瀹嬩綋">錛屽湪</span><em><u>x</u></em><span style="font-family: 瀹嬩綋">涓?/span>0<span style="font-family: 瀹嬩綋">鎵鍦ㄧ殑浣嶇疆鏄涓涓綅緗紝鑰?/span><em><u>y</u></em><span style="font-family: 瀹嬩綋">涓?/span>0<span style="font-family: 瀹嬩綋">鎵鍦ㄧ殑浣嶇疆涓虹浜屼釜鍜岀浜斾釜錛屼袱涓悜閲忎腑娌℃湁鐩稿悓浣嶇疆涓婄殑鐩稿悓</span>0<span style="font-family: 瀹嬩綋">鍏冪礌錛屽洜姝?/span><em>A</em><span style="font-family: 瀹嬩綋">涓涓涓厓绱?/span><em>a<sub>00</sub></em><span style="font-family: 瀹嬩綋">涓?/span>0<span style="font-family: 瀹嬩綋">錛岃?/span><em>A</em><span style="font-family: 瀹嬩綋">涓浜屼釜涓?/span>1(<em>a<sub>01</sub></em>)<span style="font-family: 瀹嬩綋">錛屾墍浠?/span><em>i</em>=0<span style="font-family: 瀹嬩綋">錛?/span><em>j</em>=1<span style="font-family: 瀹嬩綋">錛屽湪</span><em><u>x</u></em><span style="font-family: 瀹嬩綋">涓?/span>0<span style="font-family: 瀹嬩綋">鎵鍦ㄧ殑浣嶇疆鏄涓涓紝鑰?/span><em><u>y</u></em><span style="font-family: 瀹嬩綋">涓?/span>1<span style="font-family: 瀹嬩綋">鎵鍦ㄧ殑浣嶇疆涓虹涓銆佸洓銆佸叚涓紝鍥犳鏈変竴涓浉鍚岋紝鎵浠?/span><em>a<sub>01</sub></em>=1<span style="font-family: 瀹嬩綋">銆?/span></p> <p style="text-indent: 21pt"><span style="font-family: 瀹嬩綋">鍏充簬璁$畻鐭╅樀</span><em>A</em><span style="font-family: 瀹嬩綋">榪欓噷闄勫姞</span>java<span style="font-family: 瀹嬩綋">浠g爜瀹炵幇錛屽彲鍙傝冿細</span></p> <p style="text-indent: 21pt"><span style="font-family: 瀹嬩綋"></p> <p style="text-indent: 21pt"></p> <div style="border-right: #cccccc 1px solid; padding-right: 5px; border-top: #cccccc 1px solid; padding-left: 4px; font-size: 13px; padding-bottom: 4px; border-left: #cccccc 1px solid; width: 98%; word-break: break-all; padding-top: 4px; border-bottom: #cccccc 1px solid; background-color: #eeeeee"><span style="color: #008080"> 1</span><img id="Codehighlighter1_0_235_Open_Image" onclick="this.style.display='none'; Codehighlighter1_0_235_Open_Text.style.display='none'; Codehighlighter1_0_235_Closed_Image.style.display='inline'; Codehighlighter1_0_235_Closed_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_0_235_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_0_235_Closed_Text.style.display='none'; Codehighlighter1_0_235_Open_Image.style.display='inline'; Codehighlighter1_0_235_Open_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /><span id="Codehighlighter1_0_235_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">/** */</span><span id="Codehighlighter1_0_235_Open_Text"><span style="color: #008000">/**</span><span style="color: #008000"><br /> </span><span style="color: #008080"> 2</span><span style="color: #008000"><img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />     * <br /> </span><span style="color: #008080"> 3</span><span style="color: #008000"><img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />     * </span><span style="color: #808080">@param</span><span style="color: #008000"> k<br /> </span><span style="color: #008080"> 4</span><span style="color: #008000"><img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />     *            the number of finite set F<br /> </span><span style="color: #008080"> 5</span><span style="color: #008000"><img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />     * </span><span style="color: #808080">@param</span><span style="color: #008000"> x<br /> </span><span style="color: #008080"> 6</span><span style="color: #008000"><img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />     *            the vector x belongs to F^l<br /> </span><span style="color: #008080"> 7</span><span style="color: #008000"><img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />     * </span><span style="color: #808080">@param</span><span style="color: #008000"> y<br /> </span><span style="color: #008080"> 8</span><span style="color: #008000"><img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />     *            the vector y belongs to F^l<br /> </span><span style="color: #008080"> 9</span><span style="color: #008000"><img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />     * </span><span style="color: #808080">@return</span><span style="color: #008000"> the contingency table A<br /> </span><span style="color: #008080">10</span><span style="color: #008000"><img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />     * </span><span style="color: #808080">@author</span><span style="color: #008000"> $Jia Yu<br /> </span><span style="color: #008080">11</span><span style="color: #008000"><img alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />     </span><span style="color: #008000">*/</span></span><span style="color: #000000"><br /> </span><span style="color: #008080">12</span><span style="color: #000000"><img alt="" src="http://m.tkk7.com/images/OutliningIndicators/None.gif" align="top" />    </span><span style="color: #0000ff">public</span><span style="color: #000000"> Integer[][] calContingencyTable(Integer k, Vector</span><span style="color: #000000"><</span><span style="color: #000000">Integer</span><span style="color: #000000">></span><span style="color: #000000"> x,<br /> </span><span style="color: #008080">13</span><span style="color: #000000"><img id="Codehighlighter1_329_765_Open_Image" onclick="this.style.display='none'; Codehighlighter1_329_765_Open_Text.style.display='none'; Codehighlighter1_329_765_Closed_Image.style.display='inline'; Codehighlighter1_329_765_Closed_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_329_765_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_329_765_Closed_Text.style.display='none'; Codehighlighter1_329_765_Open_Image.style.display='inline'; Codehighlighter1_329_765_Open_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ContractedBlock.gif" align="top" />            Vector</span><span style="color: #000000"><</span><span style="color: #000000">Integer</span><span style="color: #000000">></span><span style="color: #000000"> y) </span><span id="Codehighlighter1_329_765_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://m.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_329_765_Open_Text"><span style="color: #000000">{<br /> </span><span style="color: #008080">14</span><span style="color: #000000"><img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        </span><span style="color: #0000ff">if</span><span style="color: #000000"> (x.size() </span><span style="color: #000000">!=</span><span style="color: #000000"> y.size())<br /> </span><span style="color: #008080">15</span><span style="color: #000000"><img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />            </span><span style="color: #0000ff">throw</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> IllegalArgumentException(<br /> </span><span style="color: #008080">16</span><span style="color: #000000"><img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />                    </span><span style="color: #000000">"</span><span style="color: #000000">The two vectors are not the same size!</span><span style="color: #000000">"</span><span style="color: #000000">);<br /> </span><span style="color: #008080">17</span><span style="color: #000000"><img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        Integer[][] A </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #0000ff">new</span><span style="color: #000000"> Integer[k][k];<br /> </span><span style="color: #008080">18</span><span style="color: #000000"><img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        Integer count_ij;<br /> </span><span style="color: #008080">19</span><span style="color: #000000"><img id="Codehighlighter1_533_750_Open_Image" onclick="this.style.display='none'; Codehighlighter1_533_750_Open_Text.style.display='none'; Codehighlighter1_533_750_Closed_Image.style.display='inline'; Codehighlighter1_533_750_Closed_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_533_750_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_533_750_Closed_Text.style.display='none'; Codehighlighter1_533_750_Open_Image.style.display='inline'; Codehighlighter1_533_750_Open_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />        </span><span style="color: #0000ff">for</span><span style="color: #000000"> (</span><span style="color: #0000ff">int</span><span style="color: #000000"> i </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">; i </span><span style="color: #000000"><</span><span style="color: #000000"> k; i</span><span style="color: #000000">++</span><span style="color: #000000">) </span><span id="Codehighlighter1_533_750_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://m.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_533_750_Open_Text"><span style="color: #000000">{<br /> </span><span style="color: #008080">20</span><span style="color: #000000"><img id="Codehighlighter1_566_746_Open_Image" onclick="this.style.display='none'; Codehighlighter1_566_746_Open_Text.style.display='none'; Codehighlighter1_566_746_Closed_Image.style.display='inline'; Codehighlighter1_566_746_Closed_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_566_746_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_566_746_Closed_Text.style.display='none'; Codehighlighter1_566_746_Open_Image.style.display='inline'; Codehighlighter1_566_746_Open_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />            </span><span style="color: #0000ff">for</span><span style="color: #000000"> (</span><span style="color: #0000ff">int</span><span style="color: #000000"> j </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">; j </span><span style="color: #000000"><</span><span style="color: #000000"> k; j</span><span style="color: #000000">++</span><span style="color: #000000">) </span><span id="Codehighlighter1_566_746_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://m.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_566_746_Open_Text"><span style="color: #000000">{<br /> </span><span style="color: #008080">21</span><span style="color: #000000"><img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />                count_ij </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">;<br /> </span><span style="color: #008080">22</span><span style="color: #000000"><img id="Codehighlighter1_628_717_Open_Image" onclick="this.style.display='none'; Codehighlighter1_628_717_Open_Text.style.display='none'; Codehighlighter1_628_717_Closed_Image.style.display='inline'; Codehighlighter1_628_717_Closed_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_628_717_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_628_717_Closed_Text.style.display='none'; Codehighlighter1_628_717_Open_Image.style.display='inline'; Codehighlighter1_628_717_Open_Text.style.display='inline';" alt="" src="http://m.tkk7.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />                </span><span style="color: #0000ff">for</span><span style="color: #000000"> (</span><span style="color: #0000ff">int</span><span style="color: #000000"> xi </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">0</span><span style="color: #000000">; xi </span><span style="color: #000000"><</span><span style="color: #000000"> x.size(); xi</span><span style="color: #000000">++</span><span style="color: #000000">) </span><span id="Codehighlighter1_628_717_Closed_Text" style="border-right: #808080 1px solid; border-top: #808080 1px solid; display: none; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff"><img alt="" src="http://m.tkk7.com/Images/dot.gif" /></span><span id="Codehighlighter1_628_717_Open_Text"><span style="color: #000000">{<br /> </span><span style="color: #008080">23</span><span style="color: #000000"><img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />                    </span><span style="color: #0000ff">if</span><span style="color: #000000"> (x.elementAt(xi).equals(i) </span><span style="color: #000000">&&</span><span style="color: #000000"> y.elementAt(xi).equals(j))<br /> </span><span style="color: #008080">24</span><span style="color: #000000"><img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />                        count_ij</span><span style="color: #000000">++</span><span style="color: #000000">;<br /> </span><span style="color: #008080">25</span><span style="color: #000000"><img alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />                }</span></span><span style="color: #000000"><br /> </span><span style="color: #008080">26</span><span style="color: #000000"><img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />                A[i][j] </span><span style="color: #000000">=</span><span style="color: #000000"> count_ij;<br /> </span><span style="color: #008080">27</span><span style="color: #000000"><img alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />            }</span></span><span style="color: #000000"><br /> </span><span style="color: #008080">28</span><span style="color: #000000"><img alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />        }</span></span><span style="color: #000000"><br /> </span><span style="color: #008080">29</span><span style="color: #000000"><img alt="" src="http://m.tkk7.com/images/OutliningIndicators/InBlock.gif" align="top" />        </span><span style="color: #0000ff">return</span><span style="color: #000000"> A;<br /> </span><span style="color: #008080">30</span><span style="color: #000000"><img alt="" src="http://m.tkk7.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />    }</span></span></div> <p style="text-indent: 21pt"><br /> 鏈変簡鐩鎬緷琛ㄧ殑瀹氫箟錛屽彲浠ュ畾涔夌鏁e悜閲忎箣闂寸殑涓嶇浉浼兼ф祴搴︿簡銆?/span></p> <p style="text-indent: 21pt; text-align: center" align="center"><span style="font-family: 瀹嬩綋">姹夋槑璺濈錛?img height="58" alt="" src="http://m.tkk7.com/images/blogjava_net/changedi/2.7.JPG" width="150" border="0" /></span>          <span style="font-family: 瀹嬩綋">錛?/span>2.7<span style="font-family: 瀹嬩綋">錛?/span></p> <p style="text-indent: 21pt; text-align: center" align="center">L1<span style="font-family: 瀹嬩綋">璺濈錛?img height="48" alt="" src="http://m.tkk7.com/images/blogjava_net/changedi/2.8.JPG" width="176" border="0" /></span>              <span style="font-family: 瀹嬩綋">錛?/span>2.8<span style="font-family: 瀹嬩綋">錛?/span></p> <p style="text-indent: 21pt"><span style="font-family: 瀹嬩綋">鍚屾牱錛岀浉浼兼ф祴搴︽湁</span></p> <p style="text-indent: 21pt; text-align: center" align="center">Tanimoto<span style="font-family: 瀹嬩綋">嫻嬪害錛?img height="93" alt="" src="http://m.tkk7.com/images/blogjava_net/changedi/2.9.JPG" width="225" border="0" /></span>             <span style="font-family: 瀹嬩綋">錛?/span>2.9<span style="font-family: 瀹嬩綋">錛?/span></p> <p style="text-indent: 21pt"><span style="font-family: 瀹嬩綋">鍏朵腑鐨?/span><em>n<sub>x</sub></em>( <em>n<sub>y</sub></em>)<span style="font-family: 瀹嬩綋">琛ㄧず</span><em><u>x</u></em>(<em><u>y</u></em>)<span style="font-family: 瀹嬩綋">涓潪闆跺厓绱犵殑涓暟銆?/span></p> <p style="text-indent: 21pt"><span style="font-family: 瀹嬩綋">涔︽湰寰寰鏁欑粰鎴戜滑鐨勬槸鍩虹鑰屼笉鏄簲鐢紝榪欎簺鍩虹鐭ヨ瘑鍦ㄥ疄闄呭簲鐢ㄤ腑鎵嶄細寰楀埌鏇村鐨勬敼榪涘拰鍙樺寲銆備篃璁告垜浠笉浼氱畝鍗曠殑鍦ㄨ仛綾諱腑搴旂敤榪欎簺嫻嬪害姒傚康錛屼絾鏄鏉傜殑緇勫悎閮芥槸鏉ユ簮浜庡熀紜銆傚洜姝わ紝瀵規祴搴︾殑鍩虹姒傚康涓瀹氳鐗㈢墷鎶婃彙銆傚湪鍓嶄竴闃舵鍋氬浘鍍忓垎鍓叉椂錛岃仛綾葷畻娉曟墽琛岀殑鍓嶆彁涔嬩竴嫻嬪害錛屾垜灝卞仛榪囧涓疄楠岋紝</span>L1<span style="font-family: 瀹嬩綋">鍜?/span>L2<span style="font-family: 瀹嬩綋">鑼冩暟錛?/span>Tanimoto<span style="font-family: 瀹嬩綋">嫻嬪害絳夈傚綋鐒朵笉鍚岀殑鍥懼儚鐗瑰緛鏈変笉鍚岀殑璁$畻璺濈鏂規硶錛屾諱箣瀹為檯鐨勭粡楠屽憡璇夋垜錛屽熀紜鎵庡疄鍚庯紝鍦ㄥ簲鐢ㄨ搗鏉ユ槸鐩稿綋鐨勯『鎵嬪晩</span>~~~<span style="font-family: 瀹嬩綋">錛堟渶璧風爜涓嶄細琚鏉傚叕寮忓悡鍒幫級</span></p> <h1>3. <span style="font-family: 瀹嬩綋">鐗規畩鎯呭喌澶勭悊</span></h1> <p>       <span style="font-family: 瀹嬩綋">鑰冭檻鍒板疄渚嬪悜閲忕殑鐗瑰緛綾誨瀷寰寰鏄鏉傛販鍚堢殑錛岃繖縐嶆儏鍐典笅錛屽浣曡綆楄繎閭繪祴搴﹀憿錛熶竴浜涘伔鎳掔殑鍋氭硶灝辨槸灝嗘墍鏈夊奸兘鐪嬩綔鏄疄鍊肩被鍨嬶紝鎶婃販鍚堝悜閲忓綋浣滃疄鍚戦噺鏉ュ鐞嗐備絾鏄幇瀹炰嬌鐢ㄤ腑錛岃繖鏍峰仛鐨勬晥鏋滃線寰宸己浜烘剰銆傝冭檻灝嗗疄鍊肩被鍨嬭漿鎹㈡垚紱繪暎綾誨瀷錛岃繖灝辨槸钁楀悕鐨勭鏁e寲浜嗭紝鐗瑰緛鐨勭鏁e寲鎿嶄綔鏃剁壒寰佹垨灞炴ц繃婊?/span>(filter)<span style="font-family: 瀹嬩綋">鐨勪竴涓噸瑕佺殑鏂歸潰銆傚綋鐒舵垜鏈鎺ㄨ崘鐨勮繕鏄熀浜庤嚜宸卞紑鍙戠殑搴旂敤鍦烘櫙錛岃璁$浉鍏崇殑榪戦偦嫻嬪害銆傝繖鏍峰彲鑳介氱敤鎬ф瘮杈冨樊錛屼絾鏄鏋滄槸闂椹卞姩鐨勮瘽錛屾垨鑰呯洰鏍囬┍鍔紝閭d箞榪欎釜浣滀負涓涓?/span>solution<span style="font-family: 瀹嬩綋">涔熶笉澶變紭鑹с傚綋鐒跺紩鍏ユā緋婃祴搴︾殑姒傚康涔熸槸涓縐嶈В鍐蟲柟娉曪紝榪欓噷灝變笉緇嗚浜嗭紝鍏蜂綋搴旂敤鍙互鍙傜湅鏈夊叧妯$硦鍜屼笉紜畾鎬х殑鏂囩珷銆傚彟澶栦竴鐐歸渶瑕佽鏄庡氨鏄疄渚嬪悜閲忎腑閮ㄥ垎鐗瑰緛涓㈠け鐨勬儏鍐碉紝瀵逛簬涓㈠け鏁版嵁錛屽鏋滄垜浠煡閬撴暟鎹殑鍒嗗竷錛岄偅涔堝悎鐞嗗亣璁炬槸涓涓浛浠f柟妗堬紝浣嗘槸濡傛灉涓轟簡鐪佷簨錛屽父鐢ㄧ殑鍋氭硶鏄洿鎺ヤ涪寮冭瀹炰緥鍚戦噺錛屾垨鑰呭ソ鐐圭殑鍋氭硶鏄彇鎵鏈夊疄渚嬬殑騫沖潎鏁版嵁浣滀負璇ョ淮搴︾殑鏇夸唬鏁版嵁銆?/span></p> <h1>4. <span style="font-family: 瀹嬩綋">鐐逛笌闆嗗悎涔嬮棿鐨勬祴搴?/span></h1> <p>       <span style="font-family: 瀹嬩綋">闅忕潃鑱氱被榪囩▼鐨勪笉鏂繘琛岋紝灞傛閫愭笎娣卞叆錛岃仛綾誨凡緇忎笉浠呬粎鏄垽鏂偣涓庣偣涔嬮棿鐨勭浉浼肩▼搴︿簡錛岀偣涓庨泦鍚堢殑鐩鎬技紼嬪害涔熼渶瑕佽綆椼傝屽浣曞畾涔夊悜閲?/span><em><u>x</u></em><span style="font-family: 瀹嬩綋">鍜岃仛綾?/span><em>C</em><span style="font-family: 瀹嬩綋">涔嬮棿鐨勮繎閭繪э紝浠庤屽垽鏂槸鍚﹀皢</span><em><u>x</u></em><span style="font-family: 瀹嬩綋">褰掔被涓?/span><em>C</em><span style="font-family: 瀹嬩綋">銆備互涓嬩笁涓畾涔夌粡甯哥敤鍒般?/span></p> <p style="text-align: center" align="center"><span style="font-family: 瀹嬩綋">鏈澶ц繎閭誨嚱鏁?/span>Max proximity function<span style="font-family: 瀹嬩綋">錛?/span> <img height="30" alt="" src="http://m.tkk7.com/images/blogjava_net/changedi/4.1.JPG" width="197" border="0" />          <span style="font-family: 瀹嬩綋">錛?/span>4.1<span style="font-family: 瀹嬩綋">錛?/span></p> <p style="text-align: center" align="center"><span style="font-family: 瀹嬩綋">鏈灝忚繎閭誨嚱鏁?/span>Min proximity function<span style="font-family: 瀹嬩綋">錛?img height="30" alt="" src="http://m.tkk7.com/images/blogjava_net/changedi/4.2.JPG" width="197" border="0" /></span>           <span style="font-family: 瀹嬩綋">錛?/span>4.2<span style="font-family: 瀹嬩綋">錛?/span></p> <p style="text-align: center" align="center"><span style="font-family: 瀹嬩綋">騫沖潎榪戦偦鍑芥暟</span>Average proximity function<span style="font-family: 瀹嬩綋">錛?img height="49" alt="" src="http://m.tkk7.com/images/blogjava_net/changedi/4.3.JPG" width="193" border="0" /></span>       <span style="font-family: 瀹嬩綋">錛?/span>4.3<span style="font-family: 瀹嬩綋">錛?/span></p> <p><span style="font-family: 瀹嬩綋">鍏朵腑</span><em>n<sub>c</sub></em><span style="font-family: 瀹嬩綋">鏄泦鍚?/span>C<span style="font-family: 瀹嬩綋">鐨勫娍銆?/span></p> <p>       <span style="font-family: 瀹嬩綋">鍙互鐪嬪埌錛岃繖鏍風殑瀹氫箟鍦ㄦ蹇電悊璁哄眰嬈′笂浠嶆棫灝嗙偣瑙嗕綔鐐癸紝灝嗚仛綾昏浣滈泦鍚堛傚彟涓縐嶆儏鍐靛垯鏄皢鑱氱被瑙嗕綔涓涓偣錛屽洜涓虹偣涓庣偣涔嬮棿鐨勮繎閭繪祴搴﹀凡緇忓彲浠ヨ綆楋紝閭d箞灝嗛泦鍚堣涓轟竴涓偣錛屽氨灝嗚繖涓棶棰樺綊綰﹀埌浜嗙偣涓庣偣涔嬮棿鐨勯棶棰樹簡銆傚鑱氱被榪涜琛ㄨ揪錛屼富瑕佹湁浠ヤ笅鍑犵琛ㄨ揪錛?/span></p> <p style="margin-left: 42.75pt; text-indent: -21.75pt">1錛?span style="font: 7pt 'Times New Roman'">    </span><span style="font-family: 瀹嬩綋">鐐硅〃杈撅細灝嗚仛綾昏浣滀竴涓偣錛屽彲浠ユ槸鍧囧肩偣</span>(mean vector)<span style="font-family: 瀹嬩綋">錛屼篃鍙互鏄潎鍊間腑蹇?/span>(mean center)<span style="font-family: 瀹嬩綋">錛屼篃鍙互鏄腑鍊間腑蹇?/span>(median center)<span style="font-family: 瀹嬩綋">銆傚叧浜庤繖鍑犱釜姒傚康鍜屽叕寮忥紝浠諱綍鐨勭粺璁℃暀鏉愰噷閮芥湁娑夌寧錛屾垜灝變笉涓涓鏋氫婦浜嗐傦紙涓昏璐村叕寮忕湡鐨勫緢绱紝鎬蹇?/span>Tex<span style="font-family: 瀹嬩綋">錛?/span></p> <p style="margin-left: 42.75pt; text-indent: -21.75pt">2錛?span style="font: 7pt 'Times New Roman'">    </span><span style="font-family: 瀹嬩綋">瓚呭鉤闈㈣〃杈撅細綰挎ц仛綾諱腑甯哥敤銆備笉琛ㄣ傛湁鍏磋叮鑰呭幓鏌ヨ祫鏂欍?/span></p> <p style="margin-left: 42.75pt; text-indent: -21.75pt">3錛?span style="font: 7pt 'Times New Roman'">    </span><span style="font-family: 瀹嬩綋">瓚呯悆闈㈣〃杈撅細鐞冨艦鑱氱被涓父鐢ㄣ傚悓涓娿?/span></p> <p style="text-indent: 21pt"><span style="font-family: 瀹嬩綋">涓鍒囩殑瀛︿範閮戒負搴旂敤錛屾牴鎹疄闄呭簲鐢ㄧ殑涓嶅悓錛屾垜浠湪瀹氫箟榪欑鐐逛笌闆嗗悎涔嬮棿嫻嬪害鏃跺欎篃鏈夊緢澶х殑鐏墊椿鎬с?/span></p> <h1>5. <span style="font-family: 瀹嬩綋">闆嗗悎涓庨泦鍚堜箣闂寸殑嫻嬪害</span></h1> <p style="text-indent: 21pt"><span style="font-family: 瀹嬩綋">鍚屾牱鐨勶紝瀵逛簬闆嗗悎涓庨泦鍚堢殑嫻嬪害錛屽彲浠ュ悓鐐逛笌闆嗗悎鐨勬祴搴︾被浼箋傚彧瑕佽浣忎竴鐐癸紝閭e氨鏄泦鍚堜笌闆嗗悎闂寸殑榪戦偦嫻嬪害鏄緩绔嬪湪鐐逛笌鐐逛箣闂寸殑嫻嬪害鐨勫熀紜涓婄殑銆傛墍浠ヨ繎閭繪祴搴︾殑鍩虹鍦ㄧ偣涓庣偣涔嬮棿銆傚綋鐒惰仛綾葷粨鏋滅殑浼樺寲鏄竴涓弽澶嶈瘯楠岀殑榪囩▼錛屽叾涓篃瑕佽冭檻棰嗗煙涓撳鐨勬剰瑙併?/span></p> <h1>6. <span style="font-family: 瀹嬩綋">灝忕粨</span></h1> <p style="text-indent: 21pt"><span style="font-family: 瀹嬩綋">瀵逛簬榪戦偦嫻嬪害鐨勫涔狅紝涔嶄竴鐪嬪儚鏄函鏁板鐭ヨ瘑鐨勫涔狅紝鍏跺疄鍒欐槸瀵規垜浠紑濮嬭仛綾葷畻娉曠爺絀朵箣鍓嶇殑涓涓く瀹炲熀紜鐨勫涔犺繃紼嬨?/span></p> <h1>7. <span style="font-family: 瀹嬩綋">鍙傝冩枃鐚強鎺ㄨ崘闃呰</span></h1> <p>[1]Pattern Recognition Third Edition, Sergios Theodoridis, Konstantinos Koutroumbas</p> <p>[2] http://zh.wikipedia.org/wiki/%E6%B5%8B%E5%BA%A6%E8%AE%BA</p> <p>[3]<span style="font-family: 瀹嬩綋">妯″紡璇嗗埆</span><span style="font-family: 瀹嬩綋">絎笁鐗?/span>, Sergios Theodoridis, Konstantinos Koutroumbas<span style="font-family: 瀹嬩綋">钁?/span>, <span style="font-family: 瀹嬩綋">鏉庢櫠鐨?/span>, <span style="font-family: 瀹嬩綋">鐜嬬埍渚?/span>, <span style="font-family: 瀹嬩綋">寮犲箍婧愮瓑璇?/span></p> <img src ="http://m.tkk7.com/changedi/aggbug/309845.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/changedi/" target="_blank">changedi</a> 2010-01-17 13:10 <a href="http://m.tkk7.com/changedi/archive/2010/01/17/309845.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鑱氱被綆楁硶瀛︿範絎旇錛堜竴錛夆斺斿熀紜http://m.tkk7.com/changedi/archive/2010/01/11/308984.htmlchangedichangediMon, 11 Jan 2010 02:39:00 GMThttp://m.tkk7.com/changedi/archive/2010/01/11/308984.htmlhttp://m.tkk7.com/changedi/comments/308984.htmlhttp://m.tkk7.com/changedi/archive/2010/01/11/308984.html#Feedback1http://m.tkk7.com/changedi/comments/commentRss/308984.htmlhttp://m.tkk7.com/changedi/services/trackbacks/308984.html0. 寮曞瓙

浼犺錛?#8220;鑱氱被鏄漢綾繪渶鍘熷鐨勭簿紲炴椿鍔紝鐢ㄤ簬澶勭悊浠栦滑姣忓ぉ鎺ユ敹鍒扮殑澶ч噺淇℃伅”銆備負鏂逛究騫垮ぇ鍚屽瀛︿範浣跨敤錛屽皢鎴戝涔犺仛綾繪椂鐨勭瑪璁版暣鐞嗗彂甯冨叡浜?/span>

1. 鑱氱被瀹氫箟

“鑱氱被鏄妸鐩鎬技鐨勫璞¢氳繃闈欐佸垎綾葷殑鏂規硶鍒嗘垚涓嶅悓鐨勭粍鍒垨鑰呮洿澶氱殑瀛愰泦錛?/span>subset錛?/span>,榪欐牱璁╁湪鍚屼竴涓瓙闆嗕腑鐨勬垚鍛樺璞¢兘鏈夌浉浼肩殑涓浜涘睘鎬с?#8221;                                                          鈥斺?/span>wikipedia

鑱氱被鍒嗘瀽鎸囧皢鐗╃悊鎴栨娊璞″璞$殑闆嗗悎鍒嗙粍鎴愪負鐢辯被浼肩殑瀵硅薄緇勬垚鐨勫涓被鐨勫垎鏋愯繃紼嬨傚畠鏄竴縐嶉噸瑕佺殑浜虹被琛屼負銆傝仛綾繪槸灝嗘暟鎹垎綾誨埌涓嶅悓鐨勭被鎴栬呯皣榪欐牱鐨勪竴涓繃紼嬶紝鎵浠ュ悓涓涓皣涓殑瀵硅薄鏈夊緢澶х殑鐩鎬技鎬э紝鑰屼笉鍚岀皣闂寸殑瀵硅薄鏈夊緢澶х殑鐩稿紓鎬с?/span>                          鈥斺旂櫨搴︾櫨縐?/span>

璇寸櫧浜嗭紝鑱氱被錛?/span>clustering錛夋槸瀹屽叏鍙互鎸夊瓧闈㈡剰鎬濇潵鐞嗚В鐨勨斺斿皢鐩稿悓銆佺浉浼箋佺浉榪戙佺浉鍏崇殑瀵硅薄瀹炰緥鑱氭垚涓綾葷殑榪囩▼銆傜畝鍗曠悊瑙o紝濡傛灉涓涓暟鎹泦鍚堝寘鍚?/span>N涓疄渚嬶紝鏍規嵁鏌愮鍑嗗垯鍙互灝嗚繖N涓疄渚嬪垝鍒嗕負m涓被鍒紝姣忎釜綾誨埆涓殑瀹炰緥閮芥槸鐩稿叧鐨勶紝鑰屼笉鍚岀被鍒箣闂存槸鍖哄埆鐨勪篃灝辨槸涓嶇浉鍏崇殑錛岃繖涓繃紼嬪氨鍙仛綾諱簡銆?/span>

褰㈠紡鍖栦竴鐐癸紝浠?img style="width: 162px; height: 22px" height="22" alt="" src="http://m.tkk7.com/images/blogjava_net/changedi/abc.JPG" width="162" border="0" />錛屽叾涓殑x閮芥槸鍚戦噺錛屼竴涓?/span>X鐨?/span>m鑱氱被R灝?/span>X鍒嗗壊涓?/span>m涓泦鍚?/span>C1, C2,…,Cm錛屼嬌鍏舵弧瓚充笅闈笁涓潯浠訛細

錛?/span>1錛?img height="22" alt="" src="http://m.tkk7.com/images/blogjava_net/changedi/abcd.JPG" width="162" border="0" />

錛?/span>2錛?img height="37" alt="" src="http://m.tkk7.com/images/blogjava_net/changedi/abcde.JPG" width="70" border="0" />

錛?/span>3錛?img height="28" alt="" src="http://m.tkk7.com/images/blogjava_net/changedi/ff.JPG" width="275" border="0" />

婊¤凍涓婅堪鏉′歡鐨勫悓鏃訛紝鍦ㄨ仛綾?/span>Ci涓殑鍚戦噺褰兼鐩鎬技錛岃屼笌鍏朵粬綾諱腑鐨勫悜閲忎笉鐩鎬技銆?/span>

浣嗘槸榪欑瀹氫箟涔熷彧鏄畾涔変簡紜畾鎬х殑鑱氱被錛屼篃鍙仛紜仛綾?/span>(hard clustering)錛屾瘡涓疄渚?/span>x閮界‘瀹氱殑灞炰簬鏌愪釜鑱氱被銆傝屼笉紜畾鎬ц仛綾伙紝涔熼渶瑕佸畾涔夛紝榪欏氨寮曞嚭浜嗘ā緋婅仛綾?/span>(fuzzy clustering)鐨勬蹇典簡銆傛ā緋婅仛綾諱腑錛屾瘡涓疄渚嬪悜閲?/span>x浠ヤ竴瀹氱殑闅跺睘搴﹀睘浜庢煇涓仛綾匯傚悓涓婇潰鐨勮緗紝X鐨勬ā緋婅仛綾繪槸灝?/span>X鍒嗘垚m涓被錛岀敱m涓嚱鏁?/span>uj琛ㄧず錛屽叾涓弧瓚籌細

錛?/span>1錛?img height="28" alt="" src="http://m.tkk7.com/images/blogjava_net/changedi/fff.JPG" width="214" border="0" />

錛?/span>2錛?img height="44" alt="" src="http://m.tkk7.com/images/blogjava_net/changedi/de.JPG" width="214" border="0" />

錛?/span>3錛?img height="44" alt="" src="http://m.tkk7.com/images/blogjava_net/changedi/def.JPG" width="240" border="0" />

鍏朵腑榪欎釜闅跺睘搴﹀嚱鏁?img height="23" alt="" src="http://m.tkk7.com/images/blogjava_net/changedi/ew.JPG" width="45" border="0" />瓚婃帴榪?/span>1錛岃鏄?/span>xi瓚婂彲鑳藉睘浜?/span>Ci錛屽弽涔嬪鏋滆秺鎺ヨ繎0錛屽垯璇存槑瓚婁笉鍙兘灞炰簬Ci銆?/span>

2. 鑱氱被榪囩▼

褰撴垜浠煡閬撹仛綾繪槸浠涔堟椂錛屾垜浠笅涓姝ユ兂鐭ラ亾鐨勫簲璇ユ槸鎬庝箞榪涜鑱氱被銆傝繖涓鐐癸紝鏁欐潗涓婂仛浜嗚緇嗕粙緇嶏紝琛ュ厖涓鐐硅嚜宸辯悊瑙o細

1錛夌壒寰侀夋嫨(feature selection)錛氬氨鍍忓叾浠栧垎綾諱換鍔′竴鏍鳳紝鐗瑰緛寰寰鏄竴鍒囨椿鍔ㄧ殑鍩虹錛屽浣曢夊彇鐗瑰緛鏉ュ敖鍙兘鐨勮〃杈鵑渶瑕佸垎綾葷殑淇℃伅鏄竴涓噸瑕侀棶棰樸傝〃杈炬у己鐨勭壒寰佸皢寰堝獎鍝嶈仛綾繪晥鏋溿傝繖鐐瑰湪浠ュ悗鐨勫疄楠屼腑鎴戜細灞曠ず銆?/span>

2錛夎繎閭繪祴搴?/span>(proximity measure)錛氬綋閫夊畾浜嗗疄渚嬪悜閲忕殑鐗瑰緛琛ㄨ揪鍚庯紝濡備綍鍒ゆ柇涓や釜瀹炰緥鍚戦噺鐩鎬技鍛紵榪欎釜闂鏄潪甯稿叧閿殑涓涓棶棰橈紝鍦ㄨ仛綾昏繃紼嬩腑涔熸湁鐫鍐沖畾鎬х殑鎰忎箟錛屽洜涓鴻仛綾繪湰璐ㄥ湪鍖哄垎鐩鎬技涓庝笉鐩鎬技錛岃岃繎閭繪祴搴﹀氨鏄榪欑鐩鎬技鎬х殑涓縐嶅畾涔夈?/span>

3錛夎仛綾誨噯鍒?/span>(clustering criterion)錛氬畾涔変簡鐩鎬技鎬ц繕涓嶅錛岀粨鍚堣繎閭繪祴搴︼紝濡備綍鍒ゆ柇鐩鎬技鎵嶆槸鍏抽敭銆傜洿瑙傜悊瑙h仛綾誨噯鍒欒繖涓蹇靛氨鏄綍鏃惰仛綾伙紝浣曟椂涓嶈仛綾葷殑鑱氱被鏉′歡銆傚綋鎴戜滑浣跨敤鑱氱被綆楁硶榪涜璁$畻鏃訛紝濡備綍鑱氱被鏄畻娉曞叧蹇冪殑錛岃岃仛涓庡惁闇瑕佷竴涓爣鍑嗭紝鑱氱被鍑嗗垯灝辨槸榪欎釜鏍囧噯銆傦紙璇濊鏍囧噯榪欎笢瑗夸竴鎷垮嚭鏉ワ紝澶熷悡浜轟簡鍚?/span>^_^錛?/span>

4錛夎仛綾葷畻娉?/span>(clustering algorithm)錛氳繖涓笢瑗夸笉鐢ㄧ粏璇翠簡鍚э紝鏁翠釜瀛︿範鐨勯噸涓箣閲嶏紝鏍稿績鐨勪笢瑗胯繖閲屼笉璁詫紝浠ュ悗浼氱粏璇達紝綆鍗曞紑涓ご鈥斺斿埄鐢ㄨ繎閭繪祴搴﹀拰鑱氱被鍑嗗垯寮濮嬭仛綾葷殑榪囩▼銆?/span>

5錛夌粨鏋滈獙璇?/span>(validation of the results)錛氬叾瀹炲浜?/span>PR鐨勪綔鑰呮彁鍑鴻繖涓繃紼嬩篃鏀懼埌鑱氱被浠誨姟嫻佺▼涓紝鎴戣寰楁湁鐐瑰啑浣欙紝鍥犱負瀵逛簬楠岃瘉綆楁硶鐨勬紜ц繖浜嬪簲璇ユ斁鍒扮畻娉曞眰闈㈠惂錛屽彲浠ユ妸4錛夊拰5錛夌粨鍚堣嚦涓灞傘傚洜涓虹畻娉曟紜拰鏈夌┓鐨勯獙璇佹湰韜氨鏄畻娉曠殑鐗規у槢銆傦紙璋佽璁′簡涓涓畻娉曚笉寰楄瘉鏄庡晩錛?/span>

6錛?/span>(interpretation of the results)錛氫腑鏂囩増鐨?/span>PR涓婄炕璇戜負緇撴灉鍒ゅ畾錛岃屾垜鎰熻瀛楅潰鎰忔濆氨鏄粨鏋滆В閲娿傦紙鑱氱被鏈緇堜細灝嗘暟鎹泦鍒嗘垚鑻ュ共涓被錛屽仛浜嬪墠瑕佹湁鍘熷垯錛屽仛浜嬪悗瑕佹湁瑙i噴錛岃繖涓氨鏄В閲婁簡銆傝嚜鍦嗗叾璇村彲鑳芥槸姣旇緝濂界殑浜?/span>^_^錛?/span>

鏁翠釜鑱氱被浠誨姟璇︾粏鐨勪笢瑗夸細鍦ㄤ互鍚庤緇嗕粙緇嶏紝榪欓噷鍏堢粏璇翠竴涓嬭仛綾誨噯鍒欙紙铏界劧鎴戞劅瑙夊湪涓婇潰鎴戣鐨勫凡緇忓緇嗕簡錛夈備婦渚嬪惂錛屾瘮濡傦紝鏈夎繖鏍蜂竴涓暟鎹泦X錛屽寘鍚簡鍥涘悕鍚屽鐨勫熀鏈俊鎭拰鏁板鎴愮嘩銆?/span>

濮撳悕

騫寸駭

鐝駭

鏁板鎴愮嘩

寮犱笁

1

2

99

鏉庡洓

2

2

95

寮犻

3

1

59

璧典簯

2

1

90

鑱氱被鍑嗗垯灝辨槸涓涓垎綾繪爣鍑嗭紝瀵逛簬紺轟緥涓繖鏍蜂竴涓暟鎹泦鍚堬紝濡備綍鑱氱被鍛€傚綋鐒惰仛綾葷殑鍙兘鎯呭喌鏈夊緢澶氥傛瘮濡傦紝濡傛灉鎴戜滑鎸夌収騫寸駭鏄惁涓哄ぇ浜?/span>1鏉ュ垎綾伙紝閭d箞鏁版嵁闆?/span>X鍒嗕負涓ょ被錛?/span>{寮犱笁}錛?/span>{鏉庡洓錛屽紶椋烇紝璧典簯}錛涘鏋滄寜鐓х彮綰т笉鍚屾潵鍒嗭紝鍒嗕負涓ょ被錛?/span>{寮犱笁錛屾潕鍥?/span>}錛?/span>{寮犻錛岃檔浜?/span>}錛涘鏋滄寜鐓ф垚緇╂槸鍚﹀強鏍兼潵鍒嗭紙鍋囪鍙婃牸涓?/span>60鍒嗭級錛屽垎涓ょ被錛?/span>{寮犱笁錛屾潕鍥涳紝璧典簯}錛?/span>{寮犻}銆傚綋鐒惰仛綾誨噯鍒欑殑璁捐寰寰鏄鏉傜殑錛屽氨鐪嬩綘鎯蟲庝箞鍒掑垎浜嗐傛寜鐓у鍒嗙被鎬濇兂鐨勫嚑浣曠悊瑙o紝鏁版嵁闆嗙浉褰撲簬鏍鋒湰絀洪棿錛屾暟鎹疄渚嬬殑鐗瑰緛鏁幫紙鏈緥鍏辨湁4涓壒寰?/span>[濮撳悕錛屽勾綰э紝鐝駭錛屾暟瀛︽垚緇?/span>]錛夌浉褰撲簬絀洪棿緇村害錛岃屽疄渚嬪悜閲忓搴斿埌絀洪棿涓殑涓涓偣銆傞偅涔堣仛綾誨噯鍒欏氨搴旇鏄偅浜涚濂囩殑瓚呭鉤闈紙瀵瑰簲鏈夋暟瀛﹀嚱鏁拌〃杈懼紡錛屾垜涓漢璁や負榪欎簺鍑芥暟灝辯瓑鍚屼簬鑱氱被鍑嗗垯錛夛紝榪欎簺瓚呭鉤闈㈠皢鏁版嵁“瀹岀編鐨?#8221;鍒嗙寮浜嗐?/span>

3. 鑱氱被鐗瑰緛綾誨瀷

鑱氱被鏃剁敤鍒扮殑鐗瑰緛濡備綍鍖哄垎鍛紝鏈変粈涔堢被鍨嬭姹傦紵鑱氱被鐨勭壒寰佹寜鐓у煙鍒掑垎錛屽彲浠ュ垎涓鴻繛緇殑鐗瑰緛鍜岀鏁g壒寰併傚叾涓繛緇壒寰佸搴旂殑瀹氫箟鍩熸槸鏁版嵁絀洪棿R鐨勮繛緇瓙絀洪棿錛岃岀鏁g壒寰佸搴旂殑鏄鏁e瓙闆嗭紝鍙﹀濡傛灉紱繪暎鐗瑰緛鍙寘鍚袱涓壒寰佸鹼紝閭d箞榪欎釜紱繪暎鐗瑰緛鍙堝彨浜屽肩壒寰併?/span>

       鏍規嵁鐗瑰緛鍙栧肩殑鐩稿鎰忎箟鍙堝彲浠ュ皢鐗瑰緛鍒嗕負浠ヤ笅鍥涚錛氭爣閲忕殑(Nominal)錛岄『搴忕殑(Ordinal)錛屽尯闂村昂搴︾殑(Interval-scaled)浠ュ強姣旂巼灝哄害鐨?/span>(Ratio-scaled)銆傚叾涓紝鏍囬噺鐗瑰緛鐢ㄤ簬緙栫爜涓綾葷壒寰佺殑鍙兘鐘舵侊紝姣斿浜虹殑鎬у埆錛岀紪鐮佷負鐢峰拰濂籌紱澶╂皵鐘跺喌緙栫爜涓洪槾銆佹櫞鍜岄洦絳夈傞『搴忕壒寰佸悓鏍囬噺鐗瑰緛綾諱技錛屽悓鏍鋒槸涓緋誨垪鐘舵佺殑緙栫爜錛屽彧鏄榪欎簺緙栫爜紼嶅姞綰︽潫錛屽嵆緙栫爜欏哄簭鏄湁鎰忎箟鐨勶紝姣斿瀵逛竴閬撹彍錛屽畠鐨勭壒寰佹湁{寰堥毦鍚冿紝闅懼悆錛屼竴鑸紝濂藉悆錛岀編鍛?/span>}鍑犱釜鍊兼潵瀹氫箟鐘舵侊紝浣嗘槸榪欎簺鐘舵佹槸鏈夐『搴忔剰涔夌殑銆傝繖綾葷壒寰佹垜璁や負灝辨槸鏍囬噺鐗瑰緛鐨勪竴涓壒瀹氬瓙闆嗭紝鎴栬呮槸涓涓姞綰︽潫鐨勬爣閲忕壒寰併傚尯闂村昂搴︾壒寰佽〃紺鴻鐗瑰緛鏁板間箣闂寸殑鍖洪棿鏈夋剰涔夎屾暟鍊肩殑姣旂巼鏃犳剰涔夛紝緇忓吀渚嬪瓙灝辨槸娓╁害錛?/span>A鍦扮殑娓╁害錛?/span>20鈩冿級姣?/span>B鍦幫紙15鈩冿級楂?/span>5搴︼紝榪欓噷鐨勫尯闂村樊鍊兼槸鏈夋剰涔夌殑錛屼絾浣犱笉鑳借A鍦版瘮B鍦扮儹1/3錛岃繖鏄棤鎰忎箟鐨勩傛瘮鐜囩壒寰佷笌姝ょ浉鍙嶏紝鍏舵瘮鐜囨槸鏈夋剰涔夌殑錛岀粡鍏鎬緥瀛愭槸閲嶉噺錛?/span>C閲?/span>100g錛?/span>D閲?/span>50g錛岄偅涔?/span>C姣?/span>D閲?/span>2鍊嶏紝榪欐槸鏈夋剰涔夌殑銆傦紙褰撶劧璇?/span>C姣?/span>D閲?/span>50g涔熸槸鍙互鐨勶紝鍥犳鍙互璁や負鍖洪棿灝哄害鏄瘮鐜囧昂搴︾殑涓涓湡瀛愰泦錛夈?/span>

       鍦ㄥ父瑙佸簲鐢ㄤ腑錛屽寘鎷垜浠鉤鏃ュ叧蹇冪殑緙栫▼瀹炵幇涓紝涓鑸彧瀹氫箟nominal鐗瑰緛鍜?/span>numeric鐗瑰緛錛屽叾涓?/span>nominal鍙互鐢?/span>string鏉ヨ〃紺猴紝鑰?/span>numeric鍙互鐢?/span>number鏉ヨ〃紺恒傦紙weka涓殑attribute鐨勭壒寰佺被鍨嬪氨鏄繖涔堝畾涔夌殑錛?/span>

4. 鑱氱被鍒嗘瀽鐨勫簲鐢?/span>

       璇翠簡榪欎箞澶氬熀鏈蹇碉紝鏈瀹為檯鐨勮瘽棰樿帿榪囦簬搴旂敤浜嗐傚氨鍍忎負鑱氱被鍋氬箍鍛婁竴鏍鳳紝鍒板簳鎴戜滑鍙互鍦ㄥ摢閲屽簲鐢ㄥ畠鍛€傚氨鍍忓紩璦閲屾垜鎻愬埌鐨勪紶璇翠竴鏍鳳紝鍒嗙被浣滀負浜虹被璇嗗埆瀵硅薄鐨勪竴涓熀鏈椿鍔ㄥぇ姒備笌浜虹被鐨勬剰璇嗗叡鍚屽瓨鍦ㄧ潃錛屼篃鍙互璇翠漢綾繪櫤鑳借璇嗙殑鏈川媧誨姩涔嬩竴灝辨槸鍒嗙被銆傝岀爺絀惰呭鍒嗙被鐨勭爺絀跺張灝嗗垎綾誨垝鍒嗕負鏈夌洃鐫d笌鏃犵洃鐫o紝鍏朵腑鑱氱被灝辨槸鏃犵洃鐫e垎綾葷殑鏈甯哥敤鏂規硶涔熸槸緇濆浠h〃鎬ф柟娉曘傝鎯充竴涓嬶紝瀵逛簬涓緇勬暟鎹紝鎴栬呬竴鍫嗕俊鎭紝璁$畻鏈哄彲浠ヨ嚜鍔ㄥ湴灝嗗叾鍒嗕負鑻ュ共綾伙紝閭h繖瀵逛簬杈呭姪浜虹被鏅鴻兘鏉ヨ緇濆鏄繀瑕佺殑涔熸槸鏈夋剰涔夌殑銆傛墍浠ヨ仛綾葷殑涓涓牳蹇冨簲鐢ㄥ氨鏄暟鎹寲鎺樹笌妯″紡璇嗗埆銆傚彟澶栧悇涓瀛﹂鍩熷彧瑕佹秹鍙婂埌鍒嗙被鐨勪換鍔★紝澶у鏃犱笉鑱旀兂鍒拌仛綾?/span>~~~錛堣瘽璇存垜絎竴嬈℃寮忓湴瑙i櫎鑱氱被錛岃繕鏄湪23鏁欏妤煎惉涓涓矊浼兼槸鑷姩鍖栫殑鏁欐巿璁茬殑淇℃伅鍖栬紼嬶級銆傝屽鑰呮瘮杈冩潈濞佺殑鍒嗙被灝嗚仛綾葷殑搴旂敤鍒嗕負鍥涗釜鍩烘湰鐨勬柟鍚戯細1錛夋暟鎹幓鍐楋紝鍗沖皢嫻烽噺鏁版嵁涓殑鍐椾綑淇℃伅鍘婚櫎銆?/span>2錛夊亣璇寸敓鎴愶紝涓轟簡鎺ㄥ鍑烘暟鎹殑鏌愪簺鎬ц川錛屾垜浠彲浠ュ鏁版嵁榪涜鑱氱被鍒嗘瀽銆?/span>3錛夊亣璇存楠岋紝鍏跺疄灝辨槸閫氳繃鑱氱被鍒嗘瀽鏉ラ獙璇佹煇涓喅絳栫殑椋庨櫓紼嬪害銆?/span>4錛夊熀浜庡垎緇勭殑棰勬祴錛屽悓鎵鏈夐嫻嬩換鍔′竴鏍鳳紝灝嗗凡鏈夌殑鏁版嵁閮借仛綾誨垎綾誨悗錛屾柊鐨勬湭鏉ユ暟鎹彲浠ョ敤鍚屾牱鐨勮鍒欒繘琛岃瘑鍒嫻嬪叾鎵灞炲垎綾匯?/span>

       鑱氱被鐨勫簲鐢ㄩ潪甯稿箍娉涳紝濡傛灉鎸夌鐩灇涓撅紝鎴戞槸鎳掑緱緗楀垪浜嗐傚彧瑕佺煡閬撲簡鍏跺師鐞嗗拰鐩爣錛屽叾搴旂敤棰嗗煙涔熷氨鑷劧鐞嗚В浜嗐?/span>

5. 灝忕粨

鑱氱被鐨勫熀鏈蹇靛氨鏄繖涔堜簺浜嗭紝鍏充簬鑱氱被鐨勫涔犲拰鐮旂┒宸茬粡鍘嗙粡鍑犲崄騫達紝鍙互搴嗗垢鐨勪竴鐐規槸榪欓噷鐨勫涔犳垜浠彲浠ョ珯鍦ㄥ緢澶氬法浜虹殑鑲╄唨涓婏紝鑰屽浣曞幓鏀硅繘鍒涙柊鎵╁睍搴旂敤錛岄偅灝辨槸鎴戜滑鏈潵鐨勭洰鐨勶紝“宸ユ鍠勫叾浜嬶紝蹇呭厛鍒╁叾鍣?#8221;錛岃繖閲岃仛綾誨氨鏄垜浠殑“鍣?#8221;浜嗐?/span>

6. 鍙傝冩枃鐚強鎺ㄨ崘闃呰

[1]Pattern Recognition Third Edition, Sergios Theodoridis, Konstantinos Koutroumbas

[2] http://baike.baidu.com/view/903740.htm?fr=ala0_1_1

[3] http://zh.wikipedia.org/zh-cn/%E6%95%B0%E6%8D%AE%E8%81%9A%E7%B1%BB

[4]鏁版嵁鎸栨帢姒傚康涓庢妧鏈?/span>(Data mining concepts and techniques) Jiawei Han, Micheline Kamber钁?/span>鑼冩槑, 瀛熷皬宄拌瘧

[5]妯″紡璇嗗埆絎笁鐗?/span>, Sergios Theodoridis, Konstantinos Koutroumbas钁?/span>, 鏉庢櫠鐨?/span>, 鐜嬬埍渚?/span>, 寮犲箍婧愮瓑璇?/span>

[6]鏁版嵁鎸栨帢瀵艱(Introduction to data mining) Pang-Ning Tan, Michael Steinbach, Vipin Kumar钁?/span>鑼冩槑, 鑼冨畯寤?/span>絳夎瘧

[7]鏁版嵁鎸栨帢瀹炵敤鏈哄櫒瀛︿範鎶鏈?/span> (Data mining practical machine learning tools and techniques) Ian H.Witten, Eibe Frank钁?/span>钁g惓絳夎瘧



鏂囩珷杞澆璇鋒爣鏄巭~~



changedi 2010-01-11 10:39 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 国产免费网站看v片在线| 亚洲精品国产精品乱码不99| 无码欧精品亚洲日韩一区| 一区二区在线免费视频| 国产福利免费观看| 亚洲.国产.欧美一区二区三区| 思思99re66在线精品免费观看| 亚洲日本成本人观看| 国产精品久久久久影院免费| 美女被免费网站视频在线| 亚洲国产精品狼友中文久久久 | 亚洲伊人久久综合影院| 岛国岛国免费V片在线观看| 亚洲精品无码Av人在线观看国产| a毛片免费观看完整| 久久精品国产亚洲77777| 成全视频在线观看免费| 亚洲成AV人片一区二区密柚| 未满十八18禁止免费无码网站 | 在线观看免费黄网站| 亚洲国产综合专区电影在线| 国产成人精品免费午夜app| 亚洲人成网站999久久久综合| 国产免费人视频在线观看免费| 免费国产a理论片| 亚洲AV无码精品色午夜果冻不卡| 亚洲电影免费观看| 国产亚洲精品AAAA片APP| 久久亚洲欧洲国产综合| 性xxxx视频免费播放直播 | 亚洲神级电影国语版| 在线看片人成视频免费无遮挡| 免费人成再在线观看网站 | 亚洲天堂视频在线观看| 无码人妻久久一区二区三区免费丨 | 亚洲人成网站18禁止| 77777亚洲午夜久久多人| 成人免费大片免费观看网站| 美女免费精品高清毛片在线视| 亚洲成AV人在线观看天堂无码| 性色av无码免费一区二区三区|