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

    https://github.com/apache/spark/pull/15314#discussion_r82094763
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/ml/regression/LinearRegression.scala ---
    @@ -186,7 +201,11 @@ class LinearRegression @Since("1.3.0") 
(@Since("1.3.0") override val uid: String
       override protected def train(dataset: Dataset[_]): LinearRegressionModel 
= {
         // Extract the number of features before deciding optimization solver.
         val numFeatures = 
dataset.select(col($(featuresCol))).first().getAs[Vector](0).size
    -    val w = if (!isDefined(weightCol) || $(weightCol).isEmpty) lit(1.0) 
else col($(weightCol))
    +    val w = if (!isDefined(weightCol) || $(weightCol).isEmpty) {
    --- End diff --
    
    The easy way would just be to switch weight to still be a shared param just 
not a codegened one and implement that their.
    
    Another possiblity would be adding a SQLColumn base param type with 
supporting this kind of logic if more than just weight columns could benefit 
from it.


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