《数据挖掘算法原理与实现》王振武 源代码


《数据挖掘算法原理与实现》王振武书中源代码及测试数据,出版社提供版本
资源截图
代码片段和文件信息

#include 
#include 
#include 
#include 
#include 

#define InputlayerNum 35
#define OutputlayerRow 8
#define OutputlayerColumn 12
#define total_iteration_Num 80//10000//80//100//1000
#define error_limit 0.0000000000008//0.1//0.0000000000008//0.000000000000008//0.0001
#define efficiency 0.9//0.3//0.9//0.3//0.9


int ijklmn;
int inputMode[26][7][5];
double weight[OutputlayerRow*OutputlayerColumn][InputlayerNum];
int current_iteration_num=0;
double study_efficiency=efficiency;
long double distance[OutputlayerRow*OutputlayerColumn];
int neighbor_width=OutputlayerColumn;
int neighbor_height=OutputlayerRow;
int row[OutputlayerRow]column[OutputlayerColumn];
int flag[OutputlayerRow][OutputlayerColumn];
int temp_rowtemp_column;
int winner_rowwinner_column;
long double min_distance=1000.0;



/****************************************************************/
//该函数初始化距离变量为0初始化保存胜出节点的位置的变量
/****************************************************************/
void init_distance()
{
for(i=0;iyerRow;i++)
for(j=0;jyerColumn;j++)
distance[i*OutputlayerColumn+j]=0.0;
 }
/****************************************************************/
//该函数用于计算欧氏距离并找到获胜神经元
/****************************************************************/
void eula_distance()
{
int ttLowttUpppLowppUp;
ttLow=winner_column-neighbor_width/2;
ttUp=winner_column+neighbor_width/2;
ppLow=winner_row-neighbor_height/2;
ppUp=winner_row+neighbor_height/2;
if(ttLow<0)
ttLow=0;
if(ttUp>=OutputlayerColumn)
ttUp=OutputlayerColumn-1;
if(ppLow<0)
ppLow=0;
if(ppUp>=OutputlayerRow)
ppUp=OutputlayerRow-1;
for(i=ppLow;i<=ppUp;i++)
for(j=ttLow;j<=ttUp;j++)
{
if(!(flag[i][j]==100))
{
for(m=0;m<7;m++)
for(n=0;n<5;n++)
distance[i*OutputlayerColumn+j]+=
pow((inputMode[l][m][n]-weight[i*OutputlayerColumn+j][m*5+n])2);
if(distance[i*OutputlayerColumn+j] {
min_distance=distance[i*OutputlayerColumn+j];
temp_row=i;
temp_column=j;
}
}

}
if(current_iteration_num>0)
{
if(min_distance<=error_limit)
{
row[temp_row]=temp_row;
column[temp_column]=temp_column;
flag[temp_row][temp_column]=100;
}

}
}
/****************************************************************/
//调整权值
/****************************************************************/
void weight_change()
{
int ttLowttUpppLowppUp;
winner_row=temp_row;
winner_column=temp_column;
ttLow=winner_column-neighbor_width/2;
ttUp=winner_column+neighbor_width/2;
ppLow=winner_row-neighbor_height/2;
ppUp=winner_row+neighbor_height/2;
if(ttLow<0)
ttLow=0;
if(ttUp>=OutputlayerColumn)
ttUp=OutputlayerColumn-1;
if(ppLow<0)
ppLow=0;
if(ppUp>=OutputlayerRow)
ppUp=OutputlayerRow-1;
for(i=ppLow;i<=ppUp;i++)
for(j=ttLow;j<=ttUp;j++)
{
if(!(flag[i][j]==100))
{
for(m=0;m<7;m++)
for(

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      25483  2013-12-24 20:47  MyProjects10_4_SOM1.png

     文件       4303  2013-12-24 20:46  MyProjects10_4_SOM10_4_SOM.dsp

     文件        524  2013-12-24 20:36  MyProjects10_4_SOM10_4_SOM.dsw

     文件      50176  2013-12-24 20:50  MyProjects10_4_SOM10_4_SOM.ncb

     文件      48640  2013-12-24 20:50  MyProjects10_4_SOM10_4_SOM.opt

     文件        900  2013-12-24 20:49  MyProjects10_4_SOM10_4_SOM.plg

     文件      26674  2013-12-24 20:47  MyProjects10_4_SOM2.png

     文件      22987  2013-12-24 20:54  MyProjects10_4_SOM3.png

     文件     270432  2013-12-24 20:49  MyProjects10_4_SOMDebug10_4_SOM.exe

     文件     300184  2013-12-24 20:49  MyProjects10_4_SOMDebug10_4_SOM.ilk

     文件     333928  2013-12-24 20:49  MyProjects10_4_SOMDebug10_4_SOM.pch

     文件     623616  2013-12-24 20:49  MyProjects10_4_SOMDebug10_4_SOM.pdb

     文件      43171  2013-12-24 20:49  MyProjects10_4_SOMDebugSOM.obj

     文件      91136  2013-12-24 20:50  MyProjects10_4_SOMDebugvc60.idb

     文件     118784  2013-12-24 20:49  MyProjects10_4_SOMDebugvc60.pdb

     文件      10963  2013-12-24 20:49  MyProjects10_4_SOMSOM.cpp

     文件     214908  2013-12-24 20:43  MyProjects10_4_SOMSOM.txt

     文件       2922  2005-12-28 15:33  MyProjects10_4_SOM相关数据输入数据input.txt

     文件       2920  2005-12-30 21:10  MyProjects10_4_SOM相关数据输入数据非标准数据测试.txt

     文件      50712  2013-12-24 20:50  MyProjects10_4_SOM相关数据输出数据初始的权值.txt

     文件       2470  2013-12-24 20:50  MyProjects10_4_SOM相关数据输出数据向量模式.txt

     文件        737  2013-12-24 20:50  MyProjects10_4_SOM相关数据输出数据标准测试.txt

     文件        321  2013-12-24 20:50  MyProjects10_4_SOM相关数据输出数据获胜节点.txt

     文件      56856  2013-12-24 20:50  MyProjects10_4_SOM相关数据输出数据训练后所有权值.txt

     文件      15401  2013-12-24 20:50  MyProjects10_4_SOM相关数据输出数据训练后胜出权值.txt

     文件        445  2013-12-24 20:50  MyProjects10_4_SOM相关数据输出数据迭代次数.txt

     文件        737  2013-12-24 20:50  MyProjects10_4_SOM相关数据输出数据非标准测试.txt

     文件       4340  2013-12-24 15:47  MyProjects3_4_Apriori3_4_Apriori.dsp

     文件        530  2013-12-24 15:15  MyProjects3_4_Apriori3_4_Apriori.dsw

     文件      33792  2013-12-24 15:47  MyProjects3_4_Apriori3_4_Apriori.ncb

............此处省略553个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)