Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding ckmeans #36

Open
mthh opened this issue Oct 17, 2023 · 3 comments
Open

Adding ckmeans #36

mthh opened this issue Oct 17, 2023 · 3 comments

Comments

@mthh
Copy link
Member

mthh commented Oct 17, 2023

It's possible that it's faster than our Fisher-Jenks implementation (or not worse).
And our users might need it (moreover other libs like simple statistics or bin guru are offering it).

See also https://observablehq.com/@visionscarto/natural-breaks that is advocating for the use of this method (in replacement of Jenks - but I think we should still have Jenks in statsbreaks)

@mthh
Copy link
Member Author

mthh commented Jan 11, 2024

@neocarto any thoughts on this ?

@neocarto
Copy link
Member

Totally agree to add this method (in addition to jenks)

@mthh
Copy link
Member Author

mthh commented Apr 9, 2024

There is already an implementation in simple-statistics.

Not that simple statistics is particularly heavy, but I'm not sure we should depend on it just for this method.

The code for simple statistics is licensed under the ISC licence, which is relatively permissive but requires (I think) that we retain the original licence notice and the author's name.

I think we can include / adapt the simple statistics code with the following notice (in our futur ckmeans code):

/* 
 * This segment of code has been adapted from "simple-statistics" under the ISC license.
 * Original Author: Tom MacWright
 * Source: https://github.com/simple-statistics/simple-statistics/
 * 
 * Copyright (c) 2014, Tom MacWright
 * 
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
 * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 * PERFORMANCE OF THIS SOFTWARE.
 */

If we do so, I also think it might be a good idea to indicate in the README that the "ckmeans" method comes from Tom MacWright / simple statistics.

Or maybe with something like this in the LICENSE file :

The statsbreaks project is licensed under the MIT License, except for portions of the code that are adapted from simple-statistics which are licensed under the ISC License. The full text of the MIT License follows below, with the ISC License text for the adapted portions available within the source files where they are used.

-------------------------------------------------------------------------------

MIT License

[Texte complet de la licence MIT]

-------------------------------------------------------------------------------

For portions of the code adapted from simple-statistics under the ISC License, the following applies:

Copyright (c) 2014, Tom MacWright

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

What do you think ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants