Monday, August 27, 2012

Predictive model scoring in Oracle

As described in an earlier post, "Build Predictive Models Using PL/SQL", we can build models within Oracle using function 
DBMS_DATA_MINING.CREATE_MODEL. The models are called mining objects.

The ultimate purpose of building a predictive mode is to apply it to new data. This can be done using SQL function prediction_probability(). 
We call this function in our SQL scripts. It will return the probability of being fraud, delinquency, clicking an online ads, or whatever the model is predicting.

select ACCOUNT_NUM, Transaction_ID, prediction_probability(fraud_model,  1 using *) score from tbl_transaction_data;

This is probably the most efficient way to deploy a model into production. (Model deployment is traditionally a major headache.) Again, data never leave the database and no standalone analytics server is needed.

1 comment:

Unknown said...
This comment has been removed by a blog administrator.