File size: 445 Bytes
932b3cb
 
3cab2dd
932b3cb
b378fde
932b3cb
 
 
 
 
f31d9cf
932b3cb
3cab2dd
f31d9cf
c2687ce
f31d9cf
ecb0c79
c2687ce
04b61ad
b378fde
527f863
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import numpy as np

from cluster.clusterer import Clusterer
from cluster.opts import clustering_methods
from cluster.plot import plot


def main(
    X: np.array,
    y: np.array,
    clusterer: str,
    args: dict,
) -> dict:
    cluster_alg: Clusterer = clustering_methods[clusterer]

    args.update({"cluster_func": cluster_alg})
    alg = cluster_alg.from_dict(args)

    alg.build(X)
    plot(clusterer=alg, X=X)
    return alg.to_dict(X)