-
Notifications
You must be signed in to change notification settings - Fork 1.9k
ITransformer derives from ICanSaveModel and explicit implementation for ICanSaveModel #2431
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
Conversation
1850a8a
to
5fd88bf
Compare
src/Microsoft.ML.FastTree/TreeEnsemble/InternalQuantileRegressionTree.cs
Show resolved
Hide resolved
Looks mostly good @artidoro except for one or two unnecessary internalizations. Do we have though a handle on why these |
Thank you very much for taking a look Tom! I am resolving your comments, and de-WIPing. Will look into the test failures afterwards. In reply to: 461297633 [](ancestors = 461297633) |
Codecov Report
@@ Coverage Diff @@
## master #2431 +/- ##
==========================================
- Coverage 71.23% 71.21% -0.02%
==========================================
Files 786 786
Lines 140989 141003 +14
Branches 16114 16114
==========================================
- Hits 100427 100416 -11
- Misses 36091 36118 +27
+ Partials 4471 4469 -2
|
test/Microsoft.ML.CodeAnalyzer.Tests/Helpers/DiagnosticVerifier.cs
Outdated
Show resolved
Hide resolved
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.
Fixes #2336.
This PR makes
ITransformer
derive fromICanSaveModel
. The reasons for changing the coreITransformer/IEstimator/IDataView
API are illustrated in more detail in the issue #2336. But this essentially captures the idea that once trained the model should be savable.For this change I moved
ICanSaveModel, ModelSaveContext, ModelLoadContext
and a few related utility files to Microsoft.ML.Core asITransformer
lives in that assembly.The second dimension of this change is the explicit implementation of the interface
ICanSaveModel
everywhere. This will make it a requirement to cast the classes toICanSaveModel
in order to access the methodSave(ModelSaveContext ctx)
so that it is less visible. I have covered the entire code base with my changes, including some classes that are internal and others that I think should be made internal shortly. This makes my change touch ~140 files. I decided to do so in order to make the way we implement theICanSaveModel
interface consistent everywhere.