260 likes | 426 Views
粗糙集理论与方法. 闵帆 副教授 漳州师范学院粒计算重点实验室 砺志楼 404 minfanphd@163.com fjzsroughsets@163.com (作业专用) http://grc.fjzs.edu.cn/~fmin/. 什么是文件格式(百度). 文件格式(或文件类型)是指电脑为了存储信息而使用的对信息的特殊编码方式,是用于识别内部储存的资料。比如有的储存图片,有的储存程序,有的储存文字信息。每一类信息,都可以一种或多种文件格式保存在电脑存储中。每一种文件格式通常会有一种或多种扩展名可以用来识别,但也可能没有扩展名。扩展名可以帮助应用程序识别文件格式。. 2.
E N D
粗糙集理论与方法 闵帆 副教授 漳州师范学院粒计算重点实验室 砺志楼404 minfanphd@163.com fjzsroughsets@163.com(作业专用) http://grc.fjzs.edu.cn/~fmin/
什么是文件格式(百度) 文件格式(或文件类型)是指电脑为了存储信息而使用的对信息的特殊编码方式,是用于识别内部储存的资料。比如有的储存图片,有的储存程序,有的储存文字信息。每一类信息,都可以一种或多种文件格式保存在电脑存储中。每一种文件格式通常会有一种或多种扩展名可以用来识别,但也可能没有扩展名。扩展名可以帮助应用程序识别文件格式。 2
.arff文件格式 .arff文件是Weka专用的格式 可以用记事本、写字板等打开.arff文件 观察weather.symbolic.arff文件,它由哪几部分组成? 3
weather.symbolic.arff @relation weather.symbolic @attribute outlook {sunny, overcast, rainy} @attribute temperature {hot, mild, cool} @attribute humidity {high, normal} @attribute windy {TRUE, FALSE} @attribute play {yes, no} @data sunny,hot,high,FALSE,no sunny,hot,high,TRUE,no overcast,hot,high,FALSE,yes rainy,mild,high,FALSE,yes rainy,cool,normal,FALSE,yes rainy,cool,normal,TRUE,no overcast,cool,normal,TRUE,yes sunny,mild,high,FALSE,no 4
weather.arff @relation weather @attribute outlook {sunny, overcast, rainy} @attribute temperature real @attribute humidity real @attribute windy {TRUE, FALSE} @attribute play {yes, no} @data sunny,85,85,FALSE,no sunny,80,90,TRUE,no overcast,83,86,FALSE,yes rainy,70,96,FALSE,yes rainy,68,80,FALSE,yes rainy,65,70,TRUE,no overcast,64,65,TRUE,yes 5
.tab文件格式 .tab文件是RSES使用的格式,这个后缀名也可能被别的应用程序使用,但内部格式定义不同 可以用记事本、写字板等打开.tab文件 观察weather.nomina.tab文件,它由哪几部分组成? 6
weather.nominal.tab TABLE "weather.nominal" ATTRIBUTES 5 "Outlook" symbolic "Temperature" symbolic "Humidity" symbolic "Windy" symbolic "Play" symbolic OBJECTS 14 sunny,hot,high,FALSE,no sunny,hot,high,TRUE,no overcast,hot,high,FALSE,yes rainy,mild,high,FALSE,yes rainy,cool,normal,FALSE,yes rainy,cool,normal,TRUE,no overcast,cool,normal,TRUE,yes 7
比较 @relation weather.symbolic @attribute outlook {sunny, overcast, rainy} @attribute temperature {hot, mild, cool} @attribute humidity {high, normal} @attribute windy {TRUE, FALSE} @attribute play {yes, no} @data sunny,hot,high,FALSE,no sunny,hot,high,TRUE,no overcast,hot,high,FALSE,yes rainy,mild,high,FALSE,yes rainy,cool,normal,FALSE,yes rainy,cool,normal,TRUE,no overcast,cool,normal,TRUE,yes sunny,mild,high,FALSE,no TABLE "weather.nominal" ATTRIBUTES 5 "Outlook" symbolic "Temperature" symbolic "Humidity" symbolic "Windy" symbolic "Play" symbolic OBJECTS 14 sunny,hot,high,FALSE,no sunny,hot,high,TRUE,no overcast,hot,high,FALSE,yes rainy,mild,high,FALSE,yes rainy,cool,normal,FALSE,yes rainy,cool,normal,TRUE,no overcast,cool,normal,TRUE,yes 8
讨论 用一种格式专用的软件能看到设计者希望用户看到的内容 用Notepad等软件则能看到它们原本的内容 RSES除了有.tab格式,还有哪些格式? 9
课堂练习 尝试用记事本打开.html文件,.doc文件等 用Word打开iris.tab,iris.arff,观察里面还有哪些内容 10
课堂练习 打开UCI数据库里的balloon和glass数据,把它们分别做成.arff和.tab格式 11
作业5 百度“uci数据集” 下载一个你所感兴趣的数据 将它做成.arff及.tab格式 在Weka与RSES中使用它们 12
第三章 上下近似 • 上下近似是粗糙集的一个核心概念 • 动机 • 经典集合论只能对已知的、确定的对象进行处理 • 使用属性描述的对象需要更广泛的方法来处理
属性导致的划分 • {Outlook}导致的对象划分:{{1, 2, 8, 9, 11}, {3, 7, 12, 13}, {4, 5, 6, 10, 14}} • {Temperature}导致的对象划分:{{1, 2, 3, 13}, {4, 8, 10, 11, 12, 14}, {5, 6, 7, 9}} • {Outlook, Temperature}导致的对象划分:{{1, 2}, {8, 11}, {9}, {3, 13}, {7}, {12}, {4}, {5, 6}} • 所有的对象组成的集合被记为U,它们是对于U的划分
下近似与上近似 • 集合{2, 3, 4, 7, 9, 10, 11, 12, 13} 表达了Play这一概念,对于{Outlook}而言,其下近似是{3, 7, 12, 13}, 上近似是U • 该下近似对应于一条确定性规则: Outlook = overcast -> Play = P • 该上近似还对应于两条可能性规则: Outlook = sunny -> Play = P Outlook = rain -> Play = P
边界域 • 上近似减去下近似为其边界域,边界域所对应的都是可能性规则
课堂练习 • 求Play这一概念在属性集合{Outlook, Temperature}上的上近似、下近似与边界域 • 求Don’t play这一概念在属性集合{Outlook, Temperature}上的上近似、下近似与边界域
Awesome! • 我们知道什么是“粗糙”了~
正区域 • 决策属性形成一个划分,若干个概念 • 将这些概念对于条件属性的下近似取并,就得到了正区域 • 正区域记为POSC(d)
演示与练习 • 演示:令C = {Outlook, Temperature}, d = Play,求POSC(d) • 练习:令C = {Outlook, Windy}, d = Play,求POSC(d)
约简的经典定义 • B C被称为一个(相对)约简当且仅当
练习 • 所有的约简的集合被记为S,令C = {Outlook, Temperature, Humidity}, d = Play,求Red(S)
作业6 • 继续作业3的例子 • 求每个决策的上、下近似
参考文献 [1] Z. Pawlak, “Rough sets”, International Journal of Computer and Information Sciences, 11: 341-356, 1982.