Inference
Explore how to use a packaged machine learning library to perform inference by converting input data into a pandas DataFrame, preprocessing it with saved artifacts, and generating predictions for iris species. Learn how to install your package, load trained models, and apply consistent preprocessing methods to ensure accurate and user-friendly classification results.
We'll cover the following...
Now that we have a package, we’ll write a simple code to use the library to make predictions of iris species, given some data. The first step is to install the package in the environment where we perform inference. How this is done depends on the environment. One way is to use the pip command as follows, assuming we’re in the pipeline’s top-level directory:
For the purpose of this lesson, we’ll assume that the library has been installed, and we’ll proceed to inference. During inference data is rarely, if ever, provided in the form of files. Typically, it’s streamed into the application that contains the prediction code. For tabular data, the input can be in the form of a dictionary. Here’s an example of the ...