You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by zhengruifeng <gi...@git.apache.org> on 2017/05/15 03:11:22 UTC

[GitHub] spark pull request #17981: [SPARK-15767][ML][SparkR] Decision Tree wrapper i...

GitHub user zhengruifeng opened a pull request:

    https://github.com/apache/spark/pull/17981

    [SPARK-15767][ML][SparkR] Decision Tree wrapper in SparkR

    ## What changes were proposed in this pull request?
    support decision tree in R
    
    ## How was this patch tested?
    added tests

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/zhengruifeng/spark dt_r

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/17981.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #17981
    
----
commit 7ea29392d17e0ec5ecbd1e9c1d09c7fdc04fee35
Author: Zheng RuiFeng <ru...@foxmail.com>
Date:   2017-05-12T10:00:36Z

    create pr

commit 68041a0db7cd391fdff22bb52636fe140012fa44
Author: Zheng RuiFeng <ru...@foxmail.com>
Date:   2017-05-15T03:07:27Z

    fix wrong call

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #17981: [SPARK-15767][ML][SparkR] Decision Tree wrapper i...

Posted by bdwyer2 <gi...@git.apache.org>.
Github user bdwyer2 commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17981#discussion_r116859197
  
    --- Diff: R/pkg/R/mllib_tree.R ---
    @@ -499,3 +543,199 @@ setMethod("write.ml", signature(object = "RandomForestClassificationModel", path
               function(object, path, overwrite = FALSE) {
                 write_internal(object, path, overwrite)
               })
    +
    +#' Decision Tree Model for Regression and Classification
    +#'
    +#' \code{spark.decisionTree} fits a Decision Tree Regression model or Classification model on
    +#' a SparkDataFrame. Users can call \code{summary} to get a summary of the fitted Decision Tree
    +#' model, \code{predict} to make predictions on new data, and \code{write.ml}/\code{read.ml} to
    +#' save/load fitted models.
    +#' For more details, see
    +#' \href{http://spark.apache.org/docs/latest/ml-classification-regression.html#decision-tree-regression}{
    +#' Decision Tree Regression} and
    +#' \href{http://spark.apache.org/docs/latest/ml-classification-regression.html#decision-tree-classifier}{
    +#' Decision Tree Classification}
    +#'
    +#' @param data a SparkDataFrame for training.
    +#' @param formula a symbolic description of the model to be fitted. Currently only a few formula
    +#'                operators are supported, including '~', ':', '+', and '-'.
    +#' @param type type of model, one of "regression" or "classification", to fit
    +#' @param maxDepth Maximum depth of the tree (>= 0).
    +#' @param maxBins Maximum number of bins used for discretizing continuous features and for choosing
    +#'                how to split on features at each node. More bins give higher granularity. Must be
    +#'                >= 2 and >= number of categories in any categorical feature.
    +#' @param impurity Criterion used for information gain calculation.
    +#'                 For regression, must be "variance". For classification, must be one of
    +#'                 "entropy" and "gini", default is "gini".
    +#' @param seed integer seed for random number generation.
    +#' @param minInstancesPerNode Minimum number of instances each child must have after split.
    +#' @param minInfoGain Minimum information gain for a split to be considered at a tree node.
    +#' @param checkpointInterval Param for set checkpoint interval (>= 1) or disable checkpoint (-1).
    +#' @param maxMemoryInMB Maximum memory in MB allocated to histogram aggregation.
    +#' @param cacheNodeIds If FALSE, the algorithm will pass trees to executors to match instances with
    +#'                     nodes. If TRUE, the algorithm will cache node IDs for each instance. Caching
    +#'                     can speed up training of deeper trees. Users can set how often should the
    +#'                     cache be checkpointed or disable it by setting checkpointInterval.
    --- End diff --
    
    This is kind of confusing
    >Users can set how often should the cache be checkpointed


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17981: [SPARK-15767][ML][SparkR] Decision Tree wrapper in Spark...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/17981
  
    Merged build finished. Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17981: [SPARK-15767][ML][SparkR] Decision Tree wrapper in Spark...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/17981
  
    **[Test build #76926 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/76926/testReport)** for PR 17981 at commit [`68041a0`](https://github.com/apache/spark/commit/68041a0db7cd391fdff22bb52636fe140012fa44).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17981: [SPARK-15767][ML][SparkR] Decision Tree wrapper in Spark...

Posted by felixcheung <gi...@git.apache.org>.
Github user felixcheung commented on the issue:

    https://github.com/apache/spark/pull/17981
  
    merged to master. thanks!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17981: [SPARK-15767][ML][SparkR] Decision Tree wrapper in Spark...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/17981
  
    **[Test build #76927 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/76927/testReport)** for PR 17981 at commit [`7e383a2`](https://github.com/apache/spark/commit/7e383a2f7e488c4277ee418454d1bbc69c8c8eb2).
     * This patch **fails SparkR unit tests**.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17981: [SPARK-15767][ML][SparkR] Decision Tree wrapper in Spark...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/17981
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/76930/
    Test FAILed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17981: [SPARK-15767][ML][SparkR] Decision Tree wrapper in Spark...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/17981
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/76926/
    Test FAILed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #17981: [SPARK-15767][ML][SparkR] Decision Tree wrapper i...

Posted by felixcheung <gi...@git.apache.org>.
Github user felixcheung commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17981#discussion_r116649021
  
    --- Diff: R/pkg/R/mllib_tree.R ---
    @@ -45,6 +45,20 @@ setClass("RandomForestRegressionModel", representation(jobj = "jobj"))
     #' @note RandomForestClassificationModel since 2.1.0
     setClass("RandomForestClassificationModel", representation(jobj = "jobj"))
     
    +#' S4 class that represents a DecisionTreeRegressionModel
    +#'
    +#' @param jobj a Java object reference to the backing Scala DecisionTreeRegressionModel
    +#' @export
    +#' @note DecisionTreeRegressionModel since 2.2.0
    --- End diff --
    
    2.3.0 please


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17981: [SPARK-15767][ML][SparkR] Decision Tree wrapper in Spark...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/17981
  
    Merged build finished. Test FAILed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17981: [SPARK-15767][ML][SparkR] Decision Tree wrapper in Spark...

Posted by felixcheung <gi...@git.apache.org>.
Github user felixcheung commented on the issue:

    https://github.com/apache/spark/pull/17981
  
    any more comment?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17981: [SPARK-15767][ML][SparkR] Decision Tree wrapper in Spark...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/17981
  
    **[Test build #76926 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/76926/testReport)** for PR 17981 at commit [`68041a0`](https://github.com/apache/spark/commit/68041a0db7cd391fdff22bb52636fe140012fa44).
     * This patch **fails R style tests**.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17981: [SPARK-15767][ML][SparkR] Decision Tree wrapper in Spark...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/17981
  
    **[Test build #76930 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/76930/testReport)** for PR 17981 at commit [`7e383a2`](https://github.com/apache/spark/commit/7e383a2f7e488c4277ee418454d1bbc69c8c8eb2).
     * This patch **fails SparkR unit tests**.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #17981: [SPARK-15767][ML][SparkR] Decision Tree wrapper i...

Posted by felixcheung <gi...@git.apache.org>.
Github user felixcheung commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17981#discussion_r116649559
  
    --- Diff: R/pkg/R/mllib_utils.R ---
    @@ -52,7 +53,8 @@ NULL
     #' @seealso \link{spark.gbt}, \link{spark.glm}, \link{glm}, \link{spark.isoreg},
     #' @seealso \link{spark.kmeans},
     #' @seealso \link{spark.logit}, \link{spark.mlp}, \link{spark.naiveBayes},
    -#' @seealso \link{spark.randomForest}, \link{spark.survreg}, \link{spark.svmLinear}
    +#' @seealso \link{spark.randomForest}, \link{spark.survreg}, \link{spark.svmLinear},
    +#' @seealso \link{spark.decisionTree}
    --- End diff --
    
    keep this sorted


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17981: [SPARK-15767][ML][SparkR] Decision Tree wrapper in Spark...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/17981
  
    Merged build finished. Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17981: [SPARK-15767][ML][SparkR] Decision Tree wrapper in Spark...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/17981
  
    **[Test build #76930 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/76930/testReport)** for PR 17981 at commit [`7e383a2`](https://github.com/apache/spark/commit/7e383a2f7e488c4277ee418454d1bbc69c8c8eb2).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17981: [SPARK-15767][ML][SparkR] Decision Tree wrapper in Spark...

Posted by zhengruifeng <gi...@git.apache.org>.
Github user zhengruifeng commented on the issue:

    https://github.com/apache/spark/pull/17981
  
    Jenkins, please retest this please


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17981: [SPARK-15767][ML][SparkR] Decision Tree wrapper in Spark...

Posted by zhengruifeng <gi...@git.apache.org>.
Github user zhengruifeng commented on the issue:

    https://github.com/apache/spark/pull/17981
  
    @felixcheung Updated. Thanks for your reviewing!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17981: [SPARK-15767][ML][SparkR] Decision Tree wrapper in Spark...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/17981
  
    Test FAILed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/76927/
    Test FAILed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17981: [SPARK-15767][ML][SparkR] Decision Tree wrapper in Spark...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/17981
  
    **[Test build #76938 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/76938/testReport)** for PR 17981 at commit [`0ba00db`](https://github.com/apache/spark/commit/0ba00dbb639a4f370a9cf119d87840c9188c2495).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17981: [SPARK-15767][ML][SparkR] Decision Tree wrapper in Spark...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/17981
  
    **[Test build #76966 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/76966/testReport)** for PR 17981 at commit [`b4a68fa`](https://github.com/apache/spark/commit/b4a68faaef6299e73eb3da42481f00ab67ff7701).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds no public classes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17981: [SPARK-15767][ML][SparkR] Decision Tree wrapper in Spark...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/17981
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/76938/
    Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17981: [SPARK-15767][ML][SparkR] Decision Tree wrapper in Spark...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/17981
  
    Merged build finished. Test FAILed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17981: [SPARK-15767][ML][SparkR] Decision Tree wrapper in Spark...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/17981
  
    Merged build finished. Test FAILed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #17981: [SPARK-15767][ML][SparkR] Decision Tree wrapper i...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/spark/pull/17981


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #17981: [SPARK-15767][ML][SparkR] Decision Tree wrapper i...

Posted by felixcheung <gi...@git.apache.org>.
Github user felixcheung commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17981#discussion_r116650195
  
    --- Diff: R/pkg/R/mllib_tree.R ---
    @@ -45,6 +45,20 @@ setClass("RandomForestRegressionModel", representation(jobj = "jobj"))
     #' @note RandomForestClassificationModel since 2.1.0
     setClass("RandomForestClassificationModel", representation(jobj = "jobj"))
     
    +#' S4 class that represents a DecisionTreeRegressionModel
    +#'
    +#' @param jobj a Java object reference to the backing Scala DecisionTreeRegressionModel
    +#' @export
    +#' @note DecisionTreeRegressionModel since 2.2.0
    --- End diff --
    
    and all other instances...


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17981: [SPARK-15767][ML][SparkR] Decision Tree wrapper in Spark...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/17981
  
    **[Test build #76966 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/76966/testReport)** for PR 17981 at commit [`b4a68fa`](https://github.com/apache/spark/commit/b4a68faaef6299e73eb3da42481f00ab67ff7701).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17981: [SPARK-15767][ML][SparkR] Decision Tree wrapper in Spark...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:

    https://github.com/apache/spark/pull/17981
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/76966/
    Test PASSed.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17981: [SPARK-15767][ML][SparkR] Decision Tree wrapper in Spark...

Posted by zhengruifeng <gi...@git.apache.org>.
Github user zhengruifeng commented on the issue:

    https://github.com/apache/spark/pull/17981
  
    @felixcheung I send this PR following your implementation of `RandomForest`. Could you help reviewing this?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #17981: [SPARK-15767][ML][SparkR] Decision Tree wrapper i...

Posted by felixcheung <gi...@git.apache.org>.
Github user felixcheung commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17981#discussion_r117601672
  
    --- Diff: R/pkg/R/mllib_tree.R ---
    @@ -499,3 +543,199 @@ setMethod("write.ml", signature(object = "RandomForestClassificationModel", path
               function(object, path, overwrite = FALSE) {
                 write_internal(object, path, overwrite)
               })
    +
    +#' Decision Tree Model for Regression and Classification
    +#'
    +#' \code{spark.decisionTree} fits a Decision Tree Regression model or Classification model on
    +#' a SparkDataFrame. Users can call \code{summary} to get a summary of the fitted Decision Tree
    +#' model, \code{predict} to make predictions on new data, and \code{write.ml}/\code{read.ml} to
    +#' save/load fitted models.
    +#' For more details, see
    +#' \href{http://spark.apache.org/docs/latest/ml-classification-regression.html#decision-tree-regression}{
    +#' Decision Tree Regression} and
    +#' \href{http://spark.apache.org/docs/latest/ml-classification-regression.html#decision-tree-classifier}{
    +#' Decision Tree Classification}
    +#'
    +#' @param data a SparkDataFrame for training.
    +#' @param formula a symbolic description of the model to be fitted. Currently only a few formula
    +#'                operators are supported, including '~', ':', '+', and '-'.
    +#' @param type type of model, one of "regression" or "classification", to fit
    +#' @param maxDepth Maximum depth of the tree (>= 0).
    +#' @param maxBins Maximum number of bins used for discretizing continuous features and for choosing
    +#'                how to split on features at each node. More bins give higher granularity. Must be
    +#'                >= 2 and >= number of categories in any categorical feature.
    +#' @param impurity Criterion used for information gain calculation.
    +#'                 For regression, must be "variance". For classification, must be one of
    +#'                 "entropy" and "gini", default is "gini".
    +#' @param seed integer seed for random number generation.
    +#' @param minInstancesPerNode Minimum number of instances each child must have after split.
    +#' @param minInfoGain Minimum information gain for a split to be considered at a tree node.
    +#' @param checkpointInterval Param for set checkpoint interval (>= 1) or disable checkpoint (-1).
    +#' @param maxMemoryInMB Maximum memory in MB allocated to histogram aggregation.
    +#' @param cacheNodeIds If FALSE, the algorithm will pass trees to executors to match instances with
    +#'                     nodes. If TRUE, the algorithm will cache node IDs for each instance. Caching
    +#'                     can speed up training of deeper trees. Users can set how often should the
    +#'                     cache be checkpointed or disable it by setting checkpointInterval.
    +#' @param ... additional arguments passed to the method.
    +#' @aliases spark.decisionTree,SparkDataFrame,formula-method
    +#' @return \code{spark.decisionTree} returns a fitted Decision Tree model.
    +#' @rdname spark.decisionTree
    +#' @name spark.decisionTree
    +#' @export
    +#' @examples
    +#' \dontrun{
    +#' # fit a Decision Tree Regression Model
    +#' df <- createDataFrame(longley)
    +#' model <- spark.decisionTree(df, Employed ~ ., type = "regression", maxDepth = 5, maxBins = 16)
    +#'
    +#' # get the summary of the model
    +#' summary(model)
    +#'
    +#' # make predictions
    +#' predictions <- predict(model, df)
    +#'
    +#' # save and load the model
    +#' path <- "path/to/model"
    +#' write.ml(model, path)
    +#' savedModel <- read.ml(path)
    +#' summary(savedModel)
    +#'
    +#' # fit a Decision Tree Classification Model
    +#' t <- as.data.frame(Titanic)
    +#' df <- createDataFrame(t)
    +#' model <- spark.decisionTree(df, Survived ~ Freq + Age, "classification")
    +#' }
    +#' @note spark.decisionTree since 2.3.0
    +setMethod("spark.decisionTree", signature(data = "SparkDataFrame", formula = "formula"),
    +          function(data, formula, type = c("regression", "classification"),
    +                   maxDepth = 5, maxBins = 32, impurity = NULL, seed = NULL,
    +                   minInstancesPerNode = 1, minInfoGain = 0.0, checkpointInterval = 10,
    +                   maxMemoryInMB = 256, cacheNodeIds = FALSE) {
    --- End diff --
    
    consider adding `thresholds` parameter - possibly as a follow up PR.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17981: [SPARK-15767][ML][SparkR] Decision Tree wrapper in Spark...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/17981
  
    **[Test build #76927 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/76927/testReport)** for PR 17981 at commit [`7e383a2`](https://github.com/apache/spark/commit/7e383a2f7e488c4277ee418454d1bbc69c8c8eb2).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #17981: [SPARK-15767][ML][SparkR] Decision Tree wrapper i...

Posted by felixcheung <gi...@git.apache.org>.
Github user felixcheung commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17981#discussion_r116649599
  
    --- Diff: R/pkg/inst/tests/testthat/test_mllib_tree.R ---
    @@ -209,4 +209,91 @@ test_that("spark.randomForest", {
       expect_equal(summary(model)$numFeatures, 4)
     })
     
    +
    --- End diff --
    
    nit: remove double empty line


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #17981: [SPARK-15767][ML][SparkR] Decision Tree wrapper i...

Posted by felixcheung <gi...@git.apache.org>.
Github user felixcheung commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17981#discussion_r116649550
  
    --- Diff: R/pkg/R/mllib_utils.R ---
    @@ -38,6 +38,7 @@
     #' @seealso \link{spark.lda}, \link{spark.logit},
     #' @seealso \link{spark.mlp}, \link{spark.naiveBayes},
     #' @seealso \link{spark.randomForest}, \link{spark.survreg}, \link{spark.svmLinear},
    +#' @seealso \link{spark.decisionTree},
    --- End diff --
    
    please keep this sorted 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request #17981: [SPARK-15767][ML][SparkR] Decision Tree wrapper i...

Posted by felixcheung <gi...@git.apache.org>.
Github user felixcheung commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17981#discussion_r117601533
  
    --- Diff: R/pkg/R/mllib_tree.R ---
    @@ -499,3 +543,199 @@ setMethod("write.ml", signature(object = "RandomForestClassificationModel", path
               function(object, path, overwrite = FALSE) {
                 write_internal(object, path, overwrite)
               })
    +
    +#' Decision Tree Model for Regression and Classification
    +#'
    +#' \code{spark.decisionTree} fits a Decision Tree Regression model or Classification model on
    +#' a SparkDataFrame. Users can call \code{summary} to get a summary of the fitted Decision Tree
    +#' model, \code{predict} to make predictions on new data, and \code{write.ml}/\code{read.ml} to
    +#' save/load fitted models.
    +#' For more details, see
    +#' \href{http://spark.apache.org/docs/latest/ml-classification-regression.html#decision-tree-regression}{
    +#' Decision Tree Regression} and
    +#' \href{http://spark.apache.org/docs/latest/ml-classification-regression.html#decision-tree-classifier}{
    +#' Decision Tree Classification}
    +#'
    +#' @param data a SparkDataFrame for training.
    +#' @param formula a symbolic description of the model to be fitted. Currently only a few formula
    +#'                operators are supported, including '~', ':', '+', and '-'.
    +#' @param type type of model, one of "regression" or "classification", to fit
    +#' @param maxDepth Maximum depth of the tree (>= 0).
    +#' @param maxBins Maximum number of bins used for discretizing continuous features and for choosing
    +#'                how to split on features at each node. More bins give higher granularity. Must be
    +#'                >= 2 and >= number of categories in any categorical feature.
    +#' @param impurity Criterion used for information gain calculation.
    +#'                 For regression, must be "variance". For classification, must be one of
    +#'                 "entropy" and "gini", default is "gini".
    +#' @param seed integer seed for random number generation.
    +#' @param minInstancesPerNode Minimum number of instances each child must have after split.
    +#' @param minInfoGain Minimum information gain for a split to be considered at a tree node.
    +#' @param checkpointInterval Param for set checkpoint interval (>= 1) or disable checkpoint (-1).
    +#' @param maxMemoryInMB Maximum memory in MB allocated to histogram aggregation.
    +#' @param cacheNodeIds If FALSE, the algorithm will pass trees to executors to match instances with
    +#'                     nodes. If TRUE, the algorithm will cache node IDs for each instance. Caching
    +#'                     can speed up training of deeper trees. Users can set how often should the
    +#'                     cache be checkpointed or disable it by setting checkpointInterval.
    --- End diff --
    
    wording can be improved a bit I guess but this matches the Scaladoc...


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark issue #17981: [SPARK-15767][ML][SparkR] Decision Tree wrapper in Spark...

Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:

    https://github.com/apache/spark/pull/17981
  
    **[Test build #76938 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/76938/testReport)** for PR 17981 at commit [`0ba00db`](https://github.com/apache/spark/commit/0ba00dbb639a4f370a9cf119d87840c9188c2495).


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org