Skip to content

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

@kathawala

Description

@kathawala

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[][]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions