To get started with polyglot ML applications, we will revisit the logistic regression example from Chapter 3, Supervised Learning. We will assume that, instead of Go, the model was written in Python and that we wish to invoke it from our Go application. To do this, we will use command-line arguments to pass inputs to the model and read the model's prediction from standard output (STDOUT).
To exchange data between Python and Go, we will use strings formatted using JavaScript Object Notation (JSON). This choice is arbitrary of course[6], and we could have chosen any one of the other formats for which the Go and Python standard libraries have support, such as XML, or invented our own. JSON has the advantage that it takes very little effort to use in both languages.
The process we will follow to communicate with the Python...