mirror of
https://github.com/rmontanana/mdlp.git
synced 2025-08-15 23:45:57 +00:00
Refactor sample build
This commit is contained in:
10
README.md
10
README.md
@@ -23,12 +23,10 @@ The algorithm returns the cut points for the variable.
|
|||||||
To run the sample, just execute the following commands:
|
To run the sample, just execute the following commands:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd sample
|
cmake -B build -S .
|
||||||
cmake -B build
|
cmake --build build
|
||||||
cd build
|
build/sample/sample -f iris -m 2
|
||||||
make
|
build/sample/sample -h
|
||||||
./sample -f iris -m 2
|
|
||||||
./sample -h
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Test
|
## Test
|
||||||
|
21
sample/.vscode/launch.json
vendored
21
sample/.vscode/launch.json
vendored
@@ -1,21 +0,0 @@
|
|||||||
{
|
|
||||||
"version": "0.2.0",
|
|
||||||
"configurations": [
|
|
||||||
{
|
|
||||||
"name": "lldb puro",
|
|
||||||
"type": "cppdbg",
|
|
||||||
// "targetArchitecture": "arm64",
|
|
||||||
"request": "launch",
|
|
||||||
"program": "${workspaceRoot}/build/sample",
|
|
||||||
"args": [
|
|
||||||
"-f",
|
|
||||||
"iris"
|
|
||||||
],
|
|
||||||
"stopAtEntry": false,
|
|
||||||
"cwd": "${workspaceRoot}/build/",
|
|
||||||
"environment": [],
|
|
||||||
"externalConsole": false,
|
|
||||||
"MIMode": "lldb"
|
|
||||||
},
|
|
||||||
]
|
|
||||||
}
|
|
@@ -2,4 +2,5 @@ set(CMAKE_CXX_STANDARD 11)
|
|||||||
|
|
||||||
set(CMAKE_BUILD_TYPE Debug)
|
set(CMAKE_BUILD_TYPE Debug)
|
||||||
|
|
||||||
add_executable(sample sample.cpp ../tests/ArffFiles.cpp ../Metrics.cpp ../CPPFImdlp.cpp ../BinDisc.cpp)
|
add_executable(sample sample.cpp ../tests/ArffFiles.cpp)
|
||||||
|
target_link_libraries(sample mdlp)
|
||||||
|
@@ -11,7 +11,7 @@
|
|||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace mdlp;
|
using namespace mdlp;
|
||||||
|
|
||||||
const string PATH = "../../tests/datasets/";
|
const string PATH = "tests/datasets/";
|
||||||
|
|
||||||
/* print a description of all supported options */
|
/* print a description of all supported options */
|
||||||
void usage(const char* path)
|
void usage(const char* path)
|
||||||
@@ -131,6 +131,12 @@ void process_file(const string& path, const string& file_name, bool class_last,
|
|||||||
}
|
}
|
||||||
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;
|
||||||
|
cout << "Version ............: " << test.version() << endl;
|
||||||
|
cout << "Transformed data ...: " << endl;
|
||||||
|
auto data = test.transform(X[0]);
|
||||||
|
for (int i = 0; i < 5; i++) {
|
||||||
|
cout << fixed << setprecision(1) << X[0][i] << " " << data[i] << endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void process_all_files(const map<string, bool>& datasets, const string& path, int max_depth, int min_length,
|
void process_all_files(const map<string, bool>& datasets, const string& path, int max_depth, int min_length,
|
||||||
|
Reference in New Issue
Block a user