数据挖掘:基于卡方的ChiMerge方法对数值离散化(稀有数据挖掘答案代码)

本文介绍了如何使用基于卡方的ChiMerge方法进行数值离散化,给出了详细的过程和C++代码实现,适用于处理稀有数据挖掘问题。
摘要由CSDN通过智能技术生成

 

 

数据挖掘:基于卡方的ChiMerge方法对数值离散化:(课本题目的答案)

#include<iostream>

#include<stdio.h>

#include<stdlib.h>

#include<conio.h>

#include<string.h>

#define SIZE 150

#define OK 1

#define ERROR 0

#define MAX_INTERVAL 6

#define precision 1e-10

using namespace std;

const static char s1[]="Iris-setosa";

const static char s2[]="Iris-versicolor";

const static char s3[]="Iris-virginica";

const int len=20;

int fnum[SIZE][3];

float num[4][SIZE];

float min_loc[]={0,0,0,0,0};

int countnum=0;

int now;

int sort(float *pn,char ps[SIZE][len])

{

   register int i,j,k;

   float temp;

   char s[len];

   for(i=0;i<SIZE-1;i++)

     for(j=i+1;j<SIZE;j++)

       if(pn[i]>pn[j])

       {temp=pn[i],strcpy(s,ps[i]);pn[i]=pn[j],strcpy(ps[i],ps[j]);pn[j]=temp,strcpy(ps[j],s);}

   return OK;

}

void strcp(char p1[SIZE][len],char p2[SIZE][len])

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值