Table Of Contents

Commands model:k_means/train

[BETA] Creates k-means model from trained frame.

POST /v1/commands/

GET /v1/commands/:id

Request

Route

POST /v1/commands/

Body

name:

model:k_means/train

arguments:

model : <bound method AtkEntityType.__name__ of <trustedanalytics.rest.jsonschema.AtkEntityType object at 0x7f9e68702090>>

<Missing Description>

frame : <bound method AtkEntityType.__name__ of <trustedanalytics.rest.jsonschema.AtkEntityType object at 0x7f9e686f3fd0>>

A frame to train the model on.

observation_columns : list

Columns containing the observations.

column_scalings : list

Column scalings for each of the observation columns. The scaling value is multiplied by the corresponding value in the observation column.

k : int32 (default=None)

Desired number of clusters. Default is 2.

max_iterations : int32 (default=None)

Number of iterations for which the algorithm should run. Default is 20.

epsilon : float64 (default=None)

Distance threshold within which we consider k-means to have converged. Default is 1e-4.

initialization_mode : unicode (default=None)

The initialization technique for the algorithm. It could be either “random” or “k-means||”. Default is “k-means||”.


Headers

Authorization: test_api_key_1
Content-type: application/json

Description

Upon training the ‘k’ cluster centers are computed.


Response

Status

200 OK

Body

Returns information about the command. See the Response Body for Get Command here below. It is the same.

GET /v1/commands/:id

Request

Route

GET /v1/commands/18

Body

(None)

Headers

Authorization: test_api_key_1
Content-type: application/json

Response

Status

200 OK

Body

dict

The data returned is composed of multiple components:

dict : cluster_size
Cluster size.
int : ClusterId
Number of elements in the cluster ‘ClusterId’.
double : within_set_sum_of_squared_error
Sum of squared error for the model.