SAP x AI/ML Series: ISLM Embedded Scenario with APL

Estimated read time 10 min read

Hello Members and Enthusiasts,

Back into writing another technical blog and would touch upon the amalgamation of SAP with the AI/ML world with specific focus on Intelligent Scenario Lifecycle Management (ISLM).

In today’s fast-paced business environment, the integration of artificial intelligence (AI) into business processes is currently a major driving force for digital transformation.

Intelligent Scenario Lifecycle Management (ISLM) is a framework that allows you to perform lifecycle management operations on machine learning scenarios.

An intelligent scenario is an ABAP representation of machine learning business specific use case and acts as Single-entry point within SAP S/4HANA to efficiently integrate and operate ML scenarios.

You can train an intelligent scenario and use the trained model to get an accurate inference result.

Further knowledge around Intelligent Scenario Lifecycle Management can be found here: ISLM Community topic page.

 

Depending on the machine learning scenario that is associated with a business application, ISLM scenarios comes in two flavors: Embedded & Side-by-side

In Embedded approach, a business application, for example SAP S/4HANA runs in the same stack as its machine learning provider SAP HANA machine learning with the analytics libraries SAP HANA Automated Predictive Library (APL) or SAP HANA Predictive Analysis Library (PAL). APL exposes the data mining capabilities of an Automated Analytics engine for developing predictive modelling processes for business analysts. PAL offers advanced analytics algorithms for data scientists. This can be used to solve use cases of forecasting, trending, and so on.

In Side-by-Side approach, a business application, for example, SAP S/4HANA runs in a separate stack than its machine learning provider, for example, SAP Data Intelligence. Remote machine learning can be used for high-end use cases, such as image recognition, sentimental analysis, deep learning for natural language processing that is based on neural networks.

ISLM framework consists of two SAP Fiori applications, Intelligent Scenarios, and Intelligent Scenario Management which allow you to create and manage the lifecycle of intelligent scenarios.

 

ISLM Scenario based on HANA Automated Predictive Library:

For today’s topic I would be considering the famous SBOOK table where I would predict(classify) the Cancelled bookings. We would be doing this by using SAP HANA’s Machine Learning (ML) via the APL Library with ISLM Embedded Scenario.

Note: This is a demo use-case and does not represent Live Business Use-Case

 

Hop in to the Intelligent Scenarios App and Create an Embedded Scenario

 

Enter a Scenario Name, Description, Intelligent Scenario Type, Machine Learning Library, Package and Algorithm. Select Classification or Regression based on requirement. Here we shall be classifying the Cancelled flag into two categories and hence Binary Classification predictive model. Gradient Boosting is used as it provides a more accurate modeling result. Once done click on Add Model.

 

Enter the model name starting with Z and description. Enter the Training Dataset i,e the Dataset to be used for training the model and Apply Dataset i,e the Dataset to be used for prediction. The keys would be automatically populated. Enter the Target i,e the field whose value you want to predict. Max.Reason Codes can also be entered as these are the variables whose values have most influence in the decision.

 

 

 

// Code for the Training and Apply Dataset. You can alter the where clause to // include historical data for Training Dataset.

@AbapCatalog.sqlViewName: ‘ZSQL_APL_SBOOK’
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: ‘Test CDS’
@Metadata.ignorePropagatedAnnotations: true
define view ZSD_APL_SBOOK
as select from sbook
{
key carrid as Carrid,
key connid as Connid,
key fldate as Fldate,
key bookid as Bookid,
customid as Customid,
custtype as Custtype,
smoker as Smoker,
luggweight as Luggweight,
wunit as Wunit,
invoice as Invoice,
class as Class,
order_date as OrderDate,
counter as Counter,
agencynum as Agencynum,
case cancelled when ‘X’ then ‘1’ else ‘0’ end as Cancelled,
reserved as Reserved
}
where
fldate >= ‘20241001’

 

 

 

 

Once done, you can verify the Input and the Output tabs as the Scenario is still in Draft mode. Thereby the scenario can be Published. After publishing, interesting thing to notice would be Apply Setting Tab which gives us the ABAP Class and CDS views generated to allow easy access to the predictions. Copy the ABAP Apply View name.

 

Now since our scenario is published, lets hope on to the Intelligent Scenario Management app to train, monitor and activate the model for productive usage. Search the Scenario name and navigate to the details page.

 

Select the Model and click on the Train button to trigger the training. View the Dataset Record Count and click on Train button.

 

A new Model Version will be created which will be in Scheduled status. We have to monitor till it changes to Training and finally to Ready.

 

Once Ready, we can navigate to its details to view the Report. The Quality Information and Debrief tabs will give information about data quality and what key influencers are affecting the predictions.

 

 

Coming back to the Model Versions screen, activate it by selecting the Model Version and click the Activate button.

 

Congrats. You just trained your first model. Now we are good to view the predictions.

 

To view the predictions from the trained model, we will view the Data of the CDS view copied in previous steps.

 

We can see the model’s keys in the first four columns. Column Cancelled has the actual value of the cancelled flag whereas Column Gb_Decision_Cancelled has the predicted value of the cancelled flag. Column Rcn_Top_1_Cancelled holds the field which has the most influence in a score-based decision.

That brings us to the end of this article where we used both the FIORI apps to create intelligent scenarios, review, and publish Intelligent Scenarios and to train, monitor and activate it simultaneously.

