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

Types in the @types/skmeans package are wrong #20

Open
kathawala opened this issue Dec 10, 2020 · 0 comments
Open

Types in the @types/skmeans package are wrong #20

kathawala opened this issue Dec 10, 2020 · 0 comments

Comments

@kathawala
Copy link

Hi,

First off, love your package, it's helped me out a lot!

Secondly I was using your package to run some kmeans clustering and I noticed that the types published under the @types/skmeans package are not correct.

Specifically, the skmeans function is typed as returning Data and Data is typed as follows

interface Data {
    it: number;
    k: number;
    centroids: number;
    idxs: number[];
    test: (x: number, point?: (x1: number, x2: number) => number) => void;
}

https://github.com/adamzerella/DefinitelyTyped/blob/e84211cf43b463bb00759e3156ea7010516ee9b1/types/skmeans/index.d.ts#L11

But centroids: number is not correct. As far as I see the centroids property returned by skmeans returns an array of centroids, so the correct type should be centroids: number[] | number[][]

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

No branches or pull requests

1 participant