Db2 built-in functions for SQL DI

Db2 introduces the following built-in scalar functions to support SQL DI. You can use these functions to run AI queries on your Db2 user tables and views.

AI_ANALOGY
The AI_ANALOGY function computes an analogy score between two sets of values. You can use analogy queries to determine whether a relationship between a pair of entities applies to a second pair of entities, which has applications in retail, such as to determine whether a customer has a preference for a product and whether other customers have the same degree of preference for other products. See AI_ANALOGY for details.
AI_COMMONALITY
The AI_COMMONALITY function computes a similarity score by using the value of the expression argument and the centroid value of the model column. You can use commonality queries to detect the common patterns or the outliers in your data. See AI_COMMONALITY for details.
AI_SEMANTIC_CLUSTER
The AI_SEMANTIC_CLUSTER function computes a semantic clustering score of a member argument against a set of clustering arguments. You can use clustering queries to form a cluster of entities to test whether an extra entity belongs in the cluster. You can use semantic clustering in many contexts where similarity or dissimilarity queries are used as a broader test of similarity or dissimilarity to multiple entities. See AI_SEMANTIC_CLUSTER for details.
AI_SIMILARITY
The AI_SIMILARITY function computes a similarity score between two values. You can use similarity queries to find groups of similar entities to decide on market segmentation or find a group of customers that behaves similarly to other groups, which have applications in the retail, finance, and insurance industries. On the other hand, you can use dissimilarity queries to find outliers from the norm, which has applications in financial anomaly detection and fraud detection. See AI_SIMILARITY for details.