Update encoder from an inline DataFrame
Update an Encoder's key statistics directly from an inline `DataFrame` in the request body — synchronous, no data source and no async job involved. The DataFrame must contain a column matching the encoder's target attribute name (set at [Create encoder](/docs/api-reference/encoders/encoders-create-post) time); every other column is treated as a categorical/binary input to encode against that target. This is the small-data counterpart to [Update encoder from a data source (async job)](/docs/api-reference/encoders/encoders-encodername-learnds-post), which instead schedules an async job to learn from a data source.
Update an Encoder's key statistics directly from an inline DataFrame in the request body — synchronous, no data source and no async job involved. The DataFrame must contain a column matching the encoder's target attribute name (set at Create encoder time); every other column is treated as a categorical/binary input to encode against that target. This is the small-data counterpart to Update encoder from a data source (async job), which instead schedules an async job to learn from a data source.
Authorization
SymetryMLAuth HMAC-SHA256 signature-based authentication: requests are signed with
your secret key and sent with the Customer-ID, Sym-date,
Authorization, Content-MD5 and sym-version headers.
See SymetryML REST API Security
for the signature algorithm and a complete example.
In: header
Path Parameters
User/Customer identifier
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
curl -X POST "https://example.com/c1/encoders/superenc0/learn" \ -H "Content-Type: application/json" \ -d '{ "attributeNames": [ "clicked", "price", "age", "type" ], "attributeTypes": [ "B", "C", "C", "S" ], "data": [ [ "1", "10", "10", "c1" ], [ "0", "10", "12", "c2" ], [ "1", "15", "34", "c3" ] ], "errorHandling": 1 }'{ "statusCode": 200, "statusString": "OK", "values": {}}{ "statusCode": 400, "statusString": "Cannot Find Encoder[nosuchenc] for Customer[c1].", "values": {}}Overwrite encoder key values POST
Overwrite (not accumulate — contrast with [Bulk-create encoder key values](/docs/api-reference/encoders/encoders-encodername-createkeyvalues-post)) the raw value/count/sum rows an Encoder holds for one categorical key (the key itself is the `key` path parameter below, not a DataFrame column). Each row: - **`Value`**: one of the key's observed values. - **`Count`**/**`Sum`**: replace whatever the encoder already holds for that value — this endpoint *overwrites*, it does not accumulate (see [Bulk-create encoder key values](/docs/api-reference/encoders/encoders-encodername-createkeyvalues-post) for an additive bulk insert).
Update encoder from a data source (async job) POST
Schedule an async job that updates an Encoder's key statistics from a data source, rather than an inline DataFrame (see [Update encoder from an inline DataFrame](/docs/api-reference/encoders/encoders-encodername-learn-post) for the synchronous inline-DataFrame equivalent). The request body is the same encrypted `DSInfo` payload used by the Data Sources CREATE endpoint: - A **non-Spark DS** carries its attribute types via the DSInfo `extra` field. - A **Spark-backed DS** instead carries a serialized attribute-type `DataFrame` under the `sparkdf` key inside `info` (alongside the other Spark connection keys, e.g. `sparkmaster`/`spark_version`). Whether the encoder's target column gets checked before or after scheduling depends on the same distinction: - **Non-Spark DS**: the job is always scheduled (`202`) regardless of whether the target column is actually present. If it's missing, the job itself fails and the error only surfaces via `GET /{user}/jobs/{jobId}` as a `500`, not from this endpoint's own response. - **Spark-backed DS**: the attribute DataFrame is validated against the encoder's target, and against a maximum column-count limit, *before* scheduling — both checks fail immediately with a `400` from this endpoint, never a job-level `500`. Returns `202` with the new job id in the `sym-job-id` response header once scheduled; poll `GET /{user}/jobs/{jobId}` for completion.