SAP BLOG Deploy Machine Leaning Model in CF and call API from SAP

SAP Blog

Kayıtlı Üye
Katılım
22 Ara 2017
Mesajlar
1,368
Tepki puanı
7
Puanları
6
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 : akpradhan1202/Deployment_Project

SAP BTP Folder Structure :

Screenshot-2021-05-18-at-10.11.10-PM.png


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

requirements.txt

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

manifest.yml

applications:
– name: predictsal
memory: 256M
command: python app.py
buildpack: cloudfoundry/python-buildpack


app.py
and model.pkl files are available in Git folder .​


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

After deployment .

We can Test the API by Postman Tool

Screenshot-2021-05-18-at-10.18.33-PM.png


ABAP Code to call API :

Screenshot-2021-05-18-at-10.22.12-PM.png


Access API by ABAP Code :
Screenshot-2021-05-18-at-10.19.45-PM.png




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!!

Okumaya devam et...
 
Üst