mirror of
https://github.com/rmontanana/mdlp.git
synced 2025-08-16 07:55:58 +00:00
refactor sample
This commit is contained in:
@@ -113,14 +113,18 @@ void process_file(const string &path, const string &file_name, bool class_last,
|
|||||||
size_t total = 0;
|
size_t total = 0;
|
||||||
for (auto i = 0; i < attributes.size(); i++) {
|
for (auto i = 0; i < attributes.size(); i++) {
|
||||||
auto min_max = minmax_element(X[i].begin(), X[i].end());
|
auto min_max = minmax_element(X[i].begin(), X[i].end());
|
||||||
cout << "Cut points for " << get<0>(attributes[i]) << endl;
|
cout << "Cut points for feature " << get<0>(attributes[i]) << ": [" << setprecision(3);
|
||||||
cout << "Min: " << *min_max.first << " Max: " << *min_max.second << endl;
|
|
||||||
cout << "--------------------------" << setprecision(3) << endl;
|
|
||||||
test.fit(X[i], y);
|
test.fit(X[i], y);
|
||||||
for (auto item: test.getCutPoints()) {
|
auto cut_points = test.getCutPoints();
|
||||||
cout << item << endl;
|
for (auto item: cut_points) {
|
||||||
|
cout << item;
|
||||||
|
if (item != cut_points.back())
|
||||||
|
cout << ", ";
|
||||||
}
|
}
|
||||||
total += test.getCutPoints().size();
|
total += test.getCutPoints().size();
|
||||||
|
cout << "]" << endl;
|
||||||
|
cout << "Min: " << *min_max.first << " Max: " << *min_max.second << endl;
|
||||||
|
cout << "--------------------------" << endl;
|
||||||
}
|
}
|
||||||
cout << "Total cut points ...: " << total << endl;
|
cout << "Total cut points ...: " << total << endl;
|
||||||
cout << "Total feature states: " << total + attributes.size() << endl;
|
cout << "Total feature states: " << total + attributes.size() << endl;
|
||||||
|
Reference in New Issue
Block a user