91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 779KB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發布日期: 2021-05-10
  • 語言: C/C++
  • 標簽: 數據挖掘??

資源簡介

數據挖掘 貝葉斯算法 C++ 貝葉斯算法一般都用MATLAB實現,好不容易找到個C++的,可以用到工程中去

資源截圖

代碼片段和文件信息

#include“GetInfo.h“
#define?space(s)?(s?==?‘?‘?||?s?==?‘\n‘?||?s?==?‘\t‘)
#define??SkipComment while?(?(?c?=?getc(f)?)?!=?‘\n‘?)
void?GetInfo::getname()
{???
char?Buffer[1000];
char?Fn[100];
int?AttCeiling=100;
int?ClassCeiling=100;
int ValCeiling;
filename.copy(Fnfilename.length());
Fn[filename.length()]=NULL;
????strcat_s(Fn“.names“);
if?(?!?(?Nf?=?fopen(Fn?“r“)?)?)?
Error(0?Fn?““);
ClassName?=?(string?*)?calloc(ClassCeiling?sizeof(string));
do
????{
????ReadName(Nf?Buffer);
????if?(?++MaxClassNo?>=?ClassCeiling)
????{
????????ClassCeiling?+=?100;
????????ClassName?=?(string?*)?realloc(ClassName?ClassCeiling*sizeof(string));
????}
????ClassName[MaxClassNo]=string(Buffer);
????}
????while?(?Delimiter?==?‘‘?);
/*??Get?attribute?and?attribute?value?names?from?names?file??*/
????AttName?=?(string?*)?calloc(AttCeiling?sizeof(string));
MaxAttValNo?=?(short?*)?calloc(AttCeiling?sizeof(short));
AttValName?=?(string?**)?calloc(AttCeiling?sizeof(string?*));
????SpecialStatus?=?(char?*)?malloc(AttCeiling);
????while?(?ReadName(Nf?Buffer)?)
????{
????if?(?Delimiter?!=?‘:‘?)?
Error(1?Buffer?““);
????????if?(?++MaxAttNo?>=?AttCeiling?)//擴大空間
????{
????????AttCeiling?+=?100;
????????AttName?=?(string?*)?realloc(AttName?AttCeiling*sizeof(string));
????????MaxAttValNo?=?(short?*)?realloc(MaxAttValNo?AttCeiling*sizeof(short));
????????AttValName?=?(string?**)?realloc(AttValName?AttCeiling*sizeof(string?*));
????????SpecialStatus?=?(char?*)?realloc(SpecialStatus?AttCeiling);
????}
????AttName[MaxAttNo]?=?string(Buffer);
????SpecialStatus[MaxAttNo]?=?0;
????MaxAttValNo[MaxAttNo]?=?0;
????ValCeiling?=?100;
????AttValName[MaxAttNo]?=?(string?*)?calloc(ValCeiling?sizeof(string));
????do
????{
????????if?(?!?(?ReadName(Nf?Buffer)?)?)?
Error(2?AttName[MaxAttNo]?““);
????????if?(?++MaxAttValNo[MaxAttNo]?>=?ValCeiling?)
????????{
????????ValCeiling?+=?100;
????????AttValName[MaxAttNo]?=(string?*)?realloc(AttValName[MaxAttNo]?ValCeiling*sizeof(string));
????????}
????????????AttValName[MaxAttNo][MaxAttValNo[MaxAttNo]]?=?string(Buffer);
????}while?(?Delimiter?==?‘‘?);
????if?(?MaxAttValNo[MaxAttNo]?==?1?)
????{
????????/*??Check?for?special?treatment??*/
????????if?(!strcmp(Buffer?“continuous“)?)
????????{
MaxContAttNo++;
}
?????????else
????????{
?????/*??Cannot?have?only?one?discrete?value?for?an?attribute??*/
?????????Error(3?AttName[MaxAttNo]?““);
????????}
????????MaxAttValNo[MaxAttNo]?=?0;
????}
????else?if?(?MaxAttValNo[MaxAttNo]?>?MaxDiscrValNo?)?
MaxDiscrValNo?=?MaxAttValNo[MaxAttNo];
????}
????fclose(Nf);
}
void???GetInfo::Error(int?n?string?s1?string?s2)
/*??-----??*/
{
????cout<<“ERROR:??“;
????switch(n)
????{
case?0:?cout<<“cannot?open?file?“< break;

case?1: cout<<“colon?expected?after?attribute?name?“< break;

case?2: cout<<“unexpected?EOF?while?reading?attribute?“<

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2014-07-07?16:09??naive?Bayes\
?????目錄???????????0??2014-07-07?16:09??naive?Bayes\debug\
?????文件???????81920??2009-05-22?22:28??naive?Bayes\debug\naive?Bayes.exe
?????文件??????471384??2009-05-22?22:28??naive?Bayes\debug\naive?Bayes.ilk
?????文件??????568320??2009-05-22?22:28??naive?Bayes\debug\naive?Bayes.pdb
?????目錄???????????0??2014-07-07?16:09??naive?Bayes\naive?Bayes\
?????文件?????1477632??2009-05-22?22:29??naive?Bayes\naive?Bayes.ncb
?????文件?????????898??2009-05-13?20:28??naive?Bayes\naive?Bayes.sln
?????文件???????39936??2009-05-22?22:29??naive?Bayes\naive?Bayes.suo
?????文件?????????410??2009-05-22?22:06??naive?Bayes\naive?Bayes\buycom.data
?????文件?????????114??2009-05-22?22:09??naive?Bayes\naive?Bayes\buycom.names
?????文件??????????23??2009-05-22?21:42??naive?Bayes\naive?Bayes\buytest.data
?????目錄???????????0??2014-07-07?16:09??naive?Bayes\naive?Bayes\Debug\
?????文件????????6986??2009-05-22?22:28??naive?Bayes\naive?Bayes\Debug\BuildLog.htm
?????文件???????82303??2009-05-22?16:05??naive?Bayes\naive?Bayes\Debug\GetInfo.obj
?????文件???????26312??2009-05-22?17:12??naive?Bayes\naive?Bayes\Debug\GetModel.obj
?????文件???????32343??2009-05-22?22:28??naive?Bayes\naive?Bayes\Debug\main.obj
?????文件??????????69??2009-05-22?22:28??naive?Bayes\naive?Bayes\Debug\mt.dep
?????文件?????????403??2009-05-18?10:45??naive?Bayes\naive?Bayes\Debug\naive?Bayes.exe.embed.manifest
?????文件?????????468??2009-05-18?10:45??naive?Bayes\naive?Bayes\Debug\naive?Bayes.exe.embed.manifest.res
?????文件?????????385??2009-05-22?22:28??naive?Bayes\naive?Bayes\Debug\naive?Bayes.exe.intermediate.manifest
?????文件???????78205??2009-05-22?22:25??naive?Bayes\naive?Bayes\Debug\PredictClass.obj
?????文件??????248832??2009-05-22?22:28??naive?Bayes\naive?Bayes\Debug\vc80.idb
?????文件??????208896??2009-05-22?22:28??naive?Bayes\naive?Bayes\Debug\vc80.pdb
?????文件???????13506??2009-05-22?10:27??naive?Bayes\naive?Bayes\GetInfo.cpp
?????文件????????2622??2009-05-22?10:26??naive?Bayes\naive?Bayes\GetInfo.h
?????文件????????1177??2009-05-22?14:28??naive?Bayes\naive?Bayes\GetModel.cpp
?????文件?????????401??2009-05-22?17:12??naive?Bayes\naive?Bayes\GetModel.h
?????文件?????????415??2009-05-22?22:06??naive?Bayes\naive?Bayes\golf.data
?????文件?????????118??2009-05-22?22:06??naive?Bayes\naive?Bayes\golf.names
?????文件?????????169??2009-05-22?20:00??naive?Bayes\naive?Bayes\golftest.data
............此處省略8個文件信息

評論

共有 條評論