Khai thác mẫu tuần tự tối đại

59 372 2
Khai thác mẫu tuần tự tối đại

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

BỘ GIÁO DỤC VÀ ĐÀO TẠO TRƯỜNG ĐẠI HỌC CÔNG NGHỆ TP HCM NGUYỄN NGỌC TUÂN KHAI THÁC MẪU TUẦN TỰ TỐI ĐẠI LUẬN VĂN THẠC SĨ Chuyên ngành: Công Nghệ Thông Tin Mã ngành: 60480201 TP HỒ CHÍ MINH, tháng 10 năm 2015 BỘ GIÁO DỤC VÀ ĐÀO TẠO TRƯỜNG ĐẠI HỌC CÔNG NGHỆ TP HCM NGUYỄN NGỌC TUÂN KHAI THÁC MẪU TUẦN TỰ TỐI ĐẠI LUẬN VĂN THẠC SĨ Chuyên ngành: Công Nghệ Thông Tin Mã ngành: 60480201 HƯỚNG DẪN KHOA HỌC: PGS.TS LÊ HOÀI BẮC TP HỒ CHÍ MINH, tháng 10 năm 2015 CÔNG TRÌNH ĐƯỢC HOÀN THÀNH TẠI TRƯỜNG ĐẠI HỌC CÔNG NGHỆ TP HCM Cán hướng dẫn khoa học: PGS.TS Lê Hoài Bắc Luận văn Thạc sĩ bảo vệ Trường Đại học Công nghệ TP HCM (HUTECH) ngày 17 tháng 10 năm 2015 Thành phần Hội đồng đánh giá Luận văn Thạc sĩ gồm: Họ Tên TT Chức danh Hội đồng PGS.TSKH Nguyễn Xuân Huy Chủ tịch TS Cao Tùng Anh Phản biện TS Nguyễn Thị Thúy Loan Phản biện PGS.TS Quản Thành Thơ Ủy viên TS Võ Đình Bảy Ủy viên, Thư ký Xác nhận Chủ tịch Hội đồng đánh giá Luận văn sau Luận văn sửa chữa (nếu có) Chủ tịch Hội đồng đánh giá LV PGS.TSKH Nguyễn Xuân Huy TRƯỜNG ĐH CÔNG NGHỆ TP HCM CỘNG HÒA XÃ HỘI CHỦ NGHĨA VIỆT NAM PHÒNG QLKH – ĐTSĐH Độc lập – Tự – Hạnh phúc TP HCM, ngày … tháng… năm 2015 NHIỆM VỤ LUẬN VĂN THẠC SĨ Họ tên học viên : Nguyễn Ngọc Tuân Giới tính: Nam Ngày, tháng, năm sinh : 15 – 03 – 1984 Nơi sinh:Yên Bái Chuyên ngành : Công Nghệ Thông Tin MSHV : 1341860056 I- Tên đề tài: Khai thác mẫu tối đại II- Nhiệm vụ nội dung: - Nghiên cứu lĩnh vực khám phá tri thức khai thác liệu với Cơ Sở Dữ Liệu chuỗi Tìm hiểu vềphương pháp khai thác mẫu phổ biến, mẫu đóng Nghiên cứu triển khai thuật toán khai thác mẫu tối đại Đề xuất cải tiến cho phương pháp khai thác mẫu tối đại III- Ngày giao nhiệm vụ:03/04/2015 IV- Ngày hoàn thành nhiệm vụ: 07/09/2015 V- Cán hướng dẫn: PGS TS Lê Hoài Bắc CÁN BỘ HƯỚNG DẪN (Họ tên chữ ký) PGS.TS Lê Hoài Bắc i LỜI CAM ĐOAN Tôi xin cam đoan công trình nghiên cứu riêng Các số liệu, kết đánh giá, nhận xét đề xuất cải tiến nêu Luận văn trung thực chưa công bố công trình khác Tôi xin cam đoan giúp đỡ cho việc thực Luận văn trích dẫn hay tài liệu học thuật tham khảo cảm ơn đến tác giả hay ghi rõ ràng nguồn gốc thông tin trích dẫn Luận văn Học viên thực Luận văn Nguyễn Ngọc Tuân ii LỜI CÁM ƠN hướng dẫn giúp đỡ tận tình PGS.TS Lê Hoài Bắc suốt trình thực luận văn Thầy/Cô, đồng nghiệp, bạn lớp báu quan tâm giúp đỡ suốt thời gian học tập nghiên cứu hoàn thành luận văn Tôi xin chân thành cảm ơn! TP Hồ Chí Minh, năm 2015 NGUYỄN NGỌC TUÂN iii TÓM TẮT Khai thác mẫu nhiệm vụ phổ biến khai thác liệu với ứng dụng rộng rãi Tuy nhiên, đưa nhiều mẫu cho người dùng gây khó khăn cho việc phân tích sử dụng kết Một giải pháp đề xuất để khai thác mẫu tối đại Mẫu tối đại đại diện nhỏ gọn tập mẫu tuần tự, mà thường số lượng mẫu nhỏ so với tập tất mẫu Luận văn tập chung nghiên cứu khai thác mẫu tối đại với hai thuật toán tiêu biểu MaxSP VMSP Đồng thời luận văn đề xuất số thay đổi phương pháp khai thác VMSP để có hiệu xuất tốt Những thay đổi tập chung vào việc thay đổi phương thức đọc liệu phương pháp tạo CMAP cắt tỉa ứng viên trình khai thác mẫu Thực nghiệm liệu chuẩn cho thấy đề xuất hiệu việc khai thác mẫu iv ABSTRACT Sequential pattern mining is a popular data mining task with wide applications However, it may present too many sequential patterns to users, which makes it difficult for users to comprehend the results As a solution, it was proposed to mine maximal sequential patterns, a compact representation of the set of sequential patterns, which is often several orders of magnitude smaller than the set of all sequential patterns Thesis research focused on exploiting maximal sequential patterns with two typical algorithms and VMSP MaxSP Also, thesis proposes a number of changes in mining methods VMSP for better performance The changes focus on changing the mode of reading the data and methods create trimmed CMAP candidates during sample extraction On experimental data sets show that the proposed standard is more effective in the exploitation pattern v MỤC LỤC LỜI CAM ĐOAN i LỜI CÁM ƠN ii TÓM TẮT iii ABSTRACT iv MỤC LỤC .v DANH MỤC CÁC TỪ VIẾT TẮT vii DANH MỤC CÁC BẢNG viii DANH MỤC CÁC HÌNH ix CHƯƠNG TỔNG QUAN 1.1 Giới thiệu .1 1.1.1 Lý chọn đề tài .2 1.1.2 Mục đích đề tài 1.1.3 Nội dung nghiên cứu 1.2 Khám phá tri thức khai thác liệu 1.2.1 Khám phá tri thức 1.2.2 Khai thác liệu .4 1.3 Khai thác mẫu CSDL chuỗi 1.4 Khai thác mẫu đóng 1.5 Ý nghĩa khoa học khai thác mẫu 1.5.1 Khai thác liệu sinh học, y học 1.5.2 Khai thác liệu nhật ký trang Web CHƯƠNG KHAI THÁC MẪU TUẦN TỰ TỐI ĐẠI vi 2.1 Giới thiệu chung 2.2 Các khái niệm 10 2.3 Một số thuật toán khai thác mẫu tối đại 14 2.3.1 Thuật toán MaxSP 14 2.3.2 Thuật toán VMSP 16 2.3.3 Ví dụ minh họa thuật toán VMSP 22 CHƯƠNG PHƯƠNG PHÁP 26 3.1 Giới thiệu 26 3.2 Phương pháp 27 3.2.1 Một số phân tích giải thuật VMSP 27 3.2.2 Phương pháp đề xuất 29 3.2.3 Cơ sở phương pháp kết hợp Bitmap VDB 30 3.3 Thuật toán 31 CHƯƠNG THỰC NGHIỆM VÀ ĐÁNH GIÁ 33 3.1 Thực nghiệm 33 3.2 Đánh giá kết 33 KẾT LUẬN 36 Kết luận 36 Hướng phát triển 36 TÀI LIỆU THAM KHẢO 37 PHỤ LỤC 39 32 16.IFMap-i khác rỗng 17 Cmap-i = Hình 3.6: Giải thuật tạo Cmap dựa vào Bitmap VDB 33 CHƯƠNG THỰC NGHIỆM VÀ ĐÁNH GIÁ 3.1 Thực nghiệm Thực cácthực nghiệm để đánh độ hỗ trợ hiệu suất thuật toán đề xuất.Thí nghiệm thực máy tính Core i5 chạy Windows8.1 64 bit GB nhớ RAM.So sánh hiệu suất VMSP trước sau cải tiếntất thuật toán lập trình ngôn ngữ Java.Mã nguồn VMSP nhóm tác giả đề xuất download từ http://goo.gl/hDtdt.Tất phép đo nhớ thực cách sử dụng Java API Thí nghiệm tiến hành hai liệu thực tế chuỗi click web.Hai liệu MSNBCvà Kosarak, liệu tải từ http://goo.gl/hDtdtvà sử dụng để đánh giá hiệu VMSP VMSP++ Bảng 4.1: Đặc điểm liệu mẫu Bộ liệu Số chuỗi Số item Dạng liệu MSNBC 31790 17 Chuỗi click web Kosarak 25000 14804 Chuỗi click web 3.2 Đánh giá kết Các Hình 4.1 – 4.2 thể thời gian thực VMSP VMSP++ (thuật giải với Cmap tạo dựa kết hợp Bitmap VDB) sở liệu MSNBC, Kosarak, với ngưỡng khai thác khác Các biểu đồ cho thấy VMSP++chạy với thời gian nhỏ so với VMSP với CMAP tạo phương pháp cũ 34 Thời gian thuật giải với liệu MSNBS: MSNBS-TIME 1200.0 1000.0 800.0 600.0 400.0 200.0 0.0 30% 35% VMSP 40% 45% VMSP++ Hình 4.1: Thời gian chạy MSNBC Thời gian thuật giải với liệu Kosarak: KOSARAK-TIME 1200.0 1000.0 800.0 600.0 400.0 200.0 0.0 10% 20% VMSP 30% 40% VMSP++ Hình 4.2: Thời gian chạy Kosarak Các Hình 4.3 – 4.4 thể nhớ thực VMSP VMSP++trên sở liệu MSNBC, Kosarak, với ngưỡng khai thác khác Các biểu đồ cho thấy VMSP++ chạy với nhớ nhỏ so với VMSP 35 Bộ nhớ thuật giải với liệu MSNBS: MSNBS-MEMORY 80.0 70.0 60.0 50.0 40.0 30.0 20.0 10.0 0.0 30% 35% VMSP 40% 45% VMSP++ Hình 4.3: Bộ nhớ chạy MSNBC Bộ nhớ thuật giải với liệu Kosarak: KOSARAK-MEMORY 420.0 410.0 400.0 390.0 380.0 370.0 360.0 350.0 340.0 10% 20% VMSP 30% VMSP++ Hình 4.4: Bộ nhớ chạy Kosarak 40% 36 KẾT LUẬN Kết luận Luận văn nghiên cứu tổng quan khai thác mẫu phổ biến, mẫu đóng mẫu tối đại Đã nghiên cứu phương pháp khai thác mẫu tối đại cụ thể MaxSP VMSP Từ nghiên cứu được, luận văn đề xuất phương pháp nhằm tăng hiệu xuất thuật giải, việc đề xuất tạo CMAP theo thuật giải tăng tốc trình tạo danh sách ứng viên CMAP loại hoàn toàn ứng viên ghép nối không tạo mẫu phổ biến khỏi tập ứng viên CMAP Căn kết thực nghiệm thấy việc cải tiến đề xuất cải thiện đáng kể thời gian nhớ liệu mẫu Điều có việc sử dụng kết hợp Bitmap VDB để tạo CMAP giúp tăng tốc trình xử lý tối ưu hóa nhớ so với phương pháp đề xuất [9] Qua thực nghiệm thấy cải tiến đề xuất làm thời gian thực giải thuật nhớ giảm đáng kể Nguyên nhân giảm thời trình xử lý tạo CMAP việc dùng phươn pháp kết hợp Bitmap VDB Bộ nhớ giảm thiểu đáng kể với minsup lớn CMAP tối ưu so với xử lý cũ Hướng phát triển Với kết thời gian tới áp dụng thử nghiệm phương pháp với thuật toán khai thác mẫu phổ biến mẫu đóng Thực nghiên cứu thực nghiện liệu mẫu áp dụng phương pháp để kiểm tra mức độ tối ưu phương pháp Đồng thời nghiên cứu thêm phương pháp lọc tối thực cải tiến trình lọc tối đại thuật giải 37 TÀI LIỆU THAM KHẢO [1] Congnan Luo, Soon M.Chung, “Effcient mining of maximal sequential patterns using multiple samples“, Proc 5th SIAM Intern Conf Data mining, Newport Beach, CA, 2005, pp.415-426 [2] Gomariz, Campos, Marin, Goethals, “ClaSP: An Ecient Algorithm for Mining Frequent Closed Sequences“, Proc 17th Pacic-Asia Conf Knowledge Discovery and Data Mining, 2013, pp.50-61 [3] Han J, M Kamber, "Data Mining-Concepts and Techniques (Second Edition)" Morgan Kaufman Publishers, 2006, [4] Jay Ayres, Jason Flannick, Johannes Gehrke, Tomi Yiu, “Sequential pattern mining using a bitmap representation“, Proc 8th ACM Intern Conf Knowl Discov Data Mining, 2002 [5] JianPei, JiaweiHan, Behzad Mortazavi-Asl, Jianyong Wang, Helen Pinto, Qiming Chen, Umeshwar Dayal, Mei-Chun Hsu, “Mining sequential patterns by pattern-growth: the PrexSpan approach“, IEEE Trans Known Data Engin, 2004, pp.1-8 [6] Jianyong Wang, Jianwei Han, Chun Li, "Frequent closed sequence mining without candidate maintenance“, IEEE Trans on Knowledge Data Engineering , 2007,pp.1-8 [7] Mohammed J.Zaki, “SPADE: An effcient algorithm for mining frequent sequences“, Machine Learning, 2001, pp.31-60 [8] Nancy P.Lin, Wei-Hua Hao, Hung-Jen Chen, Hao-En Chueh, Chung-I Chang, “Fast Mining Maximal Sequential Patterns“, Proc of the 7th Intern Conf on Simulation, Modeling and Optimization, September 15-17, Beijing, China, 2007, pp.404-407 [9] Nizar R.Mabroukeh, C.I.Ezeife, “A taxonomy of sequential pattern mining algorithms“, ACM Computing Surveys, 2010, pp 3.1-3.41 [10] Philippe Fournier-Viger, Antonio Gomariz, Manuel Campos, Rincy Thomas, “Fast Vertical Mining of Sequential Patterns Using Co-occurrence Information“, 38 Proc 18th Pacic-Asia Conference on Knowledge Discovery and Data Mining , Springer, LNAI, 2014 [11] Philippe Fournier-Viger, Antonio Gomariz, Manuel Campos, Rincy Thomas, “Fast Vertical Sequential Pattern Mining Using Co-occurrence Information“ Proc 18th Pacic-Asia Conference on Knowledge Discovery and Data Mining , Springer, LNAI, 2014 [12] Philippe Fournier-Viger, Cheng-Wei Wu, Antonio Gomariz, Vincent S.Tseng, “VMSP: Effcient Vertical Mining of Maximal Sequential Patterns“, Proc 18th Pacic-Asia Conference on Knowledge Discovery and Data Mining , Springer, LNAI, 2014 [13] Philippe Fournier-Viger, Cheng-Wei Wu, Vincent S.Tseng, “Mining Maximal Sequential Patterns without Candidate Maintenance“ Proc 9th Intern Conference on Advanced Data Mining and Applications, 2013 [14] Rene A Garcia-Hernandez, Jose Fco Martnez-Trinidad, Jesus Ariel CarrascoOchoa,“A new algorithm for fast discovery of maximal sequential patterns in a document collection“, Comp Linguistics Intelligent Text Processing, 2006 [15] Shen Lu, Chunping Li, “Apriori Adjust: An Effcient Algorithm for Discovering the Maximum Sequential Patterns“, Proc Intern Workshop Knowl Grid and Grid Intell, 2004 [16] Xifeng Yan, Jiawei Han, Ramin Afshar, “CloSpan: Mining closed sequential patterns in large datasets“, Proc of the third SIAM International Conference on Data Mining, May 1-3, San Francisco, California, ISBN 0-89871-545-8, 2003 [17] Usama Fayyad, Gregory Piatetsky-Shapiro, and Padhraic Smyth: From Data Mining toKnowledge Discovery inDatabases, [online], viewed 12 March 2015, from:http://www.aaai.org/Conferences/National/1997/aaai97.htm [18] CRISP-DM 1.0 - Statoo Consulting, from: [online], viewed 15 March 2015, 39 PHỤ LỤC Mã nguồn lập trình kiểm thử viêt Java Mã nguồncài đặt số thuật giải quan trọng dùng luận văn: Cài đặt thuật toán kết hợp Bitmap VDB để tạo CMAP coocMapEquals = new HashMap(); coocMapAfter = new HashMap(); for (Entry entry1 : verticalDB.entrySet()) { Map mapS = new HashMap(); Map mapI = new HashMap();; for (Entryentry2 : verticalDB.entrySet()) { Bitmap newBitmapS = entry1.getValue().createNewBitmapSStep(entry2.getValue(), sequencesSize, lastBitIndex, maxGap); if (newBitmapS.getSupport()>= minsup) mapS.put(entry2.getKey(), newBitmapS.getSupport()); if (entry1.getKey() != entry2.getKey()) { Bitmap newBitmapI = entry1.getValue().createNewBitmapIStep(entry2.getValue(), sequencesSize, lastBitIndex); if (newBitmapI.getSupport()>= minsup) mapI.put(entry2.getKey(), newBitmapI.getSupport()); } } if (!mapS.isEmpty()) 40 coocMapAfter.put(entry1.getKey(), mapS); if (!mapI.isEmpty()) coocMapEquals.put(entry1.getKey(), mapI); } Thuật toán tạo VDB từ ArrayTransaction int sid = 0; // to know which sequence we are scanning int tid = 0; // to know which itemset we are scanning for (int[] transaction : inMemoryDB) { for (int i : transaction) { if (i==-1) { // indicate the end of an itemset tid++; } else if (i==-2) { // indicate the end of a sequence sid++; tid = 0; } else { // indicate an item // Get the bitmap for this item If none, create one Bitmap bitmapItem = verticalDB.get(i); if (bitmapItem == null) { bitmapItem = new Bitmap(lastBitIndex); verticalDB.put(i, bitmapItem); } // Register the bit in the bitmap for this item bitmapItem.registerBit(sid, tid, sequencesSize); } } } 41 Thuật toán duyệt theo chiều sâu tìm mẫu boolean dfsPruning(PrefixVMSP prefix, Bitmap prefixBitmap, List sn, List in, int hasToBeGreaterThanForIStep, int m, Integer lastAppendedItem) throws IOException { boolean atLeastOneFrequentExtension = false; // ====== S-STEPS ====== List sTemp = new ArrayList(); List sTempBitmaps = new ArrayList(); Map mapSupportItemsAfter = coocMapAfter.get(lastAppendedItem); // ************* GHEP NOI CMAP LAM UNG VIEN ************* if (mapSupportItemsAfter != null) for (Entry entry: mapSupportItemsAfter.entrySet()) { Bitmap.INTERSECTION_COUNT++; Bitmap newBitmap = prefixBitmap.createNewBitmapSStep(verticalDB.get(entry.getKey()), sequencesSize, lastBitIndex, maxGap); if (newBitmap.getSupportWithoutGapTotal()>=minsup) { sTemp.add(entry.getKey()); sTempBitmaps.add(newBitmap); } } //********************************* for (int k = 0; k < sTemp.size(); k++) { atLeastOneFrequentExtension = true; int item = sTemp.get(k); PrefixVMSP prefixSStep = prefix.cloneSequence(); prefixSStep.addItemset(new Itemset(item)); 42 if(item % == 0) { prefixSStep.sumOfEvenItems = item + prefix.sumOfEvenItems; prefixSStep.sumOfOddItems = prefix.sumOfOddItems; }else { prefixSStep.sumOfEvenItems = prefix.sumOfEvenItems; prefixSStep.sumOfOddItems = item + prefix.sumOfOddItems; } Bitmap newBitmap = sTempBitmaps.get(k); if(newBitmap.getSupport() >= minsup) { boolean hasFrequentExtension = false; if (maximumPatternLength > m) { hasFrequentExtension = dfsPruning(prefixSStep, newBitmap, sTemp, sTemp, item, m + 1, item); } if(hasFrequentExtension == false) { savePatternMultipleItems(prefixSStep, newBitmap, m); } } } Map mapSupportItemsEquals = coocMapEquals.get(lastAppendedItem); // ======== I STEPS ======= List iTemp = new ArrayList(); List iTempBitmaps = new ArrayList(); // ************* GHEP NOI CMAP LAM UNG VIEN ************* if (mapSupportItemsEquals != null) for (Entry entry: mapSupportItemsEquals.entrySet()) { Bitmap.INTERSECTION_COUNT++; 43 Bitmap newBitmap = prefixBitmap.createNewBitmapIStep(verticalDB.get(entry.getKey()), sequencesSize, lastBitIndex); if (newBitmap.getSupportWithoutGapTotal()>=minsup) { iTemp.add(entry.getKey()); iTempBitmaps.add(newBitmap); } } //************************************ for (int k = 0; k < iTemp.size(); k++) {// STRATEGY: NEWWW atLeastOneFrequentExtension = true; int item = iTemp.get(k); PrefixVMSP prefixIStep = prefix.cloneSequence(); prefixIStep.getItemsets().get(prefixIStep.size() - 1).addItem(item); if(item % == 0) { prefixIStep.sumOfEvenItems = item + prefix.sumOfEvenItems; prefixIStep.sumOfOddItems = prefix.sumOfOddItems; }else { prefixIStep.sumOfEvenItems = prefix.sumOfEvenItems; prefixIStep.sumOfOddItems = item + prefix.sumOfOddItems; } Bitmap newBitmap = iTempBitmaps.get(k); boolean hasFrequentExtension = false; if (maximumPatternLength > m) { hasFrequentExtension = dfsPruning(prefixIStep, newBitmap, sTemp, iTemp, item, m + 1, item); } if(hasFrequentExtension == false) { savePatternMultipleItems(prefixIStep, newBitmap, m); 44 } } MemoryLogger.getInstance().checkMemory(); return atLeastOneFrequentExtension || useStrategyForwardExtensionChecking == false; } Thuật toán kết hợp theo s-extension Bitmap createNewBitmapSStep(Bitmap bitmapItem, List sequencesSize, int lastBitIndex, int maxGap) { //INTERSECTION_COUNT++; // create a new bitset that will be use for the new bitmap BitSet newBitset = new BitSet(lastBitIndex); // create the new bitmap Bitmap newBitmap = new Bitmap(newBitset); // We an AND with the bitmap of the item and this bitmap for (int bitK = bitmap.nextSetBit(0); bitK >= 0; bitK = bitmap.nextSetBit(bitK+1)) { int sid = bitToSID(bitK, sequencesSize); int lastBitOfSID = lastBitOfSID(sid, sequencesSize, lastBitIndex); boolean match = false; int supporttWithoutGap = 0; for (int bit = bitmapItem.bitmap.nextSetBit(bitK+1); bit >= && bit

Ngày đăng: 11/09/2017, 20:37

Từ khóa liên quan

Tài liệu cùng người dùng

Tài liệu liên quan