frequentitemset.cpp
来自「用data miming技术进行false prediction」· C++ 代码 · 共 36 行
CPP
36 行
#include "FrequentItemset.h"
FrequentItemset::FrequentItemset(string name, int count) {
trim(name);
this->mName = name;
this->mCount = count;
this->mSize = getFICount(name);
}
string FrequentItemset::getName() const {
return mName;
}
int FrequentItemset::getCount() const {
return mCount;
}
int FrequentItemset::getSize() const {
return mSize;
}
int FrequentItemset::getFICount(string str) const {
bool found = true;
int count = 1;
int index = -1;
while (found) {
index = str.find(" ", index+1);
if (index != string::npos) {
count++;
} else {
break;
}
}
return count;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?