Tiểu kết chương 3

Một phần của tài liệu Tìm hiểu các thuật toán MMC và MMDT trên bảng quyết định đa trị (Trang 65 - 79)

Chương này đó cài đặt được cỏc hàm tớnh toỏn MMC và MMDT. Ngoài ra 2 vớ dụ cụ thể cũng được mụ phỏng để minh họa cho 2 thuật toỏn MMC và MMDT về việc đưa ra cỏc luật phõn lớp.

KẾT LUẬN VÀ HƯỚNG PHÁT TRIỂN

Trong thời gian làm luận văn, tỏc giả đó hoàn thiện luận văn với cỏc mục tiờu đặt ra ban đầu. Cụ thể luận văn đó đạt được những kết quả sau:

 Trỡnh bày cỏc kiến thức về phõn lớp dữ liệu, ứng dụng phõn lớp dữ liệu dựa trờn cõy quyết định, thuật toỏn tổng quỏt xõy dựng cõy quyết định.

 Trỡnh bày hai thuật toỏn xõy dựng cõy quyết định đa trị là MMC (Multi-valued and Multi-labeled Classifier) và MMDT (Multi-valued and Multi-labeled Decision Tree), hàm xỏc định thuộc tớnh tốt nhất để phõn nhỏnh trước, hàm xử lý thuộc tớnh kiểu số, hàm xỏc định nỳt lỏ, cựng một số vớ dụ minh họa cho cỏc hàm này.

 Cài đặt bằng C# hai thuật toỏn MMC và MMDT trờn dữ liệu thực tế.

Một số vấn đề luận văn phải tiếp tục nghiờn cứu, tỡm hiểu:

 Tỡm tập dữ liệu huấn luyện cú nhiều bản ghi hơn để mụ hỡnh cõy quyết định cú độ tin cậy cao hơn và hoạt động hiệu quả hơn.

 Tỡm hiểu nhu cầu thực tế để tiếp tục phỏt triển, trở thành phần mềm khai phỏ dữ liệu ứng dụng trong cỏc lĩnh vực như du lịch, y khoa,…

TÀI LIỆU THAM KHẢO

1. Yen-Liang Chen, Chang-Ling Hsu, Shih-Chieh Chou (2003): Constructing a multi- valued and multi-labeled decision tree, Expert Systems with Applications 25 199– 209.

2. Shihchieh Chou, Chang-Ling Hsu: MMDT (2003): A multi-valued and multi- labeled Decision Tree classifier for data mining, Expert Systems with Applications xx (xxxx) 1–14.

3. Hong Li, Rui Zhao, Jianer Chen , and Yao Xiang (2006): Research on Multi-valued and Multi-labeled Decision Trees, ADMA 2006, LNAI 4093, pp. 247–254, 2006. 4. Weiguo Yi, Mingyu Lu, Zhi Liu (2011): Multi-valued attribute and multi-labeled

data decision tree algorithm, Int. J. Mach. Learn. & Cyber. (2011) 2:67–74.

5. Yen-Liang Chen, Hsiao-Wei Hu (2009), Kwei Tang: Constructing a decision tree from data with hierarchical class labels, Expert Systems with Applications 36 4838– 4847.

6. Tapio Elomaa, Juho Rousu (1999): General and Efficient Multisplitting of Numerical Attributes, Machine Learning, 36, 201–244.

7. Zhibo CHEN, Surong LAN, Hui HAN (2014), Jianxin WANG: Multi-valued Attribute and Single-sampled Data Decision Tree Algorithm for Entity Identication, Journal of Computational Information Systems 2927–2935.

8. The Morgan Kaufmann Series in Data Management Systems, Jim Gray: Datamining- Concepts and Techniques, Chapter 7- Classification and Prediction. Series Editor Morgan Kaufmann Publishers, August 2000

9. Ho Tu Bao, Chapter 3: Data mining with Decision Tree – http://www.netnam.vn/unescocourse/knowlegde/knowlegd.htm

10. Anurag Srivastava, Eui- Hong Han, Vipin Kumar, Vieet Singh. Parallel (1999): Formulations of Decision-Tree Classification Algorithm. Kluwer Academic Publisher.

11. Agrawal, R., Ghosh, S., Imielinski, T., Iyer, B., & Swami, A. (1992): An interval classifier for database mining applications. Proceedings of the 18th international conference on very large databases(pp. 560–573).

