Numpy-Neuron / example /kmeans.py
Jensen-holm's picture
kmeans clustering works and returns centroids and labeled data
04b61ad
raw
history blame
395 Bytes
import requests
import json
ENDPOINT: str = "http://127.0.0.1:5000/"
request_params = {
"algorithm": "kmeans-clustering",
"arguments": {
"k": 3,
"max_iter": 10,
},
}
headers = {
"Content-Type": "application/json",
}
r = requests.post(
ENDPOINT,
headers=headers,
data=json.dumps(request_params),
)
if __name__ == "__main__":
print(r.json())