Remove alternative and Classic

Refactor ValueCutPoint
Reefactor sameValues in getCandidate
This commit is contained in:
2023-02-20 18:23:05 +01:00
parent 04c1772019
commit dec1295933
14 changed files with 198 additions and 203 deletions

View File

@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.20)
project(main)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 11)
add_executable(sample sample.cpp ../tests/ArffFiles.cpp ../Metrics.cpp ../CPPFImdlp.cpp)

View File

@@ -7,18 +7,20 @@
using namespace std;
using namespace mdlp;
int main(int argc, char** argv)
{
ArffFiles file;
vector<string> lines;
string path = "../../tests/datasets/";
map<string, bool > datasets = {
{"mfeat-factors", true},
{"iris", true},
{"letter", true},
{"glass", true},
{"kdd_JapaneseVowels", false},
{"test", true}
map<string, bool> datasets = {
{"mfeat-factors", true},
{"iris", true},
{"letter", true},
{"glass", true},
{"kdd_JapaneseVowels", false},
{"mfeat-factors", true},
{"test", true}
};
if (argc != 2 || datasets.find(argv[1]) == datasets.end()) {
cout << "Usage: " << argv[0] << " {mfeat-factors, glass, iris, letter, kdd_JapaneseVowels, test}" << endl;
@@ -44,9 +46,11 @@ int main(int argc, char** argv)
}
cout << y[i] << endl;
}
mdlp::CPPFImdlp test = mdlp::CPPFImdlp(0);
mdlp::CPPFImdlp test = mdlp::CPPFImdlp();
for (auto i = 0; i < attributes.size(); i++) {
auto min_max = minmax_element(X[i].begin(), X[i].end());
cout << "Cut points for " << get<0>(attributes[i]) << endl;
cout << "Min: " << *min_max.first << " Max: " << *min_max.second << endl;
cout << "--------------------------" << setprecision(3) << endl;
test.fit(X[i], y);
for (auto item : test.getCutPoints()) {