12. Mehta, M., Agrawal, R., & Rissanen, J. (1996). SLIQ: A fast scalable classifier for data mining. Proceedings of the fifth international conference on extending database technology.

13. Quinlan, J. R. (1993).C4.5: Programs for machine learning. San Mateo, CA: Morgan Kaufmann

14. Quinlan, J. R. (1986): Induction of decision trees.

15. Shafer, J. C., Agrawal, R., & Mehta, M. (1996). SPRINT: A scalable parallel classifier for data mining. Proceedings of the 22nd international conference on very large databases(pp. 544–555).

63

PHỤ LỤC

Hàm chia khoảng cho thuộc tớnh số

public static List<string> partitionNumberList(List<TrainDataItem>

trainData, int k)

{ (adsbygoogle = window.adsbygoogle || []).push({});

List<string> distinctList = new List<string>();

List<TrainDataItem> sortList = new

List<TrainDataItem>(trainData);

sortList.Sort((x, y) => x.Income.CompareTo(y.Income));

int minValue = sortList[0].Income;

int maxValue = sortList[sortList.Count - 1].Income;

int delta = (maxValue - minValue) / k;

for (int index = 0; index < k; index++)

{

int left = index * delta + minValue;

int right = left + delta - 1;

if (index == k - 1) right = maxValue;

distinctList.Add(string.Format("{0}-{1}", left,

right));

}

return distinctList;

}

Thuật toỏn tớnh độ tương tự cho MMC

Tớnh same (Li,Lj)

//---

public static List<string> intersectSet(List<string> set1,

List<string> set2) {

List<string> intersectList = new List<string>();

for (int i = 0; i < set1.Count; i++)

if (set2.Contains(set1[i])) intersectList.Add(set1[i]); } return intersectList; } //---

public static int countSame(List<string> set1, List<string>

set2) {

return intersectSet(set1, set2).Count;

}

//--- (adsbygoogle = window.adsbygoogle || []).push({});

Tớnh different (Li,Lj)

public static int countDifferent(List<string> set1,

List<string> set2) {

List<string> diffList = new List<string>(set1);

for (int i = 0; i < set2.Count; i++)

{ if (diffList.Contains(set2[i])) diffList.Remove(set2[i]); else diffList.Add(set2[i]); } return diffList.Count; } //---  Tớnh cardinality (Li,Lj)

public static int countCardinality(List<string> set1,

List<string> set2) {

List<string> cardinalityList = new List<string>(set1);

{ if (!cardinalityList.Contains(set2[i])) cardinalityList.Add(set2[i]); } return cardinalityList.Count; } //---  Tớnh similarity(Li,Lj)

public static float getSimilarity(List<string> set1,

List<string> set2) {

return ((float)countSame(set1, set2) /

countCardinality(set1, set2) -

(float)countDifferent(set1, set2) /

countCardinality(set1, set2) + 1) / 2; }

//---

Tớnh setsimilarity

public static float getSetSimilarity(List<List<string>>

multiLabeledSet) {

if (multiLabeledSet == null) return 0;

else if (multiLabeledSet.Count == 0) return 0;

else if (multiLabeledSet.Count == 1) return 1;

float setSimilarity = 0;

int m = multiLabeledSet.Count;

for (int i = 0; i < m - 1; i++)

{

for (int j = i + 1; j < m; j++)

setSimilarity += getSimilarity(multiLabeledSet[i], multiLabeledSet[j]); } } return setSimilarity / (m * (m - 1) / 2); } //---  Tớnh weighted-similarity(AttribItem)

public static float getWeightedSimilarity(List<AttribItem> (adsbygoogle = window.adsbygoogle || []).push({});

atrribSet) {

float weightedSimilarity = 0;

int totalRow = 0;

foreach (AttribItem item in atrribSet) totalRow +=

item.getCount();

foreach (AttribItem item in atrribSet)

{ float s = item.getSetSimilarity(); int c = item.getCount(); float w = s * c / totalRow; weightedSimilarity += item.getSetSimilarity()*item.getCount()/totalRow; } return weightedSimilarity; }

Thuật toỏn tớnh tỷ lệ độ tương tự cho MMDT

public static int getConsistent(List<string> labelSet,

List<string> set1, List<string> set2) {

int consistent = 0;

foreach (string label in labelSet) {

// Tổng số nhón xuất hiện trong cả 2

if ((set1.Contains(label)) && (set2.Contains(label))) consistent++;

// Tổng số nhón khụng xuất hiện trong cả 2 list

if ((!set1.Contains(label)) && (!set2.Contains(label))) consistent++; } return consistent; } //---

