concept api in category data

appears as: API, n API, API, APIs, APIs
Build a Career in Data Science

This is an excerpt from Manning's book Build a Career in Data Science.

On a more recent project, I was tasked with creating a machine learning API. I was in the middle of an engineering team that worked with microservices, so I decided to create a REST API in R as a Docker container. Although I hadn’t used Docker containers before, I chose it because I knew that it would be easiest for the team to maintain. From that project, I learned a lot about Docker and containers, and the work I created was able to integrate well.

  • Understanding what APIs are and how they’re helpful
  • 11.2.4. Building an API

    APIs are great for machine learning models, but some additional coding is needed for them. Both R and Python have packages—Plumber and Flask, respectively—that do this coding for you. When you run an R or Python script with these packages, that script takes your function and exposes it to an endpoint on your computer. You could specify that going to the URL http://yourwebsite.com/predict will run your machine learning R or Python function and then return whatever the function result is. Then you could go into a web browser to call your code! Assuming that you’re running this code on a laptop or desktop computer, if you set your computer to allow outside traffic by adjusting the firewall, other people could hit your API. But the moment you stop running the API hosting program (R or Python), no one will be able to run your model.