LERS LEM2
该博文主要写一下LERS(Learning from Examples using Rough Sets)中的LEM2算法。
参考文献:
Grzymala-Busse J W . A new version of the rule induction system LERS[J]. Fundamenta Informaticae, 1997, 31(1):27-39.
这篇博文的内容基本就是来自这篇文献的,而且由于最近比较忙 (太懒了),所以很多直接放了文章里的图片,大家如果英语OK,且有时间可以直接看原文,然后博文中的local covering我加了一些说明,不妨一看,在1.2 Example这个位置。
一、concept
1.1 概念说明
LEM2算法需要一些预备知识。首先,需要了解粗糙集的一些基本概念,如果之前不了解的话可以先看我的另一篇介绍粗糙集的博文。除了这篇博文中的预备知识还需要了解几个概念:
解释下这几个概念的意思,T是由attribute-value pairs组成的一个set,并且所有的t得到的样本取交集应当要包含于B,那么我们就说B depends on T。之后还有一个minimal conplex的概念,这个就比较好理解了,也就是这个T是最小的让B depends on的T了,T的任何子集都不可能让B depends on了。是一个由T组成的collections,我们称之为local covering of B.它需要满足3个条件:1、每个元素T都是minimal complex;2、每个T的样本集取交集就是B;3、中member即T的个数应当最少。
那么我们可以很容易想到这个local covering 其实就是就是一个由从数据B中提取出来的知识了。这个知识就是类似于这样的形式(a1,v1) and (a2,v2)---->(d1,vd1)。
1.2 Example
信息表如下所示,标注a的条件属性,标注d的决策属性,在后面的描述中我用序号代表第几个样本,{1}就是由第一个样本代表的集合。
以(Quality , low)作为划分方式,则可以得到lower approximation是{1},upper approximation是{1 , 2 , 3}.假设B={1,2,3}(upper approximation),t可以是集合中的任意一个{(Clock,slow) , (Cache,no) , (Cache,yes) , (Main_Memory,small) , (Main_Memory,medium)},进一步可以得到T={(Clock,slow)} or {(Main_memory , small)} or {(Main_memory , medium)},进而又可以得到={ { (Clock,slow), }, },于是我们得到了一条possible rule set:(Clock,slow)——>(quality , low)。
二、Algorithm
上述例子中的信息表可以得到certain rule和possible rule 如下所示:
可见我们之前举的那个例子也在其中。每个rule上的4个数字分别是attribute-value pairs的个数,the quality of the lower approximation,the quality of the upper approximation,the conditional probability that the rule describes the concept defined by the right-hand side of the rule given the conditions on the left-hand side of the rule.The quality of the approximation如下所示:
Classification
1.1 Naive LERS classification scheme
对于这样的新的样本:
相关的rule有:
然后,我们就看一下conditional probability,发现第一个是0.667>0.5(第二个rule),因此我们就将这个样本的quality划分为low。
论文里说这种老的分类方法效果并不是非常好。
1.2 New classification system of LERS
这种分类方法也是基于之前的rule的,只是分类依据改变了。要搞清楚这种分类方法需要了解下面几个新的概念:
- Strength:is the total number of examples correctly classified by the rule during training.
- Specificity: is the total number of attribute-value pairs on the left-hand side of the rule.
- support: is defined as the sum of scores of all matching rules from the concept. The concept C for which the support , i.e., the value of the following expression:
然后还有可能是partially matching的,此时公式就是要多乘上一个Matching_factor®。Matching_factor®就是匹配的rule的attribute-value pairs比上R的所有rule的attribute-value pairs。公式如下:
对于之前的例子可以得到结果如下,下面规则上的三个数字分别是:
然后对于一个新的example,只要取那个support最大的就可以了,论文里说这样的分类效果变得很好,可以和C4.5等算法相媲美。
——————————————————————————————————————————
这也是一个知识挖掘的好方法,之后有时间用python写一些。