This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
Now that it's live, don't forget to accept your certification badge on Credly today! Learn more here.
We are currently experiencing an issue with Email verification at this time and working towards a solution. Should you encounter this issue, please click on the "Send Verification Button" a second time and the request should go through. If the issue still persists for you, please email email@example.com for assistance.
The reason nested JSON is currently flattened in R and not in Python is because all input JSON to an R model is converted, using jsonlite, to a DataFrame. In order to support requests that have multiple observations attached, the JSON must be flattened to accomodate the 2 dimensional nature of a DataFrame. Additionally, when deploying an R model, the model.predict() function must operate on a DataFrame and not on a list.
Python is a bit more flexible in the regard. When input JSON is sent to a Python model, the JSON is converted into a dict or a list, depending on its structure. These data types inherently support nested data and thus the input JSON keys are not flattened. When deploying a python model, the deployed function should operate on a dict or a list depending on the expected input structure.