Github user felixcheung commented on a diff in the pull request:

    https://github.com/apache/spark/pull/13690#discussion_r81194847
  
    --- Diff: R/pkg/R/mllib.R ---
    @@ -1310,3 +1335,33 @@ setMethod("write.ml", signature(object = "ALSModel", 
path = "character"),
               function(object, path, overwrite = FALSE) {
                 write_internal(object, path, overwrite)
               })
    +
    +#' Decision tree regression model.
    +#'
    +#' Fit Decision Tree regression model on a SparkDataFrame.
    +#'
    +#' @param data SparkDataFrame for training.
    +#' @param formula A symbolic description of the model to be fitted. 
Currently only a few formula
    +#'                operators are supported, including '~', ':', '+', and 
'-'.
    +#'                Note that operator '.' is not supported currently.
    +#' @return a fitted decision tree regression model
    +#' @rdname spark.decisionTreeRegressor
    +#' @seealso rpart: \url{https://cran.r-project.org/web/packages/rpart/}
    +#' @export
    +#' @examples
    +#' \dontrun{
    +#' df <- createDataFrame(sqlContext, kyphosis)
    +#' model <- spark.decisionTreeRegression(df, Kyphosis ~ Age + Number + 
Start)
    +#' }
    +setMethod("spark.decisionTreeRegression", signature(data = 
"SparkDataFrame", formula = "formula"),
    +          function(data, formula) {
    +            formula <- paste(deparse(formula), collapse = "")
    +            jobj <- 
callJStatic("org.apache.spark.ml.r.DecisionTreeRegressorWrapper", "fit",
    +                                data@sdf, formula)
    +            new("DecisionTreeRegressionModel", jobj = jobj)
    +          })
    +
    +setMethod("predict", signature(object = "DecisionTreeRegressionModel"),
    +          function(object, newData) {
    +            return(dataFrame(callJMethod(object@jobj, "transform", 
newData@sdf)))
    --- End diff --
    
    I think this has been updated to use an internal function - could you check?


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to