Github user zhengruifeng commented on the issue: https://github.com/apache/spark/pull/16457 Agreed. Now five algs inherit `HasWeightCol`: GLR/LoR/LiR/NB/IsotonicReg I found that some algs use `RDD[Instance]` in `train` : GLR/LoR/LiR ``` val instances: RDD[Instance] = dataset.select(col($(labelCol)), w, col($(featuresCol))).rdd.map { case Row(label: Double, weight: Double, features: Vector) => Instance(label, weight, features) } ``` NB can also be modified to start with `RDD[Instance]`. We can create a new API `extractInstance` in `Predictor` and validate weight in it, like the way that we check `label` in `extractLabeledPoints(dataset: Dataset[_], numClasses: Int)` in `Classifier`. For IsotonicReg, we add a validatation in `extractWeightedLabeledPoints`. What about this plan? @srowen @sethah @jkbradley
--- 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