-
-
Save rasensio1/43d48034a56bf9da3a851d933ce02e82 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" cl-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