Altair SmartWorks Analytics

 

Basic Serving of Python Models

This topic describes how Python models are handled inside the Docker containers deployed on Seldon Core.

Preprocessing

All data are converted into a Pandas DataFrame before being processed by the model. For Python models specifically, the user must pass in the list of names.

Additionally, all numbers are converted into numeric datatypes for Python models to be able to process them.

Both conditions are shown in the single line of code below.

 

X = pd.DataFrame(X, columns=names).apply(pd.to_numeric, errors='ignore')

 

 

Predictions

With Python models, the Pandas DataFrame will be passed directly to the predict() function of the model, where the DataFrame is processed as the model_input variable. The user can do whatever kind of processing they like on that DataFrame from within their class.