From 30bb6166464abaee0a742e6afe006facc15a8a6b Mon Sep 17 00:00:00 2001 From: Ryan Feeney Date: Fri, 8 Sep 2023 11:11:00 -0400 Subject: [PATCH 1/3] Enable Mend scan Enabling Mend scans for all public projects --- .github/workflows/mend-scan.yml | 54 +++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/mend-scan.yml diff --git a/.github/workflows/mend-scan.yml b/.github/workflows/mend-scan.yml new file mode 100644 index 00000000..3b7c2215 --- /dev/null +++ b/.github/workflows/mend-scan.yml @@ -0,0 +1,54 @@ +# Reference: https://github.com/mend-toolkit/mend-examples/blob/main/Unified%20Agent/CI-CD/GitHub.yml + +name: Mend Unified Agent Release Scan +on: + workflow_dispatch: + push: + branches: + - 'master' +jobs: + mendscan: + env: + WS_APIKEY: ${{secrets.MEND_APIKEY}} + WS_USERKEY: ${{secrets.MEND_USERKEY}} + WS_WSS_URL: ${{secrets.MEND_WS_WSS_URL}} + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: '11' + distribution: 'adopt' + # - name: Build with Gradle + # run: ./gradlew -Prelease.useLastTag=false clean build + - name: Mend Unified Agent Scan + env: + WS_PRODUCTNAME: ${{vars.MEND_PRODUCT_NAME}} + WS_PROJECTNAME: ${{github.event.repository.name}}_${{github.ref_name}} + WS_GENERATEPROJECTDETAILSJSON: true + WS_GRADLE_ADDITIONALARGUMENTS: -Prelease.useLastTag=false + run: | + echo Downloading Mend Unified Agent + curl -LJO https://unified-agent.s3.amazonaws.com/wss-unified-agent.jar + if [[ "$(curl -sL https://unified-agent.s3.amazonaws.com/wss-unified-agent.jar.sha256)" != "$(sha256sum wss-unified-agent.jar)" ]] ; then + echo "Integrity Check Failed" + else + echo "Integrity Check Passed" + echo Starting Unified Agent Scan + java -jar wss-unified-agent.jar + fi + - name: 'Upload WhiteSource folder' + uses: actions/upload-artifact@v2 + with: + name: Mend + path: whitesource + retention-days: 14 + - name: 'Upload Mend folder if failure' + uses: actions/upload-artifact@v2 + if: failure() + with: + name: Mend + path: whitesource + retention-days: 14 From 426781b4475d35c99a0722da3caf76cc94f39650 Mon Sep 17 00:00:00 2001 From: Stijn Kas Date: Mon, 11 Sep 2023 17:28:26 +0200 Subject: [PATCH 2/3] Bump version --- python/pdstools/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/pdstools/__init__.py b/python/pdstools/__init__.py index b273a431..4d95fbb4 100644 --- a/python/pdstools/__init__.py +++ b/python/pdstools/__init__.py @@ -1,6 +1,6 @@ """Python pdstools""" -__version__ = "3.2.2" +__version__ = "3.2.3" from polars import enable_string_cache From fe3e73522216e8d2f5de41ffd037b58df6ea65e9 Mon Sep 17 00:00:00 2001 From: perdo Date: Sat, 16 Sep 2023 10:10:02 +0200 Subject: [PATCH 3/3] Added additional plots to the off line model reports --- examples/datamart/modelreport.Rmd | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/examples/datamart/modelreport.Rmd b/examples/datamart/modelreport.Rmd index 72081541..ef409c5a 100644 --- a/examples/datamart/modelreport.Rmd +++ b/examples/datamart/modelreport.Rmd @@ -237,7 +237,7 @@ The Lift chart is derived from this and shows the ratio of the cumulative gain a activeClassifierBins <- classifierBins[(isInActiveRange)] -if (nrow(activeClassifierBins) >= 1 & (sum(activeClassifierBins$BinNegatives) + sum(activeClassifierBins$BinPositives) > 0)) { +if (nrow(activeClassifierBins) >= 2 & (sum(activeClassifierBins$BinNegatives) + sum(activeClassifierBins$BinPositives) > 0)) { cumGains <- plotCumulativeGains(activeClassifierBins) cumLift <- plotCumulativeLift(activeClassifierBins) @@ -314,6 +314,19 @@ can be configured with one of the parameters in the Yaml header of this notebook ```{r, results="asis", fig.height = 3, fig.width = 6, fig.align = "center"} +plotBinningPM <- function(bins) +{ + ggplot(bins[,BinSymbol := factor(BinSymbol, levels=BinSymbol)], aes(BinSymbol, Lift-1)) + + geom_col(aes(fill=I(ifelse(Lift < 1, "#A00005", "#5F9F36")), + alpha=I(ifelse(BinPositives < 25, 0.4, 1.0))), + width=0.5) + + coord_flip() + + ylab("Propensity Lift") + xlab("") + + scale_x_discrete(limits=rev) + + scale_y_continuous(labels=percent) + + geom_hline(yintercept = 0, linetype="dashed") +} + # to print all instead of only the active ones, change condition to: EntryType != "Classifier" for (f in unique(allPredictorBins[!params$predictordetails_activeonly | EntryType == "Active"]$PredictorName)) { @@ -324,7 +337,7 @@ for (f in unique(allPredictorBins[!params$predictordetails_activeonly | EntryTyp } else { cat("##", f, fill=T) # Predictor name - cat("", fill=T) + cat('
InfoBinning
', fill=T) # write.csv(predictorBinning, "tempbin.csv") @@ -337,16 +350,18 @@ for (f in unique(allPredictorBins[!params$predictordetails_activeonly | EntryTyp } # Table prelude with some overall info about the predictor - cat("", fill=T) # colour names: http://sape.inf.usi.ch/quick-reference/ggplot2/colour - cat("
InfoBinning
", fill=T) + cat('
', fill=T) printADMPredictorInfo(f, predictorBinning, extraPredInfo) cat("", fill=T) + cat('', fill=T) if (nrow(predictorBinning) > 1) { p <- plotBinning(predictorBinning)+ ggtitle(f) + print(p) + p <- plotBinningPM(predictorBinning)+ ggtitle(f) print(p) } cat("
", fill=T) @@ -356,3 +371,6 @@ for (f in unique(allPredictorBins[!params$predictordetails_activeonly | EntryTyp } ``` + + +