Aster Scoring SDK: Introduction & Explanation

Learn Aster
Teradata Employee

What is it:

Aster Scoring SDK is intended for systems that follow events in real-time and must take action based on these events in real-time with the support of analytics. Aster Scoring SDK applies predictive analytics to make timely decisions based on real events. Aster Scoring SDK also makes Aster Analytics functions available for real-time prediction. Some use cases for Aster Scoring SDK include fraud prevention, churn reduction, system failure predictions, site personalization, purchase recommendations and dynamic promotion pricing.

The workflow of Aster Scoring SDK is a four-step process and is explained below:

Model training/data loading:


• The training phase trains a model in the same way on Aster framework. This step also involves loading any additional tables (such as dictionary or rules for text analytics) on the database or installing them as files on database.

AML generation:

• Run the AMLGenerator function on the model (from Step 1) and relevant information for the corresponding Aster Scoring SDK function.

AML file transfer:

• Download the .aml file from Aster framework (if using an ACT terminal, use the command “\download amlfile”) and export (upload) it to the system working in realtime using any standard ssh/scp client tool.

Scorer execution:

• Score input requests (queries), using the Scorer API, based on the trained model in the .aml file.

AMLGenerator

AMLGenerator is used to transform model data from Aster to a format acceptable by the Aster Scoring SDK functionality. The function translates the Aster model into an XML-based AML (Aster Model Language) format.

The Syntax for AMLGnerator:

Select * from AMLGenerator (
ON (SELECT 1) PARTITION BY 1
ModelType ('function_name')
[ ModelTable ('list_of_tables') ]
[ ModelTag ('list_of_tags') ]
[ InstalledFile ('list_of_boolean') ]
RequestColNames ('list_of_col_names')
RequestColTypes ('list_of_col_types')
[ AMLPrefix ('file_name') ]
[ OverwriteOutput ('true'|'false')]
[ Domain ('host:port') ]
[ UserId ('user_id')]
[ Password ('password') ]
[ SSLSettings ('SSLSettings') ]
[ SSLTrustStorePassword ('SSLTrustStorePassword') ]
[ RequestArgName1 ('arg_name') ]
[ RequestArgVal1 ('arg_value') ]
[ RequestArgName2 ('arg_name') ]
[ RequestArgVal2 ('arg_value') ]
...
);

Scorer:

The Scoring function (called Scorer) provides a software framework to score input queries based on a given model and predictor. Scorer is a set of java classes packed into a .jar file that resides in the user's framework (real time java virtual machine environment).

The scorer computation model follows three simple steps:

- Instantiate a scorer object that will be used for scoring.
- Configure the scorer with AML model file.
- Score the incoming requests based on the configured model.

Scorer package contains the following three files:


scoring.jar - main jar library for Aster Scoring SDK.
scoring-doc.zip - javadoc API for scoring.jar classes. The file should be unzipped and index.html opened in a browser or integrated in development framework in order to view the documentation API.
- scoring-examples.zip - examples for using the scoring.jar library.

Scorer Installation

The scoring.jar file is the only library needed for Aster Scoring SDK. This jar file should be copied over to the user environment setup.

 
The Scorer can be invoked and run like any other jar library in Java. The following are some of the ways in which the library can be loaded:

Using classpath


While compiling a package that contains Scoring classes from either the command line, ant, maven, or other builders, add the scoring.jar library to the classpath. An example for command line compilation of an application, MyApp.java (that uses Scoring classes), is shown below:


javac -cp .:<path/to/scoring.jar> MyApp.java

To run the application containing Scoring classes from the command line, add the scoring.jar library to the classpath:

java -cp .:<path/to/scoring.jar> MyApp

The procedure to install and run on a cloud environment are similar in concept. Please follow the instructions in the documentation for your cloud environment about running a third party jar library.

Eclipse


In eclipse, add scoring.jar to the Java Build Path of the project just like any other external jar file.

How does it perform:

Scorer is expected to perform on the order of milliseconds response time per input query.  However, this restriction is strongly dependent on the available CPU and memory resources, trained model, model size, and the request to be scored.

What Functions Are Supported:

These sections discuss scoring-specific information for each Aster Scoring SDK function currently supported:


• Aster Scoring SDK Single Decision Tree
• Aster Scoring SDK Generalized Linear Model
• Aster Scoring SDK Random Forest
• Aster Scoring SDK Naïve Bayes
• Aster Scoring SDK Naïve Bayes Text Classifier
• Aster Scoring SDK Text Tagging
• Aster Scoring SDK Extract Sentiment
• Aster Scoring SDK Text Parser
• Aster Scoring SDK Text Tokenizer
• Aster Scoring SDK SparseSVM
• Aster Scoring SDK CoxPH
• Aster Scoring SDK LDAInference

Stay tuned more to come!