Thanks and See you all until the next one ?

 

 

​ Hello Members and Enthusiasts,Back into writing another technical blog and would touch upon the amalgamation of SAP with the AI/ML world with specific focus on Intelligent Scenario Lifecycle Management (ISLM).In today’s fast-paced business environment, the integration of artificial intelligence (AI) into business processes is currently a major driving force for digital transformation.Intelligent Scenario Lifecycle Management (ISLM) is a framework that allows you to perform lifecycle management operations on machine learning scenarios.An intelligent scenario is an ABAP representation of machine learning business specific use case and acts as Single-entry point within SAP S/4HANA to efficiently integrate and operate ML scenarios.You can train an intelligent scenario and use the trained model to get an accurate inference result.Further knowledge around Intelligent Scenario Lifecycle Management can be found here: ISLM Community topic page. Depending on the machine learning scenario that is associated with a business application, ISLM scenarios comes in two flavors: Embedded & Side-by-sideIn Embedded approach, a business application, for example SAP S/4HANA runs in the same stack as its machine learning provider SAP HANA machine learning with the analytics libraries SAP HANA Automated Predictive Library (APL) or SAP HANA Predictive Analysis Library (PAL). APL exposes the data mining capabilities of an Automated Analytics engine for developing predictive modelling processes for business analysts. PAL offers advanced analytics algorithms for data scientists. This can be used to solve use cases of forecasting, trending, and so on.In Side-by-Side approach, a business application, for example, SAP S/4HANA runs in a separate stack than its machine learning provider, for example, SAP Data Intelligence. Remote machine learning can be used for high-end use cases, such as image recognition, sentimental analysis, deep learning for natural language processing that is based on neural networks.ISLM framework consists of two SAP Fiori applications, Intelligent Scenarios, and Intelligent Scenario Management which allow you to create and manage the lifecycle of intelligent scenarios. ISLM Scenario based on HANA Automated Predictive Library:For today’s topic I would be considering the famous SBOOK table where I would predict(classify) the Cancelled bookings. We would be doing this by using SAP HANA’s Machine Learning (ML) via the APL Library with ISLM Embedded Scenario.Note: This is a demo use-case and does not represent Live Business Use-Case Hop in to the Intelligent Scenarios App and Create an Embedded Scenario Enter a Scenario Name, Description, Intelligent Scenario Type, Machine Learning Library, Package and Algorithm. Select Classification or Regression based on requirement. Here we shall be classifying the Cancelled flag into two categories and hence Binary Classification predictive model. Gradient Boosting is used as it provides a more accurate modeling result. Once done click on Add Model. Enter the model name starting with Z and description. Enter the Training Dataset i,e the Dataset to be used for training the model and Apply Dataset i,e the Dataset to be used for prediction. The keys would be automatically populated. Enter the Target i,e the field whose value you want to predict. Max.Reason Codes can also be entered as these are the variables whose values have most influence in the decision.   // Code for the Training and Apply Dataset. You can alter the where clause to // include historical data for Training Dataset.

@AbapCatalog.sqlViewName: ‘ZSQL_APL_SBOOK’
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: ‘Test CDS’
@Metadata.ignorePropagatedAnnotations: true
define view ZSD_APL_SBOOK
as select from sbook
{
key carrid as Carrid,
key connid as Connid,
key fldate as Fldate,
key bookid as Bookid,
customid as Customid,
custtype as Custtype,
smoker as Smoker,
luggweight as Luggweight,
wunit as Wunit,
invoice as Invoice,
class as Class,
order_date as OrderDate,
counter as Counter,
agencynum as Agencynum,
case cancelled when ‘X’ then ‘1’ else ‘0’ end as Cancelled,
reserved as Reserved
}
where
fldate >= ‘20241001’    Once done, you can verify the Input and the Output tabs as the Scenario is still in Draft mode. Thereby the scenario can be Published. After publishing, interesting thing to notice would be Apply Setting Tab which gives us the ABAP Class and CDS views generated to allow easy access to the predictions. Copy the ABAP Apply View name. Now since our scenario is published, lets hope on to the Intelligent Scenario Management app to train, monitor and activate the model for productive usage. Search the Scenario name and navigate to the details page. Select the Model and click on the Train button to trigger the training. View the Dataset Record Count and click on Train button. A new Model Version will be created which will be in Scheduled status. We have to monitor till it changes to Training and finally to Ready. Once Ready, we can navigate to its details to view the Report. The Quality Information and Debrief tabs will give information about data quality and what key influencers are affecting the predictions.  Coming back to the Model Versions screen, activate it by selecting the Model Version and click the Activate button. Congrats. You just trained your first model. Now we are good to view the predictions. To view the predictions from the trained model, we will view the Data of the CDS view copied in previous steps. We can see the model’s keys in the first four columns. Column Cancelled has the actual value of the cancelled flag whereas Column Gb_Decision_Cancelled has the predicted value of the cancelled flag. Column Rcn_Top_1_Cancelled holds the field which has the most influence in a score-based decision.That brings us to the end of this article where we used both the FIORI apps to create intelligent scenarios, review, and publish Intelligent Scenarios and to train, monitor and activate it simultaneously.Thanks and See you all until the next one ?    Read More Technology Blogs by SAP articles 

#SAP

#SAPTechnologyblog

You May Also Like

More From Author

+ There are no comments

Add yours