Using the Python bindings and its local cluster object to find the centroids for a CSV file.
Usage:
cat input.csv | python local_batch_centroid.py > centroids.csv
Notes:
Input.csv is expected to start with a headers row and then the values to be used in the bath centroid. Cluster id is hardcoded in the local_batch_centroid.py file. BigML credentials are expected to be available through the environment variables, but can also be provided in the code as shown in the commented paragraph. Requirements
The bigml module is needed. To install it you can use pip:
pip install bigml
The code has been tested in python 2.7