Skip to content

Commit 3843b07

Browse files
authored
Fix/inplace (#113)
* deepcopying the given ML model to prevent further ML model manipulation * `CHANGELOG.md` updated * Update CHANGELOG.md
1 parent 6c24819 commit 3843b07

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
77
## [Unreleased]
88
### Added
99
### Changed
10+
- `Export` class call by reference bug fixed
1011
## [0.9] - 2024-07-01
1112
### Added
1213
- Anaconda workflow
@@ -260,4 +261,4 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
260261
[0.4]: https://github.com/openscilab/pymilo/compare/v0.3...v0.4
261262
[0.3]: https://github.com/openscilab/pymilo/compare/v0.2...v0.3
262263
[0.2]: https://github.com/openscilab/pymilo/compare/v0.1...v0.2
263-
[0.1]: https://github.com/openscilab/pymilo/compare/e887108...v0.1
264+
[0.1]: https://github.com/openscilab/pymilo/compare/e887108...v0.1

pymilo/pymilo_obj.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from .exceptions.serialize_exception import PymiloSerializationException, SerializationErrorTypes
1010
from traceback import format_exc
1111
from warnings import warn
12+
from copy import deepcopy
1213

1314

1415
class Export:
@@ -28,7 +29,7 @@ def __init__(self, model):
2829
:type model: any class of the sklearn's linear models
2930
:return: an instance of the Pymilo Export class
3031
"""
31-
self.data = get_sklearn_data(model)
32+
self.data = get_sklearn_data(deepcopy(model))
3233
self.version = get_sklearn_version()
3334
self.type = get_sklearn_type(model)
3435

0 commit comments

Comments
 (0)