Github user sethah commented on the pull request:
https://github.com/apache/spark/pull/8675#issuecomment-140489654
@feynmanliang One thing I'm curious about is if this would still be a
problem if all the constructors were private to ml? Right now, GBTs are the
only one of the `PredictionModel` subclasses that is not designated as
`private[ml]`, and I'm not exactly sure why it isn't. Other constructors are
not public. This is important because it makes the most sense to pass this
value as a constructor argument when it can't be inferred (i.e. for tree based
predictors). The number of features must be passed, in this case, when the
model is created (when the estimator that created it is trained). If I
understand correctly, using a trait would require the value to be set after the
model is created, but that doesn't make a ton of sense since the `numFeatures`
for a given model should never change (should be a val). I believe this is why
the only model that currently stores `numFeatures` (RF) passes it through the
constructor.
If we can make the GBT models private, then would it be permissible to
change the constructors? Open to suggestions...
---
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]