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] 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