Long Answer: It is possible and I am actually surprised developers haven’t given it the attention it deserves. As far as
scikit-learn is concerned, the JS people have made their own set of libraries to counter it, and I am gonna use one too. But first, a little bit about Machine Learning. Feel free to board this rocket 🚀 and jump to the code, though.
The solution Facebook came up with is conceptually very simple: instead of having multiple “dumb” endpoints, have a single “smart” endpoint that can take in complex queries, and then massage the data output into whatever shape the client requires.