File size: 429 Bytes
932b3cb
 
 
3cab2dd
932b3cb
 
 
 
 
 
 
 
3cab2dd
 
c2687ce
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from sklearn.model_selection import train_test_split
import numpy as np

from cluster.clusterer import Clusterer
# for determing which clustering funciton to call
from cluster.opts import clustering_methods


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

    alg = cluster_alg.from_dict(args)
    alg.build(X)

    return alg.to_dict()