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

    https://github.com/apache/spark/pull/16117#discussion_r90694765
  
    --- Diff: R/pkg/R/mllib.R ---
    @@ -817,44 +804,29 @@ setMethod("predict", signature(object = 
"LogisticRegressionModel"),
     #  Get the summary of an LogisticRegressionModel
     
     #' @param object an LogisticRegressionModel fitted by \code{spark.logit}
    -#' @return \code{summary} returns the Binary Logistic regression results 
of a given model as list,
    -#'         including roc, areaUnderROC, pr, fMeasureByThreshold, 
precisionByThreshold,
    -#'         recallByThreshold, totalIterations, objectiveHistory. Note that 
Multinomial logistic
    -#'         regression summary is not available now.
    +#' @return \code{summary} returns coefficients matrix of the fitted model
     #' @rdname spark.logit
     #' @aliases summary,LogisticRegressionModel-method
     #' @export
     #' @note summary(LogisticRegressionModel) since 2.1.0
     setMethod("summary", signature(object = "LogisticRegressionModel"),
               function(object) {
                 jobj <- object@jobj
    -            is.loaded <- callJMethod(jobj, "isLoaded")
    -
    -            if (is.loaded) {
    -              stop("Loaded model doesn't have training summary.")
    +            features <- callJMethod(jobj, "rFeatures")
    +            labels <- callJMethod(jobj, "labels")
    +            coefficients <- callJMethod(jobj, "rCoefficients")
    +            nCol <- length(coefficients) / length(features)
    --- End diff --
    
    Can we do the `nCol` calculation and column name on scala side? So, we 
don't have to call `rFeatures` and `labels` on R side, which makes the logic 
simpler. 


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