Friday 24 January 2014

k-means clustering calculator

This blog post implements a basic k-means clustering algorithm, which can be applied to either a scalar number or 2-d data (x and y component). Graphs of the clustered data and algorithm convergence (as measured by the changes in cluster membership of the data samples between consecutive iterations) are displayed below. For a more general (and better performing) k-means calculator, you can see a much more recent blog post here

The cluster centres (or centroids) are initialised using the k-means++ algorithm as proposed by David Arthur and Sergei Vassilvitski in 2007.

Please enter the numbers in the text areas below - either one number per line or two comma separated numbers per line. There must be no new line after the last number.

Alternatively you can choose to load a CSV file, which must be either a single column of numbers (for a real only input) or two comma-separated columns of numbers - the first line can be a comment line, starting with the character #.

To perform the k-means clustering, please enter the number of clusters and the number of iterations in the appropriate fields, then press the button labelled "Perform k-means clustering" below - the results will populate the textareas below labelled "Output" and "Centroid values". The "Output" textarea will list the sample values and the cluster/centroid index each sample belongs to, while the "Centroid values" textarea will list the centroid index and the value of the centroids (or cluster centres).

Note that the k-means algorithm can converge to a local minimum, and also exhibit degeneracy, whereby one of the clusters has no members. Should these scenarios occur, simply re-run the algorithm, by clicking on the button labelled "Perform k-means clustering".

An example two-dimensional dataset has been loaded, with three clusters of 200 samples - the number of iterations is set to ten. Pressing the "Perform k-means clustering" can result in a local minima being reached, which will be obvious to spot from the Cluster Visualisation display. In this case, simply re-run the algorithm.



Input




Enter number of clusters (k value):-

Enter number of iterations:-





Output:-
Centroid values:-



Cluster Visualisation
Value
Samples
Algorithm convergence
Change
Iteration number

Summary statistics pending..

