Check the HANA Table data and analyze it using SQL.
![sap hana studio impot shine sap hana studio impot shine](https://blogs.sap.com/wp-content/uploads/2017/05/SHINE_SALES_DASHBOARD_2.gif)
SAP HANA STUDIO IMPOT SHINE UPDATE
Analyze the Machine learning algorithm metrics and fine tune for the better accuracy by repeating the step 5.Store the Machine learning algorithm metrics in log table and also update the predicted value of historical data into the HANA Table.
![sap hana studio impot shine sap hana studio impot shine](https://developers.sap.com/tutorials/xsa-ml-e2e-access-shine/_jcr_content.github-proxy.1618232401.file/controller.png)
Do the feature engineering, data cleaning and then feed the final set of independent variables to Machine learning algorithm (Random Forest) to predict dependent variable (Profit).Extract all the historical data into data frame object and start analyzing it in Python using pandas.Create connection to HANA data base and execute required SQL.Import pyodbc, pandas, Sklearn, Matplotlib, seaborn libraries in python.(Make sure you have required privileges to do DML Operations on the tables in SAP HANA DB.) Check the HANA Table data and analyze it using SQL in HANA Studio/WEB IDE.The basic steps involved in this process are: The below diagram shows ML Prediction life cycle and steps fallowed in the use case. The linear regression is the most commonly used model in research and business and is the simplest to understand, so using the random forest regression method we will predict the Profit. I would like to show the end to end process of Data extraction from SAP HANA DB, analyzing, cleaning, feature selection, and applying machine learning model and finally write back the results and ML algorithm performance metrics to the HANA tables.
![sap hana studio impot shine sap hana studio impot shine](https://user-images.githubusercontent.com/43603915/47776378-92546180-dcf2-11e8-88ae-3f615c8fd7a9.png)
I am not explaining details about the ML Algorithm and the parameter tuning here. Goal is to predict the Profit for the given set of expenditure values. Scenario: I am taking the state wise startup company’s expenditure (R&D Spend, Administration Spend, and Marketing Spend) and profit data Source of the data in SAP HANA DB. Then you can clean and select independent variables/features data to feed the Machine learning algorithms to predict dependent variables or find insights. This blog post helps to connect with SAP HANA DB (Version 1.0 SPS12) then extract the data from HANA table/View and analyze the data using Python Pandas library.