-
-
Save whizzmler/bb82e5edeb08e7eb9d228a21b6e6c421 to your computer and use it in GitHub Desktop.
One click batchcentroid dataset
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "Batch-centroid", | |
"description": "Create a dataset with a new column showing the cluster each instance belongs to", | |
"inputs": [ | |
{ | |
"name": "source-id", | |
"type": "source-id", | |
"description": "Identifier of the input source" | |
} | |
], | |
"outputs": [ | |
{ | |
"name": "dataset-id", | |
"type": "dataset-id", | |
"description": "Identifier for new dataset with cluster labels" | |
} | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define (one-click-batch-centroid src-id) | |
(let (ds-id (create-and-wait-dataset {"source" src-id}) | |
cl-id (create-and-wait-cluster {"dataset" ds-id | |
"default_numeric_value" "median"}) | |
bc-id (create-and-wait-batchcentroid {"cluster" c-id | |
"dataset" ds-id | |
"output_dataset" true | |
"all_fields" true})) | |
(get (fetch bc-id) "output_dataset_resource"))) | |
(define dataset-id (one-click-batch-centroid source-id)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@jaor
There's a typo in here.
.whizzml line#5. Should be "cl-id", not "c-id"