
Organizations are using AI( Machine Learning ) models more often to extract insightfull information from their data in today's data driven world. When combined with SAP HANA cloud DB, SAP Business Technology Platform( SAP BTP ) provides capability for deploying ML Models.
In this Post, we will look at how to integrate a python ML model using Flask application using Data from SAP HANA cloud DB and deploy it on SAP BTP.
Prequiste:
HANA Cloud DB
Create a HANA Cloud DB instance and create a table to store all the historical data. Copy the SQL endpoint, which can be used to call the FB instance from the python application
Python Application Structure:-
Flask Application file
Create a python file to call the data from HANA DB , pass the data to the ML Model in the Pickle file and expose it as a FLASK API.
Pass the SQL endpoint to address and port, ID and password of the Hana DB instance
Requirements.txt
This file contains all the libraries required to run the application
Runtime.txt
This contains the runtime environment details
Manifest.yaml
This file is read by BTP deployer, used to deploy the application. Add all the backing services, along with the buildpack details for deployment. I have added Hanacloud service details to bind the HANA DB instance with the application
Please Note: For training the Model I have used a CSV file with data and generated a trained model ,saved it to a pickle file. Training can also be done using live data from HANA DB
Deployment of the application
In the terminal in SAP BAS, login to CF using CLI available
Use command CF Push to push the application to SAP BTP
Conclusion
From this blog, we have learned how to quickly develop and manage ML Models over SAP BTP. Hope, this will help train & develop ML Model to quickly get insights from data.
Thank You! and let me know if you need more details.
References
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
8 | |
7 | |
7 | |
6 | |
4 | |
4 | |
4 | |
4 | |
4 | |
4 |