public static int getInConsistent(List<string> set1,

List<string> set2) {

int inconsistent = 0;

// Số lượng nhón chỉ xuất hiện trong set1

foreach (string label in set1) if

(!set2.Contains(label)) inconsistent++;

// Số lượng nhón chỉ xuất hiện trong set2

foreach (string label in set2) if

return inconsistent; }

//---

public static float getLabelSimitary(List<string> labelSet, List<string> set1, List<string> set2)

{

return ((float)1.0 + (float)getConsistent(labelSet, set1, set2)) /

((float)1.0 + (float)getInConsistent(set1, set2)); (adsbygoogle = window.adsbygoogle || []).push({});

}

//---

public static float

normalizedLabelSimitary(List<string> labelSet, List<string> set1, List<string> set2, float minScore, float maxScore)

{

return (getLabelSimitary(labelSet, set1, set2) - minScore) /

(maxScore - minScore); }

//---

public static float getMaxLabelRatio(List<List<string>> multiLabeledSet, LabelClass labelClass)

{

float maxLabelRatio = 0;

// Tớnh giỏ trị cho từng nhón

foreach (List<string> dataLabel in multiLabeledSet) {

List<int> quantityList = new List<int>();

foreach (List<string> label in

labelClass.AllLabelSet) // 2^k - 1

{

// Tớnh số lượng xuất hiện của nhón

int quantity = 0;

foreach (List<string> labelInData in

multiLabeledSet) { string l1 = DataUtil.convertToCommaString(label); string l2 = DataUtil.convertToCommaString(labelInData); if (l1.Equals(l2)) quantity++; } if (quantity == 0) continue; // Tớnh độ lương tự float simitary = DataUtil.normalizedLabelSimitary(labelClass.LabelSet,

dataLabel, label, labelClass.MinScore, labelClass.MaxScore); labelRatio += quantity * simitary;

}

labelRatio = labelRatio / multiLabeledSet.Count;

if (labelRatio > maxLabelRatio) maxLabelRatio = labelRatio;

}

}

//---

public static string

getMaxLabelRatioString(List<List<string>> multiLabeledSet, LabelClass labelClass) (adsbygoogle = window.adsbygoogle || []).push({});

{

string maxLabel = string.Empty; float maxLabelRatio = 0;

// Tớnh giỏ trị cho từng nhón

foreach (List<string> dataLabel in multiLabeledSet) {

float labelRatio = 0;

List<int> quantityList = new List<int>();

foreach (List<string> label in

labelClass.AllLabelSet) // 2^k - 1

{

// Tớnh số lượng xuất hiện của nhón

int quantity = 0;

foreach (List<string> labelInData in

multiLabeledSet) { string l1 = DataUtil.convertToCommaString(label); string l2 = DataUtil.convertToCommaString(labelInData); if (l1.Equals(l2)) quantity++; } if (quantity == 0) continue;

// Tớnh độ lương tự

float simitary =

DataUtil.normalizedLabelSimitary(labelClass.LabelSet,

dataLabel, label, labelClass.MinScore, labelClass.MaxScore); labelRatio += quantity * simitary;

} labelRatio = labelRatio / multiLabeledSet.Count; if (labelRatio > maxLabelRatio) { maxLabelRatio = labelRatio; maxLabel = convertToCommaString(dataLabel); } }

return string.Format("R({0}) max = {1}", maxLabel, maxLabelRatio);

}

//---

public static float

getWeightedMaxLabelRatio(List<AttribItem> atrribSet, LabelClass labelClass)

{

float weightedMaxLabelRatio = 0; // E(Ai, v, D)

int totalRow = 0;

foreach (AttribItem item in atrribSet) totalRow += item.getCount();

{ float maxLabelRatio = DataUtil.getMaxLabelRatio(item.MultiLabeledSet, labelClass); weightedMaxLabelRatio += maxLabelRatio * item.getCount() / totalRow; } return weightedMaxLabelRatio; }

59-55,52-48 mau

(adsbygoogle = window.adsbygoogle || []).push({});

Một phần của tài liệu Tìm hiểu các thuật toán MMC và MMDT trên bảng quyết định đa trị (Trang 65 - 79)