Skip to Content
Technical Articles
Author's profile photo Alok kumar

Deploy Machine Leaning Model in CF and call API from SAP

Object : Deploy ML Model in CF (Cloud Foundry ) and Access end point  Flask API by SAP

Here I assume that you have a basic understanding of Machine Learning and you have your trial account available on SAP Cloud Platform .

This ML model used to Predict Salary of Employee based on Experience and Interview Score .

Language : Python , Flask , ABAP

Git Link : https://github.com/akpradhan1202/Deployment_Project

SAP BTP Folder Structure :

Before Push the Changes below two mandatory files in the Folder .

Flask==1.1.1
gunicorn==19.9.0
itsdangerous==1.1.0
Jinja2==2.10.1
MarkupSafe==1.1.1
Werkzeug==0.15.5
numpy>=1.9.2
scipy>=0.15.1
scikit-learn>=0.18
matplotlib>=1.4.3
pandas>=0.19
applications:
name: predictsal
memory: 256M
command: python app.py
buildpack: https://github.com/cloudfoundry/buildpack-python.git

After copy file to BTP Folder . We just one command CF PUSH . 

After deployment .

We can Test the API by Postman Tool

ABAP Code to call API :

Access API by ABAP Code :

 

I hope you will find this information useful and will try to deploy your own machine learning model on SAP Cloud Platform. Please give your feedback and suggestion in the comment section. Comment some realtime scenario to implement ML Model in SAP World and that will be my next blog .

Happy Learning!!

Assigned Tags

      1 Comment
      You must be Logged on to comment or reply to a post.
      Author's profile photo Bart van de Kamp
      Bart van de Kamp

      Hi,

      First of all thanks for sharing. I'm trying to push this application to my trial account, but getting next error:

      Any ideas? Thanks in advance.

      Regards, Bart