⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 数据仓库与数据挖掘--数据挖掘部分算法的matlab实现 c4_5.htm

📁 [数据挖掘]数据挖掘部分算法的matlab实现 C4_5 比较经典的代码
💻 HTM
📖 第 1 页 / 共 5 页
字号:
            <TABLE width="95%" border=0>
              <TBODY>
              <TR>
                <TD><STRONG>我的分类(专题)</STRONG></TD></TR>
              <TR>
                <TD>
                  <DIV align=center><A 
                  href="http://blogger.org.cn/blog/blog.asp?name=xueflhg">首页(85)</A><BR><A 
                  href="http://blogger.org.cn/blog/blog.asp?subjectid=845&amp;name=xueflhg">金融行业(4)</A><BR><A 
                  href="http://blogger.org.cn/blog/blog.asp?subjectid=846&amp;name=xueflhg">反洗钱专栏(9)</A><BR><A 
                  href="http://blogger.org.cn/blog/blog.asp?subjectid=843&amp;name=xueflhg">数据挖掘(11)</A><BR><A 
                  href="http://blogger.org.cn/blog/blog.asp?subjectid=844&amp;name=xueflhg">电信行业(9)</A><BR><A 
                  href="http://blogger.org.cn/blog/blog.asp?subjectid=847&amp;name=xueflhg">综合(19)</A><BR><A 
                  href="http://blogger.org.cn/blog/blog.asp?subjectid=842&amp;name=xueflhg">数据仓库(27)</A><BR></DIV></TD></TR></TBODY></TABLE><BR>
            <TABLE width="95%" border=0>
              <TBODY>
              <TR>
                <TD><STRONG>日志更新</STRONG></TD></TR>
              <TR>
                <TD>
                  <DIV align=left><A title=xueflhg发表于2006-7-6 
                  href="http://blogger.org.cn/blog/more.asp?name=xueflhg&amp;id=16337" 
                  15:41:02>数据仓库是干什么的,到现在,我终于看</A><BR><A title=xueflhg发表于2006-7-6 
                  href="http://blogger.org.cn/blog/more.asp?name=xueflhg&amp;id=16335" 
                  15:20:05>几个非常经典的对“数据仓库”的解释</A><BR><A title=xueflhg发表于2006-7-4 
                  href="http://blogger.org.cn/blog/more.asp?name=xueflhg&amp;id=16260" 
                  14:33:36>好久好久没有来管理了</A><BR><A title=xueflhg发表于2006-2-8 
                  href="http://blogger.org.cn/blog/more.asp?name=xueflhg&amp;id=11570" 
                  11:25:04>商业银行反洗钱的法律与实务分析</A><BR><A title=xueflhg发表于2006-1-16 
                  href="http://blogger.org.cn/blog/more.asp?name=xueflhg&amp;id=11223" 
                  10:42:17>UNIX系统操作命令</A><BR><A title=xueflhg发表于2005-12-31 
                  href="http://blogger.org.cn/blog/more.asp?name=xueflhg&amp;id=10920" 
                  11:06:00>AIX捉虫记之__invscoutd</A><BR><A 
                  title=xueflhg发表于2005-12-26 
                  href="http://blogger.org.cn/blog/more.asp?name=xueflhg&amp;id=10797" 
                  13:00:44>AIX基础教程</A><BR><A title=xueflhg发表于2005-12-26 
                  href="http://blogger.org.cn/blog/more.asp?name=xueflhg&amp;id=10796" 
                  12:52:49>AIX文件系统性能调优</A><BR><A title=xueflhg发表于2005-12-26 
                  href="http://blogger.org.cn/blog/more.asp?name=xueflhg&amp;id=10795" 
                  11:17:11>[命令] xargs命令</A><BR><A title=xueflhg发表于2005-12-26 
                  href="http://blogger.org.cn/blog/more.asp?name=xueflhg&amp;id=10793" 
                  11:08:35>一个AIX操作系统中的用户信息拷贝到</A><BR></DIV></TD></TR></TBODY></TABLE><BR>
            <TABLE width="95%" border=0>
              <TBODY>
              <TR>
                <TD><STRONG>最新评论</STRONG></TD></TR>
              <TR>
                <TD>
                  <DIV align=left><A title=HJ(游客)发表评论于2007-7-26 
                  href="http://blogger.org.cn/blog/more.asp?name=xueflhg&amp;id=16337#56247" 
                  15:46:36>回复:数据仓库是干什么的,到现在,我终于</A><BR><A 
                  title=薛峰(游客)发表评论于2007-7-20 
                  href="http://blogger.org.cn/blog/more.asp?name=xueflhg&amp;id=11223#55976" 
                  21:27:33>回复:UNIX系统操作命令</A><BR><A title=薛峰(游客)发表评论于2007-7-20 
                  href="http://blogger.org.cn/blog/more.asp?name=xueflhg&amp;id=11223#55975" 
                  21:25:57>回复:UNIX系统操作命令</A><BR><A title=hehe(游客)发表评论于2007-7-13 
                  href="http://blogger.org.cn/blog/more.asp?name=xueflhg&amp;id=6198#55613" 
                  13:15:12>回复:Essbase&nbsp;VS&nbsp;Cognos</A><BR><A 
                  title=dagou(游客)发表评论于2007-4-26 
                  href="http://blogger.org.cn/blog/more.asp?name=xueflhg&amp;id=16337#49519" 
                  14:01:32>回复:数据仓库是干什么的,到现在,我终于</A><BR><A 
                  title=fxwang(游客)发表评论于2007-4-25 
                  href="http://blogger.org.cn/blog/more.asp?name=xueflhg&amp;id=16337#49472" 
                  15:09:50>回复:数据仓库是干什么的,到现在,我终于</A><BR><A 
                  title=111(游客)发表评论于2007-3-25 
                  href="http://blogger.org.cn/blog/more.asp?name=xueflhg&amp;id=6839#47724" 
                  14:55:53>回复:数据挖掘部分算法的matlab实现</A><BR><A 
                  title=zlf(游客)发表评论于2007-3-24 
                  href="http://blogger.org.cn/blog/more.asp?name=xueflhg&amp;id=4312#47684" 
                  14:52:41>回复:一些编程经验,与大家共享!</A><BR><A 
                  title=qzy2004(游客)发表评论于2007-3-9 
                  href="http://blogger.org.cn/blog/more.asp?name=xueflhg&amp;id=5574#47129" 
                  11:56:04>回复:Web数据挖掘的研究现状及发展</A><BR><A 
                  title=LP(游客)发表评论于2007-1-22 
                  href="http://blogger.org.cn/blog/more.asp?name=xueflhg&amp;id=4312#45988" 
                  10:41:25>回复:一些编程经验,与大家共享!</A><BR></DIV></TD></TR></TBODY></TABLE><BR>
            <TABLE width="95%" border=0>
              <TBODY>
              <TR>
                <TD><STRONG>留言板</STRONG></TD></TR>
              <TR>
                <TD>
                  <DIV align=left>
                  <DIV align=left><A 
                  href="http://blogger.org.cn/blog/message.asp?name=xueflhg#message">签写新留言</A><BR><BR><A 
                  title=阿娅(游客)发表于2006-9-6 
                  href="http://blogger.org.cn/blog/message.asp?name=xueflhg#13518" 
                  14:30:59>我也想要ID3的源码&nbsp;C++的,yang</A><BR><A 
                  title=阿娅(游客)发表于2006-9-6 
                  href="http://blogger.org.cn/blog/message.asp?name=xueflhg#13517" 
                  14:30:45>我也想要ID3的源码&nbsp;C++的,yang</A><BR><A 
                  title=panwei&nbsp;(游客)发表于2006-5-18 
                  href="http://blogger.org.cn/blog/message.asp?name=xueflhg#4417" 
                  15:58:17>ID3算法的VC++源程序 </A><BR><A 
                  title=panwei&nbsp;(游客)发表于2006-5-18 
                  href="http://blogger.org.cn/blog/message.asp?name=xueflhg#4416" 
                  15:58:11>ID3算法的VC++源程序 </A><BR><A title=尕光(游客)发表于2006-2-21 
                  href="http://blogger.org.cn/blog/message.asp?name=xueflhg#2314" 
                  9:46:31>同行</A><BR><A title=haoyanyou(游客)发表于2006-2-15 
                  href="http://blogger.org.cn/blog/message.asp?name=xueflhg#2271" 
                  13:57:16>好地方</A><BR><A title=xueflhg发表于2005-8-18 
                  href="http://blogger.org.cn/blog/message.asp?name=xueflhg#1009" 
                  18:18:26>忙&nbsp;啊&nbsp;</A><BR><A title=idmer发表于2005-6-26 
                  href="http://blogger.org.cn/blog/message.asp?name=xueflhg#344" 
                  17:41:14>呵呵,碰到同行了</A><BR></DIV></DIV></TD></TR></TBODY></TABLE><BR>
            <TABLE height=36 width="95%" border=0>
              <TBODY>
              <TR>
                <TD><STRONG>链接</STRONG></TD></TR>
              <TR>
                <TD height=15>
                  <DIV align=left><BR><A 
                  href="http://www.unixblog.net/index.php?blog=6">AIX快活如意斋</A> 
                  </DIV>
                  <DIV align=left><A 
                  href="http://bidwhome.itpub.net/">BIDW之家</A></DIV></TD></TR></TBODY></TABLE><BR>
            <TABLE width="95%" border=0>
              <TBODY>
              <TR>
                <TD><STRONG>Blog信息</STRONG></TD></TR>
              <TR>
                <TD>
                  <DIV 
                  align=left>blog名称:数据仓库与数据挖掘<BR>日志总数:85<BR>评论数量:121<BR>留言数量:8<BR>访问次数:213297<BR>建立时间:2005年3月17日 
                  </DIV></TD></TR></TBODY></TABLE>
            <P align=center><A 
            href="http://blogger.org.cn/blog/rss2.asp?name=xueflhg" 
            target=_blank><IMG height=14 
            src="数据仓库与数据挖掘--数据挖掘部分算法的matlab实现 C4_5.files/xml.gif" width=36 
            border=0></A><BR></P>
            <DIV align=center></DIV>
            <DIV align=center><BR></DIV></TD></TR></TBODY></TABLE></TD>
    <TD vAlign=top align=middle><BR>
      <DIV id=adsense1 
      style="DISPLAY: block; FLOAT: none; TEXT-ALIGN: left"></DIV>
      <STYLE type=text/css>A.categorylink:link {
	COLOR: #999999
}
A.categorylink:visited {
	COLOR: #999999
}
A.categorylink:active {
	COLOR: #999999
}
A.categorylink:hover {
	COLOR: #ff9900
}
</STYLE>

      <TABLE style="TABLE-LAYOUT: fixed; WORD-BREAK: break-all" cellSpacing=1 
      cellPadding=3 width="98%" bgColor=#cccccc border=0>
        <TBODY>
        <TR bgColor=#f8f8f8>
          <TD>
            <P><FONT size=4><STRONG><IMG 
            src="数据仓库与数据挖掘--数据挖掘部分算法的matlab实现 C4_5.files/1.gif"><A 
            href="http://blogger.org.cn/blog/blog.asp?name=xueflhg&amp;subjectid=843">[数据挖掘]<A 
            href="http://blogger.org.cn/blog/more.asp?name=xueflhg&amp;id=6839">数据挖掘部分算法的matlab实现 
            C4_5</A></STRONG></FONT><BR><A class=categorylink 
            href="http://blogger.org.cn/blog/list.asp?classid=46" 
            target=_blank>网上资源</A>,&nbsp;&nbsp;<A class=categorylink 
            href="http://blogger.org.cn/blog/list.asp?classid=4" 
            target=_blank>随笔</A></P>
            <P><A href="http://blogger.org.cn/blog/blog.asp?name=xueflhg" 
            target=_blank>薛&nbsp;峰</A> 发表于 2005-6-27 14:21:09 </P></TD></TR>
        <TR bgColor=#ffffff>
          <TD height=0>
            <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
              <TBODY>
              <TR>
                <TD>&nbsp;function D = C4_5(train_features, train_targets, 
                  inc_node, region)<BR><BR>% Classify using Quinlan&acute;s C4.5 
                  algorithm<BR>% Inputs:<BR>% features - Train features<BR>% 
                  targets &nbsp;&nbsp;&nbsp;&nbsp;- Train targets<BR>% 
                  inc_node&nbsp;&nbsp;&nbsp;&nbsp;- Percentage of incorrectly 
                  assigned samples at a node<BR>% region 
                  &nbsp;&nbsp;&nbsp;&nbsp;- Decision region vector: [-x x -y y 
                  number_of_points]<BR>%<BR>% Outputs<BR>% D - Decision 
                  sufrace<BR><BR>%NOTE: In this implementation it is assumed 
                  that a feature vector with fewer than 10 unique values (the 
                  parameter Nu)<BR>%is discrete, and will be treated as such. 
                  Other vectors will be treated as continuous<BR><BR>[Ni, M] = 
                  size(train_features);<BR>inc_node&nbsp;&nbsp;&nbsp;&nbsp;= 
                  inc_node*M/100;<BR>Nu&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= 
                  10;<BR><BR>%For the decision 
                  region<BR>N&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
                  = 
                  region(5);<BR>mx&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= 
                  ones(N,1) * linspace 
                  (region(1),region(2),N);<BR>my&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= 
                  linspace (region(3),region(4),N)&acute; * 
                  ones(1,N);<BR>flatxy&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= 
                  [mx(:), my(:)]&acute;;<BR><BR>%Preprocessing<BR>%[f, t, UW, 
                  m]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= PCA(train_features, 
                  train_targets, Ni, region);<BR>%train_features&nbsp;&nbsp;= UW 
                  * (train_features - 
                  m*ones(1,M));;<BR>%flatxy&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= 
                  UW * (flatxy - m*ones(1,N^2));;<BR><BR>%Find which of the 
                  input features are discrete, and discretisize the 
                  corresponding<BR>%dimension on the decision 
                  region<BR>discrete_dim = zeros(1,Ni);<BR>for i = 
                  1:Ni,<BR>&nbsp;&nbsp; Nb = 
                  length(unique(train_features(i,:)));<BR>&nbsp;&nbsp; if (Nb 
                  &lt;= Nu),<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;%This is a 
                  discrete 
                  feature<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;discrete_dim(i) 
                  = Nb;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[H, flatxy(i,:)] 
                  = high_histogram(flatxy(i,:), Nb);<BR>&nbsp;&nbsp; 
                  end<BR>end<BR><BR>%Build the tree 
                  recursively<BR>disp(&acute;Building 
                  tree&acute;)<BR>tree&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= 
                  make_tree(train_features, train_targets, inc_node, 
                  discrete_dim, max(discrete_dim), 0);<BR><BR>%Make the decision 
                  region according to the tree<BR>disp(&acute;Building decision 
                  surface using the tree&acute;)<BR>targets = use_tree(flatxy, 1:N^2, 
                  tree, discrete_dim, 
                  unique(train_targets));<BR><BR>D&nbsp;&nbsp; = 
                  reshape(targets,N,N);<BR>%END<BR><BR>function targets = 
                  use_tree(features, indices, tree, discrete_dim, 
                  Uc)<BR>%Classify recursively using a tree<BR><BR>targets = 
                  zeros(1, size(features,2));<BR><BR>if (tree.dim == 
                  0)<BR>&nbsp;&nbsp; %Reached the end of the 
                  tree<BR>&nbsp;&nbsp; targets(indices) = 
                  tree.child;<BR>&nbsp;&nbsp; 
                  break<BR>end<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<BR>%This 
                  is not the last level of the tree, so:<BR>%First, find the 
                  dimension we are to work on<BR>dim = tree.dim;<BR>dims= 
                  1:size(features,1);<BR><BR>%And classify according to it<BR>if 
                  (discrete_dim(dim) == 0),<BR>&nbsp;&nbsp; %Continuous 
                  feature<BR>&nbsp;&nbsp; in = indices(find(features(dim, 
                  indices) &lt;= tree.split_loc));<BR>&nbsp;&nbsp; targets = 
                  targets + use_tree(features(dims, :), in, tree.child(1), 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -