Skip to content

Fix JSON input shapes#1679

Merged
sakoush merged 1 commit into
SeldonIO:masterfrom
ReveStobinson:pandascodec-docs
Apr 17, 2024
Merged

Fix JSON input shapes#1679
sakoush merged 1 commit into
SeldonIO:masterfrom
ReveStobinson:pandascodec-docs

Conversation

@ReveStobinson

Copy link
Copy Markdown
Contributor

Closes #1678

Fixes JSON Payload input shapes in Pandas DataFrame content type section of User Guide.

For example DataFrame:

A B C
a1 b1 c1
a2 b2 c2
a3 b3 c3
a4 b4 c4

All inputs in JSON payload had "shape": [3] (the number of columns in the DataFrame) instead of "shape": [4] (the number of rows in the DataFrame).

This PR assumes that #1625 is in fact a bug, and that the shape values should not have an extra dimension added to them. If that assumption is incorrect, I would recommend also adding a disclaimer to this section like the one seen in the Numpy Array section before it:

Note

By default, MLServer will always assume that an array with a single-dimensional shape, e.g. [N], is equivalent to [N, 1]. That is, each entry will be treated like a single one-dimensional data point (i.e. instead of a [1, D] array, where the full array is a single D-dimensional data point). To avoid any ambiguity, where possible, the Numpy codec will always explicitly encode [N] arrays as [N, 1].

Fix JSON Payload input shapes in Pandas DataFrame content type section of User Guide.
@sakoush
sakoush merged commit 7b79e21 into SeldonIO:master Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docs specify Pandas DataFrame Codec input shapes incorrectly.

2 participants