Fraud and Anomaly Detection Made Simple - Oracle Data Mining (ODM) Blog

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

29/7/2019 Fraud and Anomaly Detection Made Simple | Oracle Data Mining (ODM) Blog

Oracle's Machine Learning & Adv. Analytics Blog


 MENU

Oracle's Machine Learning & Adv. Analytics Blog

An Oracle blog about Oracle’s Machine


Learning and Advanced Analytics

Try Oracle Cloud Platform


For Free

January 18, 2010

Fraud and Anomaly Detection Made


Simple
Charlie Berger
SR. DIR. PRODUCT MANAGEMENT, MACHINE LEARNING, AI AND
COGNITIVE ANALYTICS
Here is a quick and simple application for fraud and anomaly detection.
To replicate this on your own computer, download and install the Oracle
Database 11g Release 1 or 2. (See
http://www.oracle.com/technology/products/bi/odm/odm_education.html
for more information). This small application uses the Automatic Data
Preparation (ADP) feature that we added in Oracle Data Mining 11g.
Click here to download the CLAIMS data table. [Download the .7z file
and save it somwhere, unzip to a .csv file and then use SQL Developer
data import wizard to import the claims.csv file into a table in the Oracle
Database.]

First, we instantiate the ODM settings table to override the defaults. The

https://blogs.oracle.com/datamining/fraud-and-anomaly-detection-made-simple 1/4
29/7/2019 Fraud and Anomaly Detection Made Simple | Oracle Data Mining (ODM) Blog

default value for Classification data mining function is to use our Naive
Bayes algorithm, but since this is a different problem, looking for
anomalous records amongst a larger data population, we want to change
that to SUPPORT_VECTOR_MACHINES. Also, as the 1-Class SVM
does not rely on a Target field, we have to change that parameter to
"null". See
http://download.oracle.com/docs/cd/B28359_01/datamine.111/b28129/anomalies.htm
for detailed Documentation on ODM's anomaly detection.

drop table CLAIMS_SET;

exec dbms_data_mining.drop_model('CLAIMSMODEL');

create table CLAIMS_SET (setting_name varchar2(30), setting_value


varchar2(4000));

insert into CLAIMS_SET values


('ALGO_NAME','ALGO_SUPPORT_VECTOR_MACHINES');

insert into CLAIMS_SET values ('PREP_AUTO','ON');

commit;

Then, we run the dbms_data_mining.create_model function and let the in-


database Oracle Data Mining algorithm run through the data, find patterns
and relationships within the CLAIMS data, and infer a CLAIMS data mining
model from the data.

begin

dbms_data_mining.create_model('CLAIMSMODEL',
'CLASSIFICATION',

'CLAIMS', 'POLICYNUMBER', null,


'CLAIMS_SET');

end;

/
https://blogs.oracle.com/datamining/fraud-and-anomaly-detection-made-simple 2/4
29/7/2019 Fraud and Anomaly Detection Made Simple | Oracle Data Mining (ODM) Blog

After that, we can use the CLAIMS data mining model to "score" all customer
auto insurance policies, sort them by our prediction_probability and select the
top 5 most unusual claims.

-- Top 5 most suspicious fraud policy holder claims

select * from

(select POLICYNUMBER, round(prob_fraud*100,2) percent_fraud,

rank() over (order


by prob_fraud desc) rnk from

(select POLICYNUMBER, prediction_probability(CLAIMSMODEL, '0'


using *) prob_fraud

from CLAIMS

where PASTNUMBEROFCLAIMS in ('2 to 4', 'more than 4')))

where rnk <= 5

order by percent_fraud desc;

Leave these results inside the database and you can create powerful
dashboards using Oracle Business Intelligence EE (or any reporting or
dashboard tool that can query the Oracle Database) that multiple ODM's
probability of the record being anomalous times (x) the dollar amount of the
claim, and then use stoplight color coding (red, orange, yellow) to flag only
the more suspicious claims. Very automated, very easy, and all inside the
Oracle Database!

Join the discussion

Comments ( 5 )

https://blogs.oracle.com/datamining/fraud-and-anomaly-detection-made-simple 3/4
29/7/2019 Fraud and Anomaly Detection Made Simple | Oracle Data Mining (ODM) Blog

Recent Content

DATA MINING (O
Oracle Data Miner UI Join us at the Analytics and Oracle's Machin
Data Summit, March 12-14, presentations a
2019 at Oracle HQ - All Open World & C
Analytics, All Data, No 2018
Nonsense!
There were ma
Hope you and your talks again at O
colleagues can join us at Open World &
the upcoming Ana... 2018! See the

Site Map Legal Notices Terms of Use Privacy Preferencias para cookies Ad Choices

Oracle Content Marketing Login

https://blogs.oracle.com/datamining/fraud-and-anomaly-detection-made-simple 4/4

You might also like