Ad
  • Custom User Avatar

    You are right. It's in the kata description: "if you have trouble discerning if the particular sequence of 1's is a dot or a dash, assume it's a dot".

  • Custom User Avatar

    I use my own implementation of k-mean with 0s and 1s together. in case of equal distances, the algorithm assign the value to smaller centroid (does this satisfy 'if you have trouble discernin if the particular ...'?).
    The algorithm works fine except last two tests and I think I still have problem with initial centroids. Any hint about initialization?

  • Custom User Avatar

    Sure, I just can't miss it :)

  • Default User Avatar

    Thanks... :) I hope you will try the 6x6!

  • Custom User Avatar

    Thanks for an amazing kata. It's very exciting! :)

  • Custom User Avatar

    Thank you very much! I'll retry and solve that as soon as I can. Once again, thank you for creating interesting katas! :)

  • Custom User Avatar
  • Custom User Avatar

    I haven't solved this kata so I can't see your comment.

  • Custom User Avatar

    Why do you use k-means separately for 0's and 1's? The logic determining their lenths is the same, as described in the kata.

    The input (after you cut extra 0's at the ends) consists of something that's approximately 1 in length, also maybe something that's approximately 3 in length, and also maybe something that's approximately 7 in length. That should be the basis of your k-means.

  • Custom User Avatar

    I don't use scipy, I created my implementation, too. I use k-means twice with 0-token and 1-token, separately. About dots and dash, I think my solution handles it well, but not the spaces. I can pass all the short test, but the very long give me trouble. Thanks for helping :)

  • Custom User Avatar

    When this kata was created, scipy was not available here on CodeWars, so there was no any "version" of k-means available, so I had to create an implementation of my own, and it was a kind of a point.

    Are you using both 0-token and 1-token lengths in calculating the statistics?

    Also it's maybe worth quoting the kata description: "if you have trouble discerning if the particular sequence of 1's is a dot or a dash, assume it's a dot".

  • Custom User Avatar

    Which version of k-means algorithm can be used for this kata? With basic k-means algorithm (with some special init centroids), my solution can't pass the last two cases. I have trouble discerning spaces (0-bits).
    P/s: Sorry for my bad English :). Anyway, this is an amazing kata!