Call python machine learning model from UDF or SP I would like to run records from my database (Postgres), after an update, through a machine learning model. This model resides in a model.py file. 

Next to simply porting the python model over to a SP or UDF (I do not know which would be the best to use, if at all).

How might I call this python model and pass the record parameters to the model and return a desired result?
You have basically three options:


Have a program written in Python, that uses PsycoPG, PyGreSQL or some other driver with equivalent functionality to get the data out of PostgreSQL and process it in Python.  Or you could use some toolkit like SQLAlchemy, which works as an Object Relational Mapper.
Write a User Defined Function using PL/Python, which means you actually write UDFs within PostgreSQL using the Python language. If your model works with a certain function model_predict(a, b, c), you can call it in a fashion similar to:

SELECT a, b, c, model_predict(a, b, c) AS prediction
   FROM table
  WHERE &lt;condition&gt;
Export the data from PostgreSQL (with COPY FROM ..., or using any tool such as pgAdmin), into a suitable format (such as CSV), and then import it and process in Python (you could use Pandas read csv, e.g.).