103 comments:

  1. US METRO POPULATIONS 2018 FROM WIKI
    19979477
    13291486
    9498716
    7539711
    6997384
    6249950
    6198782
    6096372
    5949951
    4875390
    4857962
    4729484
    4622361
    4326442
    3939363
    3629190
    3343364
    3142663
    2932415
    2805465
    2802789
    2572692
    2569213
    2518036
    2478810
    2345210
    2324743
    2231647
    2190209
    2168316
    2143651
    2106541
    2057009
    2048703
    1999107
    1930961
    1728733
    1621337
    1576113
    1534701
    1396445
    1362540
    1350620
    1306172
    1297310
    1270399
    1222540
    1206300
    1151801
    1130152
    1071082
    1069405
    1039073
    994400
    993797
    980080
    947866
    943823
    942198
    915927
    906626
    896764
    883309
    883169
    865939
    857620
    850967
    845553
    842913
    832666
    831310
    821573
    806548
    787643
    767711
    754610
    752660
    741104
    738939
    730426
    708009
    704845
    675669
    675067
    671456
    660422
    659605
    655409
    650502
    644888
    633768
    631761
    604167
    602871
    596849
    580166
    575412
    574659
    573493
    560793
    555485
    549815
    549128
    543557
    538952
    535420
    516697
    499942
    494883
    489364
    482040
    481893
    480891
    469764
    466978
    465861
    462693
    459585
    452950
    451679
    448273
    446610
    446527
    437631
    436341
    435594
    432102
    423908
    420152
    415247
    413757
    409979
    409526
    406892
    399148
    398655
    397261
    389494
    387094
    385145
    381451
    379611
    378488
    373225
    370963
    369811
    368416
    368373
    359977
    352823
    350518
    341298
    340318
    337658
    334590
    326078
    322424
    321591
    319068
    314672
    314305
    314172
    306616
    305451
    296224
    294436
    292264
    291410
    288212
    286419
    284010
    282318
    278799
    278644
    275910
    274765
    274255
    272295
    272061
    271942
    269805
    268049
    266784
    265947
    265653
    265429
    263353
    262431
    251446
    245471
    243575
    240219
    239643
    237524
    235232
    232594
    231993
    231256
    230221
    229737
    225685
    221828
    221083
    219802
    219564
    219417
    218022
    217686
    217522
    213413
    212128
    211306
    211037
    210080
    209550
    209136
    207636
    205560
    204961
    202719
    202148
    201451
    199801
    197683
    196584
    193835
    191996
    190800
    188597
    184998
    184029
    181827
    180040
    180005
    179914
    178902
    178599
    178550
    178337
    177432
    176805
    174848
    173588
    173401
    171700
    171677
    171451
    171020
    169725
    169659
    169507
    169405
    168669
    167762
    167529
    167295
    166436
    163941
    163129
    162805
    162124
    161505
    158823
    157672
    157413
    154835
    154141
    153378
    153207
    153044
    153009
    152046
    151520
    151366
    151306
    151096
    150972
    150972
    150242
    150056
    149414
    148904
    148749
    148245
    147929
    147149
    146174
    146021
    143983
    142854
    141314
    140794
    140259
    140045
    139810
    139417
    136808
    135428
    135277
    134585
    134487
    133991
    133777
    132678
    132532
    131730
    129209
    128754
    128206
    127335
    126770
    126490
    126348
    126198
    125462
    125219
    125043
    124475
    123625
    123248
    123007
    122492
    121436
    121099
    119943
    119711
    119114
    118791
    118581
    118456
    117272
    117064
    115456
    114772
    114277
    113664
    112664
    111755
    110096
    110024
    110007
    108987
    107679
    106512
    105424
    104712
    103923
    103066
    102811
    102793
    102663
    102501
    102299
    101647
    99619
    99154
    98976
    98971
    98105
    97980
    97927
    97915
    96982
    96854
    92560
    92101
    90033
    89515
    87393
    87138
    85088
    84254
    83696
    83209
    82753
    82366
    81643
    80495
    79115
    76806
    64981
    63018
    60913
    55414

    ReplyDelete
  2. The worst part of it was that the software only worked intermittently and the data was not accurate. You obviously canot confront anyone about what you have discovered if the information is not right.data science course in noida

    ReplyDelete
    Replies
    1. This is a basic k-means calculator - the k-means algorithm converges locally, so it will work intermittently. Obviously, if you want something far better, you can always look elsewhere.

      Delete
  3. this is really nice to read..informative post is very good to read..thanks a lot!data science course

    ReplyDelete
  4. I am looking for and I love to post a comment that "The content of your post is awesome" Great work!
    software course

    ReplyDelete
  5. This is a great post I saw thanks to sharing. I really want to hope that you will continue to share great posts in the future.
    https://360digitmg.com/india/data-science-using-python-and-r-programming-in-delhi

    ReplyDelete
  6. #Great work. Can you post similar articles on p-median and CLARA clustering? It will be helpful for newbies like us.

    ReplyDelete
  7. Your content is very unique and understandable useful for the readers keep update more article like this.
    business analytics courses in aurangabad

    ReplyDelete


  8. Wow what a Great Information about World Day it's an exceptionally pleasant educational post. a debt of gratitude is in order for the post.
    Best Digital Marketing Institute in Hyderabad

    ReplyDelete
  9. A good blog always comes-up with new and exciting information and while reading I have feel that this blog is really have all those quality that qualify a blog to be a one.
    data scientist training and placement in hyderabad

    ReplyDelete
  10. This is most informative and also this post most user friendly and super navigation to all posts... Thank you so much for giving this information to me..
    machine learning course aurangabad

    ReplyDelete
  11. Thanks for the information about Blogspot very informative for everyone
    data science certification

    ReplyDelete
  12. your blog everyday and try to learn something from your blog. Thank you and I'm waiting for your new post.
    best data science institute in hyderabad

    ReplyDelete
  13. I have expressed a few of the articles on your website now, and I really like your style of blogging. I added it to my favorite’s blog site list and will be checking back soon…
    Best Data Science courses in Hyderabad

    ReplyDelete
  14. I am genuinely thankful to the holder of this web page who has shared this wonderful paragraph at at this place
    Best Data Science courses in Hyderabad

    ReplyDelete
  15. thanks for sharing, this blog. Keep sharing more blogs again soon.
    Data Science Training in Hyderabad

    ReplyDelete
  16. This post is very simple to read and appreciate without leaving any details out. Great work!
    digital marketing courses in hyderabad with placement

    ReplyDelete

  17. Awesome article, it was exceptionally helpful! I simply began in this and I'm becoming more acquainted with it better! Cheers, keep doing awesome!

    Try to visit my page ź°•ė‚Øģ˜¤ķ”¼
    (jk)

    ReplyDelete
  18. Good content and clear explanation. Keep sharing more blogs again soon. Thank you.
    AI Course in Hyderabad

    ReplyDelete
  19. Stupendous blog huge applause to the blogger and hoping you to come up with such an extraordinary content in future. Surely, this post will inspire many aspirants who are very keen in gaining the knowledge. Expecting many more contents with lot more curiosity further.

    data science course in varanasi

    ReplyDelete
  20. If you don"t mind proceed with this extraordinary work and I anticipate a greater amount of your magnificent blog entries
    data science course in malaysia

    ReplyDelete
  21. Really impressed! Everything is very open and very clear clarification of issues. It contains true facts. Your website is very valuable. Thanks for sharing.
    real estate company

    ReplyDelete
  22. Truly, one of the best posts I've ever witnessed in my whole life. Wow, just keep it up.
    real estate company
    Real Estate consultants in India

    ReplyDelete
  23. Your website is very valuable. Thanks for sharing.
    flat for sale

    ReplyDelete
  24. The cluster centres (or centroids) are initialised using the k-means++ algorithm as proposed by David Arthur and Sergei Vassilvitski in 2007.
    huawei

    ReplyDelete
  25. this is very interesting and helpful for me. Thank you for sharing this with us.
    BISE Lahore Board BISELAHORE 9th Class Result 2021

    ReplyDelete
  26. I am really enjoying reading your well written articles. It looks like you spend a lot of effort and time on your blog. I have bookmarked it and I am looking forward to reading new articles. Keep up the good work.cloud computing course in nagpur

    ReplyDelete
  27. Hello Yorkies From Elvis Yorkshire Terrier - Specializing in Teacup Yorkies
    We are small breeders whose goal is to produce healthy, high quality little teacup size Yorkie puppies for sale. In order to have puppies for sale most of the time we have teamed up with a couple of other Yorkie breeders that have the same goals in mine. In fact we have some of their Yorkie breeders and they have some of our breeders.
    yorkies for sale, teacup yorkie puppies for sale, Yorkie puppies for sale
    yorkie for sale, teacup yorkies for sale

    ReplyDelete
  28. I absolutely agree with the above. In addition, I would encourage using a service like yorkies for sale, sphynx cats for sale

    ReplyDelete
  29. All kittens adopted from royaltykitten.com Sphynx Cattery come with current vaccinations, dewormings, written sales contract, Two year health guarantee, health record, Spayed or Neutered, 30 days of free pet insurance for your kitten,
    sphynx cats for sale, sphynx kittens for sale, hairless kitten for sale, hairless cats for sale, and a kitten care package which includes food, litter and several surprises for you and your kitten. sphynx cat for sale near me, sphynx kitten for sale, hairless cats for sale near me, hairless kitten for sale, hairless cats for sale Kittens are Generally ready to leave between 10 to 11 weeks old.
    Sphynx do not develop as quickly as cats with hair.


    ReplyDelete
  30. In the wake of perusing your article, I was astounded. I realize that you clarify it well overall. What's more, I trust that different perusers will likewise encounter how I feel in the wake of perusing your article. data science training in gurgaon

    ReplyDelete
  31. I read that Post and got it fine and informative. Please share more like that...
    data scientist training in malaysia

    ReplyDelete
  32. That could include would-be terrorists probing for weaknesses, Apple said, adding that his deputies currently have no legal grounds to question such a person.
    uni

    ReplyDelete
  33. I really enjoyed this blog. It's an informative topic. It helps me very much to solve some problems. Its opportunities are so fantastic and the working style so speedy.
    data analytics training in hyderabad

    ReplyDelete
  34. I recently found a lot of useful information on your website, especially this blog page. Among the lots of comments on your articles. Thanks for sharing.
    best data science training in hyderabad

    ReplyDelete
  35. I really appreciate the kind of topics you post here. Thanks for sharing us a great information that is actually helpful. Good day! artificial intelligence training institute in noida

    ReplyDelete
  36. To get your 9th BISE Faisalabad result by SMS or text message via a mobile phone. Type your roll number in the write SMS option and send it to 800240.

    ReplyDelete
  37. Fantastic blog, Really an awesome blog. Very useful to many people. Informative content and knowledgeable. Keep sharing more stuff like this. Thank you.
    Data Science Course Training in Hyderabad
    Data Science Course Training in Hyderabad with Placements

    ReplyDelete
  38. This blog post implements a basic k-means clustering algorithm, which can be applied to either a scalar number or 2-d data (x and y component). Graphs of the clustered data and algorithm convergence (as measured by the changes in cluster membership of the data samples between consecutive iterations) are displayed below. For a more general (and better performing) k-means calculator, you can see a much more recent blog post here
    chakwal

    ReplyDelete
  39. incredible keep it up thanks for best sharing love it ybr

    ReplyDelete
  40. Great tips and very easy to understand. This will definitely be very useful for me when I get a chance to start my blog.
    full stack developer course with placement

    ReplyDelete
  41. Here is the good post, check the all latest news here for more visit here 10th Class Date Sheet 2022 faisalabad Board

    ReplyDelete
  42. love it its incredible thanks for best sharing club

    ReplyDelete
  43. It's late discovering this demonstration. At any rate, it's a thing to be acquainted with that there are such occasions exist. I concur with your Blog and I will have returned to investigate it more later on so please keep up your demonstration.

    ReplyDelete
  44. 360DigiTMG, the top-rated organisation among the most prestigious industries around the world, is an educational destination for those looking to pursue their dreams around the globe. The company is changing careers of many people through constant improvement, 360DigiTMG provides an outstanding learning experience and distinguishes itself from the pack. 360DigiTMG is a prominent global presence by offering world-class training. Its main office is in India and subsidiaries across Malaysia, USA, East Asia, Australia, Uk, Netherlands, and the Middle East.

    ReplyDelete
  45. I think this is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article.
    cyber security course in malaysia

    ReplyDelete
  46. wow! very nice article. thank you for sharing this.JavaScript Certification

    ReplyDelete
  47. Being the best darn dog, he deserves the best possible feed station of course. I wanted something that would look good because there's nowhere to feed him except right between the kitchen and dining areas. I also wanted something that would hold his kibble (a 35lb bag) and that wouldn't require any complicated instructions for opening so the kids could easily fill his bowl.
    hybrid

    ReplyDelete
  48. NICE ONE KEEP POSTING LIKE THIS, BEAUTIFUL BLOG POST bestpakstudy. You may visit pakistan biggest education network here. Very interesting your thought on this beautiful topic by technohadayatThanks. Good spirtual though on the great topic by jobs4mine

    ReplyDelete
  49. love it keep it up best of luck love it ramking

    ReplyDelete
  50. newsboy is online website for news and education.
    news boy

    ReplyDelete
  51. This is a great post. I like this topic.This site has lots of advantage.I found many interesting things from this site. It helps me in many ways.Thanks for posting this again. data analytics course in surat

    ReplyDelete
  52. lovely incredible keep it up bike

    ReplyDelete

  53. Thanks for sharing this great article we appreciate it, we provide instagram reels download freely and unlimited.

    ReplyDelete
  54. Register for the Data Scientist courses in Bangalore and learn to build your Data Science and Machine learning workflows. Build a portfolio of work to have on your resume with live projects which are supported by an industry-relevant curriculum. Get Access to our learning management system (LMS) that provides you with all the material and assignments that will help you master all the concepts for you to solve any problem related to deciphering the hidden meaning in data.


    Data Science in Bangalore

    ReplyDelete
  55. Venture into the world of opportunities with Data Science in Bangalore and learn the valuable skills to demonstrate your capabilities to tackle this evolution of huge data. Avail benefits like Placement Assistance, Mock Interview, and Resume Building support from the placement team. Enroll now and learn Python, Tableau, SQL, Hadoop, and Spark to become a specialist in Data Science.

    Best Data Science Training institute in Bangalore

    ReplyDelete
  56. Gain expertise in the relevant and current practices, challenges, and research involved in the field of Data Science. Learn all the skills from non-coding essentials to data science and machine learning by enrolling in the Data Science course in Bangalore. Using real data sets across a range of domains enhances your skills in supervised and unsupervised learning, neural networks, sampling techniques, support vector machines, and more. Get certified in Data Science to get one step ahead towards a lucrative career.


    Data Science Course in Bangalore with Placement

    ReplyDelete

  57. I am a new user of this site so here i saw multiple articles and posts posted by this site,
    I curious more interest in some of them hope you will give more information on this topics in your next articles.
    360DigiTMG business analytics course

    ReplyDelete
  58. Glad to chat your blog, I seem to be forward to more reliable articles and I think we all wish to
    thank so many good articles, blog to share with us.
    data analytics course in hyderabad

    ReplyDelete
  59. I will need this post to total my assignment in the college, and it has exact same topic together with your write-up. Thanks, good share.
    I am impressed by the information that you have on this blog. It shows how well you understand this subject.
    data scientist training in hyderabad
    Thank you very much for this useful article. I like it.

    ReplyDelete
  60. I want to submit a comment to support and wish you the best of luck.
    Need Visa Service Visit Migration Agent Perth

    ReplyDelete
  61. Thanks for giving me the opportunity to talk about a Data science course. For the Best career in Data science, I recommend Skillslash is recognized as the best data science institute in Hyderabad. We cover all the essential topics in data science like R, Python, Machine Learning, and Deep
    Learning, Tableau, etc.

    ReplyDelete
  62. That's some really insightful information you provided. My opinion is that this blog needs a lot more attention. Honestly, I think they are all excellent!
    Furthermore, I believe digital marketing skills can provide us with the confidence necessary for a successful career.

    ReplyDelete
  63. An fine topic that will be useful to others. I enjoyed reading.

    ERP software company in Hyderabad

    ReplyDelete
  64. Fantastic blog. I was drawn in, and the style is distinctive.

    Mobile app development company in Hyderabad

    ReplyDelete
  65. Teach India is a non-profit organization looking for passionate individuals who want to make a difference in the lives of underprivileged children. We partner with NGOs and provide equal access to quality education. Apply now!Teach For India, Delhi office

    ReplyDelete
  66. Looking for the best Hotels in Mathura Vrindavan? We offer luxurious accommodations and excellent service, all at an affordable price. Book your stay with us today and experience the best of Mathura Vrindavan!

    ReplyDelete
  67. Are you looking for the best Timber Plantation Shutters in Melbourne, Australia? Divine Interiors has a wide range of shutters to suit any home or office. Choose from various colours and styles to find the perfect shutter for your space. Get in touch with our team today for a free quote.

    ReplyDelete
  68. Are you looking for an online Ethical hacking course in hindi? Cyberpratibha offers the best course for beginners who want to learn hacking in Hindi. With our course, you will learn about different types of hacking, how to protect yourself from hackers, and how to ethical hack websites and systems.

    ReplyDelete
  69. Thanks for sharing this wonderful blog and it's really appreciateable
    Disputas Contratos Litigio MediaciĆ³n
    dc sex crimes

    ReplyDelete
  70. Everything is now clear after reading your article. Thank you for your contribution.

    Best digital marketing services in Hyderabad

    ReplyDelete
  71. I found the section on data visualization particularly interesting and well-explained.data scientist course in hyderabad

    ReplyDelete
  72. I found the section on model evaluation and validation in this article to be informative and comprehensive.data analyst course in chennai

    ReplyDelete
  73. I believe that the knowledge in this essay is useful for everyone. Obtaining a Canada Permanent Resident Visa is a significant milestone for individuals seeking to build a brighter future in the land of opportunities. Canada's Permanent Resident Visa program offers numerous advantages, such as access to world-class healthcare, high-quality education.

    ReplyDelete
  74. Long Strokes: Balinese Massage uses long and gliding strokes to warm up the muscles and prepare the body female to male massage centre near me for deeper work.

    ReplyDelete
  75. We would like to extend our sincere appreciation for your invaluable contribution, which has greatly enhanced the overall experience for everyone involved. Bonjour, French explorers! Dreaming of India? India e-Visa for France Citizens. You can easily apply for an e-Visa online. Whether for tourism, business, or medical purposes, this digital visa process is hassle-free. Just ensure your passport has six months' validity, have a recent photo, and a payment method for the processing fee. Get ready for an unforgettable Indian adventure!

    ReplyDelete
  76. Wonderful , really it is a very helpful post. I heartily appreciate your efforts and I will be waiting for your further posts. Thank you once again. India Visa for Iceland Citizens. Go online, fill the form, attach docs, pay up. Wait a bit, visa gets processed. Once approved, you're set for your Indian journey. Smart prep guarantees a smooth online visa process.

    ReplyDelete
  77. Its such s you learn ally the remaining component i care for such records plenty. I used to beking this precise info for a long time. Thanks and great of success female to male body massage centres

    ReplyDelete
  78. Explore the world of soothing female to male body massage at home treatments to couples' sessions, discover the perfect massage center for you.

    ReplyDelete
  79. "We recognise that finding employment in the highly competitive profession of data science was crucial to launching your career. "
    data science classes in pune

    ReplyDelete
  80. Unbelievable! I'm genuinely astonished by your articles. I'll make it a priority to locate more articles of this nature. Thank you once more for consistently sharing such valuable content; it's of immense benefit. I am a traveler and recently I traveled to Cameroon. I would like to share my experience like-Top 20 World-Changing Inventions and Innovations . Everything is so simple I got my visa online.

    ReplyDelete
  81. The duration of a From various body massage near me techniques to ambiance considerations, we'll cover it all, ensuring you make an informed choice for a serene experience. can vary, but a standard session usually lasts between 60 to 90 minutes, allowing for a comprehensive and relaxing experience.

    ReplyDelete

  82. We are grateful that you have such high-quality information on your blog.Disputas Contratos Litigio MediaciĆ³n.

    ReplyDelete
  83. As I navigated the dynamic cityscape of Bangalore, I came across the Etihad Airways office, the gateway to world-class travel experiences. Located in the heart of the city, the office became my travel haven. The address led me to a team dedicated to creating seamless journeys. A passport to unparalleled service and unforgettable destinations awaits you at the Etihad Airways Bangalore Office. One flight at a time, Etihad Airways Office has become my compass as an urban explorer.

    ReplyDelete
  84. Embarking on a journey from the heart of the Midwest to the historic East Coast, the Chicago to Boston flight promises a swift and efficient connection between two iconic American cities. With a flight time of approximately 3 to 4 hours for non-stop routes, this route offers a convenient link between the bustling urban energy of Chicago and the rich historical tapestry of Boston. Whether you're drawn to Chicago's architectural marvels or captivated by Boston's colonial heritage, this short flight ensures a seamless transition, allowing you to explore the distinct charms of both cities in a relatively brief span.

    ReplyDelete
  85. pune is top city in maharastra in this hectic life people will need body to body massage in pune for over come the tensions and relaxing issues.

    ReplyDelete
  86. The pressure applied in a massage may improve blood circulation. This can then transfer oxygen and nutrients to cells in a more efficient manner and improve overall well-being and health.
    b2b spa in chennai

    ReplyDelete

Logistic Regression Calculator and ROC Curve Plotter

This blog post implements a Logistic Regression calculator for a binary output. Consider a binary outcome response variable \(Y\...