This is an automated email from the ASF dual-hosted git repository.

dongjoon pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/master by this push:
     new 7f44a6e  [SPARK-28755][R][TESTS] Increase tolerance in 'spark.mlp' 
SparkR test for JDK 11
7f44a6e is described below

commit 7f44a6e367d79b5366df9899022c734c78b51de9
Author: HyukjinKwon <[email protected]>
AuthorDate: Fri Aug 16 10:03:14 2019 -0700

    [SPARK-28755][R][TESTS] Increase tolerance in 'spark.mlp' SparkR test for 
JDK 11
    
    <!--
    Thanks for sending a pull request!  Here are some tips for you:
      1. If this is your first time, please read our contributor guidelines: 
https://spark.apache.org/contributing.html
      2. Ensure you have added or run the appropriate tests for your PR: 
https://spark.apache.org/developer-tools.html
      3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., 
'[WIP][SPARK-XXXX] Your PR title ...'.
      4. Be sure to keep the PR description updated to reflect all changes.
      5. Please write your PR title to summarize what this PR proposes.
      6. If possible, provide a concise example to reproduce the issue for a 
faster review.
    -->
    
    ### What changes were proposed in this pull request?
    <!--
    Please clarify what changes you are proposing. The purpose of this section 
is to outline the changes and how this PR fixes the issue.
    If possible, please consider writing useful notes for better and faster 
reviews in your PR. See the examples below.
      1. If you refactor some codes with changing classes, showing the class 
hierarchy will help reviewers.
      2. If you fix some SQL features, you can provide some references of other 
DBMSes.
      3. If there is design documentation, please add the link.
      4. If there is a discussion in the mailing list, please add the link.
    -->
    
    This PR proposes to increase the tolerance for the exact value comparison 
in `spark.mlp` test. I don't know the root cause but some tolerance is already 
expected. I suspect it is not a big deal considering all other tests pass.
    
    The values are fairly close:
    
    JDK 8:
    
    ```
    -24.28415, 107.8701, 16.86376, 1.103736, 9.244488
    ```
    
    JDK 11:
    
    ```
    -24.33892, 108.0316, 16.89082, 1.090723, 9.260533
    ```
    
    ### Why are the changes needed?
    <!--
    Please clarify why the changes are needed. For instance,
      1. If you propose a new API, clarify the use case for a new API.
      2. If you fix a bug, you can clarify why it is a bug.
    -->
    
    To fully support JDK 11. See, for instance, #25443 and #25423 for ongoing 
efforts.
    
    ### Does this PR introduce any user-facing change?
    <!--
    If yes, please clarify the previous behavior and the change this PR 
proposes - provide the console output, description and/or an example to show 
the behavior difference if possible.
    If no, write 'No'.
    -->
    
    No
    
    ### How was this patch tested?
    <!--
    If tests were added, say they were added here. Please make sure to add some 
test cases that check the changes thoroughly including negative and positive 
cases if possible.
    If it was tested in a way different from regular unit tests, please clarify 
how you tested step by step, ideally copy and paste-able, so that other 
reviewers can test and check, and descendants can verify in the future.
    If tests were not added, please describe why they were not added and/or why 
it was difficult to add.
    -->
    
    Manually tested on the top of https://github.com/apache/spark/pull/25472 
with JDK 11
    
    ```bash
    ./build/mvn -DskipTests -Psparkr -Phadoop-3.2 package
    ./bin/sparkR
    ```
    
    ```R
    absoluteSparkPath <- function(x) {
      sparkHome <- sparkR.conf("spark.home")
      file.path(sparkHome, x)
    }
    df <- 
read.df(absoluteSparkPath("data/mllib/sample_multiclass_classification_data.txt"),
                  source = "libsvm")
    model <- spark.mlp(df, label ~ features, blockSize = 128, layers = c(4, 5, 
4, 3),
                       solver = "l-bfgs", maxIter = 100, tol = 0.00001, 
stepSize = 1, seed = 1)
    summary <- summary(model)
    head(summary$weights, 5)
    ```
    
    Closes #25478 from HyukjinKwon/SPARK-28755.
    
    Authored-by: HyukjinKwon <[email protected]>
    Signed-off-by: Dongjoon Hyun <[email protected]>
---
 R/pkg/tests/fulltests/test_mllib_classification.R | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/R/pkg/tests/fulltests/test_mllib_classification.R 
b/R/pkg/tests/fulltests/test_mllib_classification.R
index 1f1b187..2da3a02 100644
--- a/R/pkg/tests/fulltests/test_mllib_classification.R
+++ b/R/pkg/tests/fulltests/test_mllib_classification.R
@@ -308,7 +308,7 @@ test_that("spark.mlp", {
   expect_equal(summary$layers, c(4, 5, 4, 3))
   expect_equal(length(summary$weights), 64)
   expect_equal(head(summary$weights, 5), list(-24.28415, 107.8701, 16.86376, 
1.103736, 9.244488),
-               tolerance = 1e-6)
+               tolerance = 1e-1)
 
   # Test predict method
   mlpTestDF <- df


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to