登录
首页 » Others » 两个matlab实现的K-MEANS聚类算法

两个matlab实现的K-MEANS聚类算法

于 2021-05-07 发布
0 321
下载积分: 1 下载次数: 18

代码说明:

%k-means 算法接受输入量 k ;然后将n个数据对象划分为 k个聚类以便使得所获得的聚类满足:%同一聚类中的对象相似度较高;而不同聚类中的对象相似度较小。聚类相似度是利用各聚类中对象的均值所获得一个“中心对象”(引力中心)来进行计算的。%k-means 算法的工作过程说明如下:首先从n个数据对象任意选择 k 个对象作为初始聚类中心;而对于所剩下其它对象,%则根据它们与这些聚类中心的相似度(距离),分别将它们分配给与其最相似的(聚类中心所代表的)聚类;%然后再计算每个所获新聚类的聚类中心(该聚类中所有对象的均值);%不断重复这一过程直到标准测度函数开始收敛为止。一般都采用均方差作

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • 压缩传感的四种重构算法
    压缩传感的四种重构算法,OMP算法 BP算法 分块OMP算法 StOMP算法,不是本人编写,但是经过的我的修改,希望对大家有用,很感恩这是一个免费平台,大家共同学习
    2020-12-11下载
    积分:1
  • 非常好用的matlab图像拼接
    基于matlab的一系列图像的全景拼接技术,运用最新算法,非常值得学习与参考的实用资料
    2021-05-06下载
    积分:1
  • 计算机组成原理期末复习重点总结
    本文档适用于大学生学习。主要归纳了计算机组成原理该科目的知识内容,用于期末复习。其中,部分资料为手写归纳,若出现错误请以课本为主星章对奴斜加迹一子电叶尊加亠究漏收电寻对水第代电陪引机第m大现真电计率五代善适计计尊机下分大型和E型和(高座能计加,起邻机,机。微望机22站图形强入利讨机(克入宣内研为時定方用温计专甲加养钝沉言顶程方一五佛。序南假记一可混言→机机费丸罢概描系力輒他指友)计尊加系览的是指附能够程序所四列计机系属池,可根点1结构与西能筋性计摩個氏是指加何突观对加构阿角属指与现机属性)仔夏计導机塔点)消金据存子鸦内,可挖地址形司3),指加椒推均甲二进劇表京)满由操市吊和她(源体脱粒位)今有備内把序悟該4)以泛摩题为中/↓现以有儒为)分鼻机餐很计而叫大烟章事件伦原Am从定伴:如快菜部伴执行速度所兼得秦瓷性庭加速比受限子试評件在系瓷中所占际重号性系涵能(、执行时同染进前)糸瓶如座比=系铙能品前)机行时间(后驶同(5)洪时时的1)x[(进例计+到评戈故行间前→系能加化代应司(下)可设进比例十的足越兼得而益程序而局部性原理时国和皇司)席章A基孤2|105余52(105)。=(11o|o1)212从般×→取坐0,80≤2原0XX≤为为真为整际应都0十原:L+0原二0,0000000-01原二1,0o0oco0模子益武而临界值边M)m整为补福:了30时82=x.[+0=[XD时[补=A+=从=A:)例:x=10)[2+=管位X=-1101=20=1000000直宦原码装换白科:了有为距模=有愿三8反:正码=嚓真负N反:原除磨号取反,原:-127~121)~8路-18~1补二十病而表示:鹃为x-(1)=真鱼万=真值例:像评单精度示701a.0-1010(·0|=·01089 ol01 t ollI Il- 1o0o olo△傅鸡宜格值制正殺原函0原硝0左病0升B右反A+8]补=1十工+补3号励态A-B]料三[A+TB补书两位3查利断?0=0直播乘该A例求解101x来礼点A0n+ oQ CoM初鱼0000A←A+Ao101鸡。0(00计鸦,。。010AA+10|110右形0010(A←A+Nt0001/0(在形0100:CC764=101160neoe. cetl Iec,10h-Ilool onto K=-T二u100l.例求解11初恒为0永截神0M+,形考A人初,oo管AA-A401nom号在6o011彩·将1001011I44+9101。106o0右移20101019101011右形「。。10100在补位臂号n移,n形卫得点运臂X= XM x2X2MEEX+y=(Xm X2x2ESE十YAXE-TEXx二(XD)x2变(=)x-Y=(Am2XE-TEx/YXA/以人点加腐以而墓原理).对操限操7教4置对D下密差,小硝同大砖看,所强小是事同在移但,每市,可1)教两加对里碳上,以对能行相应)将笼果格吧:如录足都不是规格形龙,则各信果满得点数而乘豫法两午将点极刘来,支形的育为两乘所丽违形,其尾赦为两来数尾数勇个将南相阶商的网丽被徐超两成种国商的尾为减毅勇尾除以乘敬的尾搬检加料队同说是长度相词函两进制烯面对应格不司的比奇偶验吨用奇烛验时,校的设置变候证特报得和成中的的截力都使甲成验要原的限5出=骂:如运算CkC城酸乘除善除以中如派席换武减例M)=1D0.G=101求莫循序兄余校的解0(n3,Mn)=10000/1100600·2=-100060DGU)01000余R)=010·可借那兄余为0ABD·x2+20=10010=(0D Tu)传是T6,W硝正一侵梯位的汉码的位的港取频合2-2m+k4m为倍夏色的都,极验应汉丽C排放在殇亠这十9+98十14+414+1Hu HnH1。?H0DDe Ds C4 D4 D3D C D, CC1=H1二Hbs①H7①日?凸2二A=2份H6田H7Jpo③HC2=H4二HH6出1⑤4=H2=H701.nBC4C2C1Bc4c3c,=0→误0果十进剧→误色置
    2020-12-01下载
    积分:1
  • 基于C++和数据库SQL server开发的商品销售管理系统(含有源序)
    基于C++和数据库SQL server开发的商品销售管理系统(含有源程序)
    2020-12-01下载
    积分:1
  • 自动对账系统
    【实例简介】可以有效完成两个excel数据核对,通过有效选择内容,实现自动对账。是财务、审计、资金等行业工作人员的好帮手。
    2021-11-12 00:33:11下载
    积分:1
  • LABVIEW 西门子PLC TCP 通讯.zip
    【实例简介】基于LABVIEW 的西门子S7 系列PLC的上位机通讯代码 TCP协议
    2021-11-30 00:38:24下载
    积分:1
  • libevent参考手册(中文版)+libevent源码深度剖析
    libevent参考手册(中文版) + libevent源码深度剖析zszszs
    2020-11-28下载
    积分:1
  • 交互式多模型 IMM(CA/CV混合)及代码实现
    基于交互式多模型算法进行仿真,.程序中采用了两个模型,将CV,CA模型混合起来进行估计,仿真场景可以自己设计,完成车辆位置跟踪。
    2020-12-11下载
    积分:1
  • Finite-Dimensional Vector Spaces - P. Halmos (Springer, 1987)
    在学习代数学之余,值得一看的代数学书籍。里面介绍了更为丰富的代数学概念和结论。PREFACEMy purpose in this book is to treat linear transformations on finite-dimensional vector spaces by the methods of more general theories. Theidea is to emphasize the simple geometric notions common to many partsof mathematics and its applications, and to do so in a language that givesaway the trade secrets and tells the student what is in the back of the mindsof people proving theorems about integral equations and Hilbert spaces.The reader does not, however, have to share my prejudiced motivationExcept for an occasional reference to undergraduate mathematics the bookis self-contained and may be read by anyone who is trying to get a feelingfor the linear problems usually discussed in courses on matrix theory orhigher"algebra. The algebraic, coordinate-free methods do not lose powerand elegance by specialization to a finite number of dimensions, and theyare, in my belief, as elementary as the classical coordinatized treatmentI originally intended this book to contain a theorem if and only if aninfinite-dimensional generalization of it already exists, The temptingeasiness of some essentially finite-dimensional notions and results washowever, irresistible, and in the final result my initial intentions are justbarely visible. They are most clearly seen in the emphasis, throughout, ongeneralizable methods instead of sharpest possible results. The reader maysometimes see some obvious way of shortening the proofs i give In suchcases the chances are that the infinite-dimensional analogue of the shorterproof is either much longer or else non-existent.A preliminary edition of the book (Annals of Mathematics Studies,Number 7, first published by the Princeton University Press in 1942)hasbeen circulating for several years. In addition to some minor changes instyle and in order, the difference between the preceding version and thisone is that the latter contains the following new material:(1) a brief dis-cussion of fields, and, in the treatment of vector spaces with inner productsspecial attention to the real case.(2)a definition of determinants ininvariant terms, via the theory of multilinear forms. 3 ExercisesThe exercises(well over three hundred of them) constitute the mostsignificant addition; I hope that they will be found useful by both studentPREFACEand teacher. There are two things about them the reader should knowFirst, if an exercise is neither imperative "prove that.., )nor interrogtive("is it true that...?" )but merely declarative, then it is intendedas a challenge. For such exercises the reader is asked to discover if theassertion is true or false, prove it if true and construct a counterexample iffalse, and, most important of all, discuss such alterations of hypothesis andconclusion as will make the true ones false and the false ones true. Secondthe exercises, whatever their grammatical form, are not always placed 8oas to make their very position a hint to their solution. Frequently exer-cises are stated as soon as the statement makes sense, quite a bit beforemachinery for a quick solution has been developed. A reader who tries(even unsuccessfully) to solve such a"misplaced"exercise is likely to ap-preciate and to understand the subsequent developments much better forhis attempt. Having in mind possible future editions of the book, I askthe reader to let me know about errors in the exercises, and to suggest im-provements and additions. (Needless to say, the same goes for the text.)None of the theorems and only very few of the exercises are my discovery;most of them are known to most working mathematicians, and have beenknown for a long time. Although i do not give a detailed list of my sources,I am nevertheless deeply aware of my indebtedness to the books and papersfrom which I learned and to the friends and strangers who, before andafter the publication of the first version, gave me much valuable encourage-ment and criticism. Iam particularly grateful to three men: J. L. Dooband arlen Brown, who read the entire manuscript of the first and thesecond version, respectively, and made many useful suggestions, andJohn von Neumann, who was one of the originators of the modern spiritand methods that I have tried to present and whose teaching was theinspiration for this bookP、R.HCONTENTS的 FAPTERPAGRI SPACESI. Fields, 1; 2. Vector spaces, 3; 3. Examples, 4;4. Comments, 55. Linear dependence, 7; 6. Linear combinations. 9: 7. Bases, 108. Dimension, 13; 9. Isomorphism, 14; 10. Subspaces, 16; 11. Calculus of subspaces, 17; 12. Dimension of a subspace, 18; 13. Dualspaces, 20; 14. Brackets, 21; 15. Dual bases, 23; 16. Reflexivity, 24;17. Annihilators, 26; 18. Direct sums, 28: 19. Dimension of a directsum, 30; 20. Dual of a direct sum, 31; 21. Qguotient spaces, 33;22. Dimension of a quotient space, 34; 23. Bilinear forms, 3524. Tensor products, 38; 25. Product bases, 40 26. Permutations41; 27. Cycles,44; 28. Parity, 46; 29. Multilinear forms, 4830. Alternating formB, 50; 31. Alternating forms of maximal degree,52II. TRANSFORMATIONS32. Linear transformations, 55; 33. Transformations as vectors, 5634. Products, 58; 35. Polynomials, 59 36. Inverses, 61; 37. Mat-rices, 64; 38. Matrices of transformations, 67; 39. Invariance,7l;40. Reducibility, 72 41. Projections, 73 42. Combinations of pro-jections, 74; 43. Projections and invariance, 76; 44. Adjoints, 78;45. Adjoints of projections, 80; 46. Change of basis, 82 47. Similarity, 84; 48. Quotient transformations, 87; 49. Range and null-space, 88; 50. Rank and nullity, 90; 51. Transformations of rankone, 92 52. Tensor products of transformations, 95; 53. Determinants, 98 54. Proper values, 102; 55. Multiplicity, 104; 56. Triangular form, 106; 57. Nilpotence, 109; 58. Jordan form. 112III ORTHOGONALITY11859. Inner products, 118; 60. Complex inner products, 120; 61. Innerproduct spaces, 121; 62 Orthogonality, 122; 63. Completeness, 124;64. Schwarz e inequality, 125; 65. Complete orthonormal sets, 127;CONTENTS66. Projection theorem, 129; 67. Linear functionals, 130; 68. P aren, gBCHAPTERtheses versus brackets, 13169. Natural isomorphisms, 138;70. Self-adjoint transformations, 135: 71. Polarization, 13872. Positive transformations, 139; 73. Isometries, 142; 74. Changeof orthonormal basis, 144; 75. Perpendicular projections, 14676. Combinations of perpendicular projections, 148; 77. Com-plexification, 150; 78. Characterization of spectra, 158; 79. Spec-ptral theorem, 155; 80. normal transformations, 159; 81. Orthogonaltransformations, 162; 82. Functions of transformations, 16583. Polar decomposition, 169; 84. Commutativity, 171; 85. Self-adjoint transformations of rank one, 172IV. ANALYSIS....17586. Convergence of vectors, 175; 87. Norm, 176; 88. Expressions forthe norm, 178; 89. bounds of a self-adjoint transformation, 17990. Minimax principle, 181; 91. Convergence of linear transformations, 182 92. Ergodic theorem, 184 98. Power series, 186APPENDIX. HILBERT SPACERECOMMENDED READING, 195INDEX OF TERMS, 197INDEX OF SYMBOLS, 200CHAPTER ISPACES§L. FieldsIn what follows we shall have occasion to use various classes of numbers(such as the class of all real numbers or the class of all complex numbers)Because we should not at this early stage commit ourselves to any specificclass, we shall adopt the dodge of referring to numbers as scalars. Thereader will not lose anything essential if he consistently interprets scalarsas real numbers or as complex numbers in the examples that we shallstudy both classes will occur. To be specific(and also in order to operateat the proper level of generality) we proceed to list all the general factsabout scalars that we shall need to assume(A)To every pair, a and B, of scalars there corresponds a scalar a+called the sum of a and B, in such a way that(1) addition is commutative,a+β=β+a,(2)addition is associative, a+(8+y)=(a+B)+y(3 there exists a unique scalar o(called zero)such that a+0= a forevery scalar a, and(4)to every scalar a there corresponds a unique scalar -a such that十(0(B)To every pair, a and B, of scalars there corresponds a scalar aBcalled the product of a and B, in such a way that(1)multiplication is commutative, aB pa(2)multiplication is associative, a(Br)=(aB)Y,( )there exists a unique non-zero scalar 1 (called one)such that al afor every scalar a, and(4)to every non-zero scalar a there corresponds a unique scalar a-1or-such that aaSPACES(C)Multiplication is distributive with respect to addition, a(a+n)If addition and multiplication are defined within some set of objectsscalars) so that the conditions(A),B), and (c)are satisfied, then thatset(together with the given operations) is called a field. Thus, for examplethe set Q of all rational numbers(with the ordinary definitions of sumand product)is a field, and the same is true of the set of all real numberaand the set e of all complex numbersHHXERCISIS1. Almost all the laws of elementary arithmetic are consequences of the axiomsdefining a field. Prove, in particular, that if 5 is field and if a, and y belongto 5. then the following relations hold80+a=ab )Ifa+B=a+r, then p=yca+(B-a)=B (Here B-a=B+(a)(d)a0=0 c=0.(For clarity or emphasis we sometimes use the dot to indi-cate multiplication.()(-a)(-p)(g).If aB=0, then either a=0 or B=0(or both).2.(a)Is the set of all positive integers a field? (In familiar systems, such as theintegers, we shall almost always use the ordinary operations of addition and multi-lication. On the rare occasions when we depart from this convention, we shallgive ample warningAs for "positive, "by that word we mean, here and elsewherein this book, "greater than or equal to zero If 0 is to be excluded, we shall say"strictly positive(b)What about the set of all integers?(c) Can the answers to these questiong be changed by re-defining addition ormultiplication (or both)?3. Let m be an integer, m2 2, and let Zm be the set of all positive integers lessthan m, zm=10, 1, .. m-1). If a and B are in Zmy let a +p be the leastpositive remainder obtained by dividing the(ordinary) sum of a and B by m, andproduct of a and B by m.(Example: if m= 12, then 3+11=2 and 3. 11=9)a) Prove that i is a field if and only if m is a prime.(b What is -1 in Z5?(c) What is囊izr?4. The example of Z, (where p is a prime)shows that not quite all the laws ofelementary arithmetic hold in fields; in Z2, for instance, 1 +1 =0. Prove thatif is a field, then either the result of repeatedly adding 1 to itself is always dif-ferent from 0, or else the first time that it is equal to0 occurs when the numberof summands is a prime. (The characteristic of the field s is defined to be 0 in thefirst case and the crucial prime in the second)SEC. 2VECTOR SPACES35. Let Q(v2)be the set of all real numbers of the form a+Bv2, wherea and B are rational.(a)Ie(√2) a field?(b )What if a and B are required to be integer?6.(a)Does the set of all polynomials with integer coefficients form a feld?(b)What if the coeficients are allowed to be real numbers?7: Let g be the set of all(ordered) pairs(a, b)of real numbers(a) If addition and multiplication are defined by(a月)+(,6)=(a+y,B+6)and(a,B)(Y,8)=(ary,B6),does s become a field?(b )If addition and multiplication are defined by(α,月)+⑦,b)=(a+%,B+6)daB)(,b)=(ay-6a6+的y),is g a field then?(c)What happens (in both the preceding cases)if we consider ordered pairs ofcomplex numbers instead?§2. Vector spaceWe come now to the basic concept of this book. For the definitionthat follows we assume that we are given a particular field s; the scalarsto be used are to be elements of gDEFINITION. A vector space is a set o of elements called vectors satisfyingthe following axiomsQ (A)To every pair, a and g, of vectors in u there corresponds vectora t y, called the aum of a and y, in such a way that(1)& ddition is commutative,x十y=y十a(2)addition is associative, t+(y+2)=(+y)+a(3)there exists in V a unique vector 0(called the origin) such thata t0=s for every vector and(4)to every vector r in U there corresponds a unique vector -rthat c+(-x)=o(B)To every pair, a and E, where a is a scalar and a is a vector in u,there corresponds a vector at in 0, called the product of a and a, in sucha way that(1)multiplication by scalars is associative, a(Bx)=aB)=, and(2 lz a s for every vector xSPACESSFC B(C)(1)Multiplication by scalars is distributive with respect to vectorddition, a(+y=a+ ag, and2)multiplication by vectors is distributive with respect to scalar ad-dition, (a B )r s ac+ Bc.These axioms are not claimed to be logically independent; they aremerely a convenient characterization of the objects we wish to study. Therelation between a vector space V and the underlying field s is usuallydescribed by saying that v is a vector space over 5. If S is the field Rof real number, u is called a real vector space; similarly if s is Q or if gise, we speak of rational vector spaces or complex vector space§3. ExamplesBefore discussing the implications of the axioms, we give some examplesWe shall refer to these examples over and over again, and we shall use thenotation established here throughout the rest of our work.(1) Let e(= e)be the set of all complex numbers; if we interpretr+y and az as ordinary complex numerical addition and multiplicatione becomes a complex vector space2)Let o be the set of all polynomials, with complex coeficients, in avariable t. To make into a complex vector space, we interpret vectoraddition and scalar multiplication as the ordinary addition of two poly-nomials and the multiplication of a polynomial by a complex numberthe origin in o is the polynomial identically zeroExample(1)is too simple and example (2)is too complicated to betypical of the main contents of this book. We give now another exampleof complex vector spaces which(as we shall see later)is general enough forall our purposes.3)Let en,n= 1, 2,. be the set of all n-tuples of complex numbers.Ix=(1,…,轨)andy=(m1,…,n) are elements of e, we write,,bdefinitionz+y=〔1+叽,…十物m)0=(0,…,0),-inIt is easy to verify that all parts of our axioms(a),(B), and (C),52, aresatisfied, so that en is a complex vector space; it will be called n-dimenaionalcomplex coordinate space
    2020-12-05下载
    积分:1
  • 西电的雷达原理第三版课本及习答案
    西安电子科技大学雷达原理第三版电子书及课后习题答案
    2020-12-12下载
    积分:1
  • 696518资源总数
  • 106208会员总数
  • 21今日下载