Các thành tựu của công nghệ tri thức đã làm thay đổi bộ mặtthế giới và một trong những thành tựu nổi bật đó là Data mining khai phá dữ liệu.Khai phá dữ liệu là quá trình khai thác, chiết
Trang 1Mở đầu
Khoa học và công nghệ là đặc trưng của thời đại, công nghệ tri thức trở thànhmột lĩnh vực rộng lớn Các thành tựu của công nghệ tri thức đã làm thay đổi bộ mặtthế giới và một trong những thành tựu nổi bật đó là Data mining (khai phá dữ liệu).Khai phá dữ liệu là quá trình khai thác, chiết xuất thông tin hữu ích từ khối dữ liệu đểgiải quyết các vấn đề về kinh doanh Các giai đoạn giải quyết một vấn đề kinh doanh :định nghĩa các mục tiêu khai thác và kinh doanh, thu thập dữ liệu và chuẩn bị, xâydựng và đánh giá mô hình, triển khai
Trong phạm vi của bài thu hoạch nhỏ này, em sẽ trình bày một số hướng dẫnviệc sử dụng Oracle Data Miner khai phá dữ liệu đối với cơ sở dữ liệu Oracle 11 Quađây, chúng em cũng xin được gửi lời cảm ơn đến Giáo sư - Tiến sỹ Khoa Học HoàngVăn Kiếm, người đã tận tâm truyền đạt những kiến thức nền tảng cơ bản cho chúng
em về môn học “Công nghệ tri thức”
Trang 2-MỤC LỤC
Mở đầu 1
PHẦN I : INSTALL ORACLE DATABASE 11G 3
I CHUẨN BỊ : 3
II CÀI ĐẶT : 3
1 Giải nén 2 file source database 11g vừa download về trong cùng một thư mục ví dụ như thư mục database 3
2 Chạy file setup 4
PHẦN II : THIẾT LẬP ORACLE DATA MINER 11
I CREATE A DATA MINER USER ACCOUNT : 11
1 Run Sqldeveloper.exe 11
2 In the the SQL Developer Connections tab, right-click Connections and select New Connection from the pop-up menu 11
3 Tạo kết nối : 12
4 Create an account for data mining 13
II TẠO KẾT NỐI CHO USER DATA MINER 16
1 Right-click the Connections node and select New Connection from the pop-menu 16
2 Tạo kết nối tới user vừa tạo : 16
3 17
4 Close both the dmuser and admin Worksheet windows 17
III INSTALL THE DATA MINER 18
1 From the SQL Developer menu, select View > Data Miner > Data Miner Connections 18
2 Close tab Connections 19
3 Double-click on dmuser (and not the admin user) 19
4 Xuất hiện cửa sổ : 20
5 Xuất hiện cửa sổ : 20
6 Xuất hiện cửa sổ : 20
IV CREATE A DATA MINER PROJECT 21
1 In the Data Miner tab, right-click user, and select New Project : 21
2 In the Create Project window, enter a project name (in this example ABC Insurance) and then click OK .21
V BUILD A DATA MINER WORKFLOW 22
1 Right-click your project (ABC Insurance) and select New Workflow 22
2 Xuất hiện : 22
3 Click the Data category 23
4 Drag and drop the Explore Data 25
5 Link the data source and explore data 26
6 Create Classification 29
Right-click Class Build and select View Models > CLAS_DT_2_2 33
7 Áp dụng mô hình 36
Tài liệu tham khảo 43
Trang 3-PHẦN I : INSTALL ORACLE DATABASE 11G
I CHUẨN BỊ :
Để cài đặt cần download :
- Source Database 11g
edition/downloads/112010-win32soft-098987.html
http://www.oracle.com/technetwork/database/enterprise Source SQL Developer
http://www.oracle.com/technetwork/developer-tools/sql-developer/downloads/index.html
II CÀI ĐẶT :
1.Giải nén 2 file source database 11g vừa download về trong cùng một thư
mục ví dụ như thư mục database
Trang 4-2 Chạy file setup
Bỏ dấu check “I wish ”
Chọn Next
Chọn Create and Configure a Database Next
Trang 5-Chọn Destop Class Next
Chọn Thư mục cài đặt và nhập password Oracle yêu cầu (ít nhất 1 kí tự
hoa và 1 ki tự số , chiều dài 6 kí tự) Next
Trang 6-Chọn Finish
Trang 7-Chọn “Private networks” Allow access
Trang 8-MÔN HỌC : CÔNG NGHỆ TRI THỨC - 8
Trang 9-Chọn “Private networks” Allow access
Chọn OK
Trang 10-Finish Close
Install complete
Trang 11-PHẦN II : THIẾT LẬP ORACLE DATA MINER
I CREATE A DATA MINER USER ACCOUNT :
1 Run Sqldeveloper.exe
2 In the the SQL Developer Connections tab, right-click Connections and
select New Connection from the pop-up menu
Trang 12-3 Tạo kết nối :
• Connection Name: admin (có thể đặt tên khác)
• Username: sys
• Password: The Administrative password for your database
• Connection Type: Basic
• Role: SYSDBA
• Hostname: The host name of your database server (localhost if the
database is installed on your PC)
• Port: Enter the apropriate port number (1521 is the default)
• SID: The name of SID for your database (orcl the default)
Trang 13-4 Create an account for data mining
A In the SQL Developer Connections tab, chọn admin connection.
B Then, right-click Other Users node and select Create
Trang 14-C In the Create/Edit User window :
• User Name: dmuser
• Password: Create a password of your choice
• Default Tablespace: USERS
• Temporary Tablespace: TEMP
D The Roles tab and click the check box in the Granted Column for CONNECT
Trang 15-E The Quotas tab and click the check box to set Tablespace to Unlimited
(for the default tablespace)
F Click Apply to create the account.
Trang 16-II TẠO KẾT NỐI CHO USER DATA MINER
1 Right-click the Connections node and select New Connection from the
pop-menu
2 Tạo kết nối tới user vừa tạo :
• Connection Name: dmuser
• Username: dmuser
• Password: Enter the password that you created for the data miner user
• Connection Type: Basic
• Role: default
• Host Name: Enter the appropriate host name for your database server
• Port: Enter the apropriate port number (1521 is the default)
• SID: Enter the approriate value (orcl the default)
A Click Test to test the Connection Result: The Status prompt should
display "Success!”
B Click Connect.
Trang 17-3
4 Close both the dmuser and admin Worksheet windows
Trang 18-III INSTALL THE DATA MINER
1 From the SQL Developer menu, select View > Data Miner > Data Miner
Connections
Trang 19-2 Close tab Connections
3 Double-click on dmuser (and not the admin user).
Chọn Yes
Trang 20-4.Xuất hiện cửa sổ :
Trang 21-IV CREATE A DATA MINER PROJECT
1 In the Data Miner tab, right-click user, and select New Project :
2 In the Create Project window, enter a project name (in this example ABC
Insurance) and then click OK
Trang 22-V BUILD A DATA MINER WORKFLOW
1 Right-click your project (ABC Insurance) and select New Workflow
2 Xuất hiện :
Trang 23-3 Click the Data category
Drag and drop the Data Source
Trang 24-Chọn table CUST_INSUR_LTV_SAMPLE Next
Chọn Finish
Trang 25-4 Drag and drop the Explore Data
Trang 26-5 Link the data source and explore data
Right-click the data source (INSUR_CUST_LTV_SAMPLE), select Connect
Double-click the Explore Data, select the BUY_INSURANCE
Trang 27-Right-click the Explore Data node and select Run.
Trang 28-Right-click the Explore Data, select View Data
Data miner tính toán một loạt các thông tin về từng thuộc tính trong dữ
Trang 29-6.Create Classification
Bạn muốn dự đoán các khách hàng có nhiều khả năng để mua bảo hiểm Do
đó, bạn sẽ chỉ định một mô hình phân loại Theo mặc định, Oracle Data Miner chọn tất
cả các thuật toán hỗ trợ cho một mô hình phân loại
Click on Models
Drag the Classification
Trang 30-Connect the data source node to the classification
In the Edit Classification window:
A Select BUY_INSURANCE as the Target
B Select CUSTOMER_ID as the Case Id
Trang 31-Bạn có thể thay đổi thuật toán bằng cách chọn Advanced
Trang 32-Save the workflow by clicking the -Save All
Right-click the classification build node and select Run
Right-click the classification build node and select Compare Test Results
Trang 33-Tab Performance chỉ ra rằng:
• Thuật toán Decision Tree (DT) có độ tin cậy cao nhất
• Cả DT và mô hình tuyến tính tổng quát (GLM) được cung cấp các kếtquả chính xác cao nhất tổng thể
Right-click Class Build and select View Models > CLAS_DT_2_2
Trang 34-MÔN HỌC : CÔNG NGHỆ TRI THỨC - 34
Trang 35-Close the Decision Tree
Trang 36-Trong phần này, chúng ta áp dụng mô hình Decision Tree (DT) và tạo ra mộtbảng để hiển thị kết quả , dùng để dự đoán trường hợp khách hàng có thể mua bảohiểm.
select the Class Build, nhấp vào mũi tên màu xanh ở cột Output, hiện lên dấu
chéo màu đỏ là không sử dụng thuật toán này
Tiếp theo, create a new Data Source
Chọn bảng CUST_INSUR_LTV_SAMPLE, và sau đó nhấn Finish
Sử dụng tab Details để thay đổi tên
Trang 37-Open the Evaluate and Apply
Drag and drop the Apply
Trang 38-Connect the Class Build node to the Apply Mode
Connect the CUST_INSUR_LTV_APPLY node to the Apply Mode
Trang 39-APPLY MODEL tạo ra hai cột thông tin cho mỗi khách hàng:
• Dự đoán (Có hoặc Không)
• Xác suất dự đoán
Tuy nhiên, bạn thực sự muốn biết thông tin này cho mỗi khách hàng, để bạn
có thể dễ dàng kết hợp các thông tin với một khách hàng nhất định
Để có được thông tin này, bạn cần phải thêm một cột thứ ba đầu ra:Customer_ID Thực hiện theo các hướng dẫn để thêm id của khách hàng để đầu ra:
A Kích chuột phải vào nút APPLY MODEL và chọn Edit
Kết quả: Cửa sổ xuất hiện Chú ý rằng các cột Dự đoán và xác suất được xácđịnh tự động
B Chỉnh sửa Áp dụng Thông tin chi tiết cửa sổ, chọn tab Data Columns, và
sau đó nhấp vào "+", như thế này:
Trang 40-• Sau đó nhấn OK
Sau đó ,Run
Trang 41-Connect the Apply Model node to the OUTPUT
Trang 42-Right-click DT_PREDICTIONS và select View Data
Đây là dữ liệu khách hàng cần tìm !
Trang 43-1 Bài giảng môn học “Công nghệ tri thức”
Giảng viên : GS.TSKH Hoàng Văn Kiếm
Chương trình đào tạo thac sĩ CNTT qua mạng.
2 Oracle Data Miner 11g
http://www.oracle.com/technetwork/database/options/odm/dataminerworkflow-168677.html