-
Notifications
You must be signed in to change notification settings - Fork 838
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: companionModelClassName no longer returns generic type variable #2195
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2195 +/- ##
==========================================
- Coverage 85.91% 83.59% -2.33%
==========================================
Files 329 329
Lines 17086 17089 +3
Branches 1515 1523 +8
==========================================
- Hits 14680 14285 -395
- Misses 2406 2804 +398 ☔ View full report in Codecov by Sentry. |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
override val uid: String = "test" | ||
} | ||
|
||
private[codegen] class TestRegressor extends Regressor[Vector, TestRegressor, TestRegressorModel] with Wrappable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will this end up in the python bindings?
This commit addresses an issue in the companionModelClassName method where the resolution of the companion model's class name was not accurately reflecting the intended Python package path for Regression models.
"from M import M", where M is the name of MLLib's
Regressor
class' concrete model type parameter:https://github.com/apache/spark/blob/45ba9224602eb18fe45e339cbb8cf2e8a4924f0b/mllib/src/main/scala/org/apache/spark/ml/regression/Regressor.scala#L28
Implemented reflection with scala.reflect.runtime.universe._ to accurately access and utilize type information at runtime, overcoming Scala's type erasure limitations.
Tested against the existing method for all wrappable classes and found the only divergence to be the instance where it fixed the broken wrapped regressor. Added a regression test for this scenario.