-
Notifications
You must be signed in to change notification settings - Fork 393
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
Allow copying model instances #270
Conversation
val copy = | ||
new OpWorkflowModel(uid = uid, trainingParams = trainingParams.copy()) | ||
.setFeatures(copyFeatures(resultFeatures)) | ||
.setRawFeatures(copyFeatures(rawFeatures)) |
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.
you shouldnt set the raw features - they should be derived from the features
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.
good point. what if somebody modifies it separately? I dont want to mess up any internal state.
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.
they shouldnt be able to - it is private to op. setting the raw features should never be done directly. In fact the method has no usages maybe we shoudl delete it
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.
Ha ha ha!! Removed it.
Codecov Report
@@ Coverage Diff @@
## master #270 +/- ##
==========================================
+ Coverage 86.38% 86.39% +<.01%
==========================================
Files 318 318
Lines 10447 10458 +11
Branches 321 559 +238
==========================================
+ Hits 9025 9035 +10
- Misses 1422 1423 +1
Continue to review full report at Codecov.
|
Related issues
Currently once the model is loaded it's impossible to reuse the same instance across multiple threads.
Describe the proposed solution
Added
model.copy()
to allow deep copy of model instance so each thread would get it's own instance.