The following example is of a simple query that uses IM Scoring:
SELECT A.Name Q.PredictClass('DemoBanking', REC2XML(2,'COLATTVAL','', A.Type, A.Age, A.Siblings, A.Income) ) As RiskClass FROM BankCustomers A
This query refers to the arbitrary table BankCustomers, which contains information about the customers of a bank. For each customer, the scoring function computes a value that might be a classification of credit risk. This prediction is implemented by the scoring function Q.PredictClass. The first argument, 'DemoBanking', is the name of a mining module. The second argument is the input data, constructed by REC2XML.
The query results contain simple values such as:
Name | Risk class |
---|---|
Joe Padeni | high |
Susan Sztuba | high |
Callie Atchue | low |
The Q.PredictClass function returns a VARCHAR. In the example, it produces a "high" or "low" value. A mining model contains the patterns and formulas needed to predict clusters, classes, or numeric values. These patterns are read by the UDF in order to compute predictions.