From 848ee7ba24ed3fcd8891c94bc392df1708fde354 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Monta=C3=B1ana?= Date: Fri, 24 Feb 2023 11:32:10 +0100 Subject: [PATCH 1/5] Try tests in build action --- .github/workflows/build.yml | 13 ++++++++----- .gitignore | 3 ++- .vscode/settings.json | 3 ++- README.md | 9 +++++++++ 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dc96ed0..f9102d5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,6 +3,7 @@ on: push: branches: - main + - test pull_request: types: [opened, synchronize, reopened] jobs: @@ -15,16 +16,18 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - - name: Install sonar-scanner and build-wrapper - uses: SonarSource/sonarcloud-github-c-cpp@v1 - - name: Run build-wrapper + - name: Tests & build-wrapper run: | mkdir build - cmake -S . -B build + cmake -S . -B build -Wno-dev build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} cmake --build build/ --config Release + cd build + ctest -C Release --output-on-failure + - name: Install sonar-scanner and build-wrapper + uses: SonarSource/sonarcloud-github-c-cpp@v1 - name: Run sonar-scanner env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} # Put the name of your token here + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} run: | sonar-scanner --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}" diff --git a/.gitignore b/.gitignore index 8fc5249..31a7b4d 100644 --- a/.gitignore +++ b/.gitignore @@ -34,4 +34,5 @@ **/lcoverage .idea cmake-* -**/CMakeFiles \ No newline at end of file +**/CMakeFiles +.vscode/* \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index 09b14a2..acd9b53 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,6 @@ { "sonarlint.connectedMode.project": { - "projectKey": "rmontanana_mdlp_AYZkjILJHyjW-meBaElG" + "connectionId": "sonarcloud", + "projectKey": "rmontanana_mdlp" } } \ No newline at end of file diff --git a/README.md b/README.md index 3d09810..f5ba0fe 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ +[![Build](https://github.com/rmontanana/mdlp/actions/workflows/build.yml/badge.svg)](https://github.com/rmontanana/mdlp/actions/workflows/build.yml) +[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=rmontanana_mdlp&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=rmontanana_mdlp) +[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=rmontanana_mdlp&metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=rmontanana_mdlp) + # mdlp Discretization algorithm based on the paper by Fayyad & Irani [Multi-Interval Discretization of Continuous-Valued Attributes for Classification Learning](https://www.ijcai.org/Proceedings/93-2/Papers/022.pdf) @@ -7,6 +11,11 @@ The implementation tries to mitigate the problem of different label values with - Sorts the values of the variable using the label values as a tie-breaker - Once found a valid candidate for the split, it checks if the previous value is the same as actual one, and tries to get previous one, or next if the former is not possible. +Other features: + +- Intervals with the same value of the variable are not taken into account for cutpoints. +- Intervals have to have more than two examples to be evaluated. + The algorithm returns the cut points for the variable. ## Sample From e8fcc20a3216eb168d2058b2aa17527e4c940a9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Monta=C3=B1ana?= Date: Fri, 24 Feb 2023 11:33:26 +0100 Subject: [PATCH 2/5] Fix mistake in build action --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f9102d5..d85a196 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,6 +16,8 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - name: Install sonar-scanner and build-wrapper + uses: SonarSource/sonarcloud-github-c-cpp@v1 - name: Tests & build-wrapper run: | mkdir build @@ -23,8 +25,6 @@ jobs: build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} cmake --build build/ --config Release cd build ctest -C Release --output-on-failure - - name: Install sonar-scanner and build-wrapper - uses: SonarSource/sonarcloud-github-c-cpp@v1 - name: Run sonar-scanner env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 89d675eb1f907fbb226b4c927289be6b2d1ae407 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Monta=C3=B1ana?= Date: Fri, 24 Feb 2023 11:36:48 +0100 Subject: [PATCH 3/5] Action to execute tests --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d85a196..4ebf7a5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,6 +23,7 @@ jobs: mkdir build cmake -S . -B build -Wno-dev build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} cmake --build build/ --config Release + cmake --build build/ --config Release cd build ctest -C Release --output-on-failure - name: Run sonar-scanner From ebea31afd181ecdd795ba1f6903f2a5a93179b31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Monta=C3=B1ana?= Date: Fri, 24 Feb 2023 11:39:38 +0100 Subject: [PATCH 4/5] Build tests in action --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4ebf7a5..1d3fcd3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,10 +20,10 @@ jobs: uses: SonarSource/sonarcloud-github-c-cpp@v1 - name: Tests & build-wrapper run: | + cd tests mkdir build cmake -S . -B build -Wno-dev build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} cmake --build build/ --config Release - cmake --build build/ --config Release cd build ctest -C Release --output-on-failure - name: Run sonar-scanner From 71c1dc292868a9168796aa902ddfde2b891beb4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Monta=C3=B1ana?= Date: Fri, 24 Feb 2023 11:41:50 +0100 Subject: [PATCH 5/5] Build project and tests in action --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1d3fcd3..7f5982a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,6 +20,9 @@ jobs: uses: SonarSource/sonarcloud-github-c-cpp@v1 - name: Tests & build-wrapper run: | + mkdir build + cmake -S . -B build -Wno-dev + build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} cmake --build build/ --config Release cd tests mkdir build cmake -S . -B build -Wno-dev