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

    https://github.com/apache/spark/pull/18128#discussion_r118827649
  
    --- Diff: R/pkg/R/mllib_classification.R ---
    @@ -239,21 +253,51 @@ function(object, path, overwrite = FALSE) {
     setMethod("spark.logit", signature(data = "SparkDataFrame", formula = 
"formula"),
               function(data, formula, regParam = 0.0, elasticNetParam = 0.0, 
maxIter = 100,
                        tol = 1E-6, family = "auto", standardization = TRUE,
    -                   thresholds = 0.5, weightCol = NULL, aggregationDepth = 
2) {
    +                   thresholds = 0.5, weightCol = NULL, aggregationDepth = 
2,
    +                   lowerBoundsOnCoefficients = NULL, 
upperBoundsOnCoefficients = NULL,
    +                   lowerBoundsOnIntercepts = NULL, upperBoundsOnIntercepts 
= NULL) {
                 formula <- paste(deparse(formula), collapse = "")
    +            lrow <- 0
    +            lcol <- 0
    +            urow <- 0
    +            ucol <- 0
     
                 if (!is.null(weightCol) && weightCol == "") {
                   weightCol <- NULL
                 } else if (!is.null(weightCol)) {
                   weightCol <- as.character(weightCol)
                 }
     
    +            if (!is.null(lowerBoundsOnIntercepts)) {
    +                lowerBoundsOnIntercepts <- 
as.array(lowerBoundsOnIntercepts)
    +            }
    +
    +            if (!is.null(upperBoundsOnIntercepts)) {
    +                upperBoundsOnIntercepts <- 
as.array(upperBoundsOnIntercepts)
    +            }
    +
    +            if (!is.null(lowerBoundsOnCoefficients)) {
    +              lrow <- nrow(lowerBoundsOnCoefficients)
    +              lcol <- ncol(lowerBoundsOnCoefficients)
    +              lowerBoundsOnCoefficients <- 
as.array(as.vector(lowerBoundsOnCoefficients))
    +            }
    +
    +            if (!is.null(upperBoundsOnCoefficients)) {
    +              urow <- nrow(upperBoundsOnCoefficients)
    +              ucol <- ncol(upperBoundsOnCoefficients)
    --- End diff --
    
    could you add some check for upperBoundsOnCoefficients or 
lowerBoundsOnCoefficients
    for example, if upperBoundsOnCoefficients is a vector instead of a matrix, 
ncol(as.array(upperBoundsOnCoefficients)) will be NA


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to