During our first blog post, we created a Machine learning model on our Autonomous Database, letting it learn from existing customers data. In this second part, I am going to set up the APEX application and integrate the Classification Machine Learning model inside this application.
I would like to remind you that our goal via this APEX Application and the relevant Machine learning model is to predict the up-selling potential of certain items in our catalog to the end customers. We want to effectively provide to our company’s employees the insight that a certain end customer is a good candidate for a particular product that we are trying to sell.
In our APEX application, we will be adding a new column on their screen that shows whether it is a good idea to try to upsell to this customer.
First of all, lets set up of our APEX application. For this example, we can just download an existing APEX application from Gihhub.com. Use the following link https://github.com/oracle/cloudtestdrive/blob/master/DataScience/lab400/install/f100.sql
In our Autonomous Database Environment, created during the first part of our guide, we need to access our APEX under Tools or via the "Service Console" under Development.
Once in your APEX Workspace, select "App Builder" and then import the existing application you downloaded from the github link shared above. Once the application is imported you can run it.
Take a close look on our current dataset, as in this next step, we are going to Integrate our Machine Learning results into the APEX application. Remember, we want to show a recommendation to our employees when the customer they are speaking with is a likely/potential candidate to buy Y Box Games.
For the APEX application (schema WORKSHOPATP) to be able to access the prediction results, we have to give it access to the machine learning schema (MLUSER1).
grant select on cust_prediction to workshopatp;
Once again from our APEX Workspace Environment (under Tools or Service Console of our Oracle Autonomous Database, look into the Workspace we imported our APEX application before.
This time let's open the "Customer Service App" application for editing, so as we edit the Customer Page our employees are accessing.
In the page Content Body, we have a Customers Interactive Report.
You see that the data for our Interactive Report Element comes from the CUSTOMER_V view.
We are going to edit the definition of the existing view to add a column that contains our recommendation.
To access the view in APEX, open the SQL Workshop, then Object Browser, and then filter to our views.
Have a look at the view definition. It selects all its values from the SH.CUSTOMERS table.
We will extend the view by adding a "RECOMMENDATION" column to it.
Note how this SQL will add a column "Recommendation", and it will be a text that explains whether the employee should try to upsell Y Box Games to this customer. In addition, the recommendation will be added when the probability of an upsell is high enough.
Open the SQL Workshop and execute the SQL script to overwrite the view with the new definition.
Paste in the SQL that you have just downloaded and Execute it.
Go back to the APEX application and edit the Customers page again. Choose the Customer Interactive Report section in the Content body and Add the "RECOMMENDATION" column in the select statement at the right.
Do not forget the comma just after the previous column. Then Save the page.
Save and Run the APEX application.
On the main screen, you see that for most customers it is not recommended to try to upsell Y Box Games. It is unlikely that these customers will be interested.
However, if you look for a customer with the first name "Connor" and last name "Clark" you will see that in this case, we see under the recommendation column that we should try to upsell Y Box Games, because the customer is very likely to be interested in this offer.
While one single column addition in the application might not look like much, the value this column brings for our business can be significant. In this case, an employee receives very valuable suggestion on which customer to try to upsell a product to and this can actually allow him to be more effective.
While with this simple integration of Machine Learning functionality you see how it can increase the value and effectiveness of your business applications dramatically, we are certain this is only the beginning for several ideas and application enhancements from your side.
We sure hope this helps you and your customers to evolve your solution offerings, generate more engaging application and improve your revenue with Oracle Autonomous Database powered by Machine Learning libraries and APEX low code development. We would love to hear how you use Machine learning with APEX and how this adds value to your current APEX application.