Showing results for 
Search instead for 
Did you mean: 

Python api get predictions with some features

Python api get predictions with some features

In the web interface, I can get the prediction output with features that I can use to link back to my dataset by adding the feature name in the "optional features" field here.


How do I do the same thing in the python API? I'm using this code here to get the prediction to a dataframe, but I would also like to have the dataframe include some of the features provided for prediction (i.e. ID) .


prediction_df = pred_job.get_result_when_complete().get_all_as_dataframe() 


0 Kudos
1 Reply

Hi azamrik -

Note this is an asynchronous scoring job that takes place as a batch scoring task on of of the worker nodes.  For production usage, we advise registering a model as a deployment, where it can be used for batch or real time scoring.  The deployment also offers passing through columns as well as statistical reporting on model use and health.

At this time, the function creating the prediction job via the API does not accept any additional columns for passing data through.  The data will however be returned in the same order in which it was provided - so the scored results can be joined back to the original dataframe based on row number.

0 Kudos