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

    https://github.com/apache/spark/pull/4831#discussion_r25622274
  
    --- Diff: python/pyspark/mllib/classification.py ---
    @@ -207,7 +207,7 @@ def train(cls, data, iterations=100, 
initialWeights=None, regParam=0.01, regType
             """
             def train(rdd, i):
                 return callMLlibFunc("trainLogisticRegressionModelWithLBFGS", 
rdd, int(iterations), i,
    -                                 float(regParam), str(regType), 
bool(intercept), int(corrections),
    +                                 float(regParam), regType, 
bool(intercept), int(corrections),
    --- End diff --
    
    The difference is the error message. If we use `str(...)`, the Java 
function call would be successful and inside the Java function, we say "type" 
is not recognized.
    
    If we don't use `str(..)`, if users input something like `1`, `2`. Py4j 
will throw an error saying there is no Java function matching the input 
signature, which usually confuses users.
    
    Anyway, this is a minor issue for `regType`.


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