Ad
  • Custom User Avatar

    There are no random tests.

  • Custom User Avatar
    ϕ = 
      n11 * n00 - n10 * n01
      ----------------
      sqrt√(n1 * n0 * n1 * n0)
    

    This formula is wrong; the denominator should be sqrt((n00 + n01) * (n10 + n11) * (n00 + n10) * (n01 + n11)).

  • Custom User Avatar

    This problem has been copied from Eloquent Javascript which is licensed under Creative Commons attribution-noncommercial license.

    In which it is clearly mentioned:

    You are free to:
    
        Share — copy and redistribute the material in any medium or format
        Adapt — remix, transform, and build upon the material
    
        The licensor cannot revoke these freedoms as long as you follow the license terms.
    
    
    Under the following terms:
    
        Attribution — You must give appropriate credit, provide a link to the license, and 
        indicate if changes were made. You may do so in any reasonable manner, but not in any
        way that suggests the licensor endorses you or your use. 
    

    So you've to give the credit in the description.

  • Custom User Avatar

    This is copied from Eloquent Javascript - maybe you should at least credit it?

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Because those are different things 🙂

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    a and a, b and B. Therefore, there are 2 characters that occur in duplicate.
    I hope that helps.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    The bottom-most example test cases looked something like this:

    Test.assertEquals(correlations2.beer == 0.25);
    

    The double equal signs should be replaced with a comma.

    But since the kata is in cooperation mode, I edited it myself. :-)

    Thanks for a nice kata.

  • Custom User Avatar

    What are you saying the issue is?

  • Custom User Avatar

    Thanks for pointing that one out Steve! Feel free to implement the table if you think it is more clear. This Kata is in collaboration mode.

  • Custom User Avatar

    Apart from Steve's issues, the last provided test cases are using Test.assertEquals wrongly like Test.expect. They should be:

    Test.assertEquals(correlations2.beer, 0.25);
    Test.assertEquals(correlations2.lasagna, -0.5);
    Test.assertEquals(correlations2.running, 0.25);
    
  • Default User Avatar

    This is an interesting and educational kata. Thanks for making it!

    There are a few minor issues with the description:

    The notation explanation could be clearer. You could borrow the table from Wikipedia, which is pretty clear:

    y = 1 y = 0 total
    x = 1 n11 n10 n1●
    x = 0 n01 n00 n0●
    total n●1 n●0 n

    The markdown for the table above looks like this:

    |       | y = 1 | y = 0 | total |
    |-------|-------|-------|-------|  
    | x = 1 |  n11  |  n10  |  n1●  |
    | x = 0 |  n01  |  n00  |  n0●  |
    | total |  n●1  |  n●0  |  n    |
    
    
    

    Also, the second assertion in the sample tests expects the correlation to be -.05, but it should be -0.5.