Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e0f0c7f

Browse filesBrowse files
rthogrisel
andauthored
DOC Fix documentation on pickle portability (#19561)
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
1 parent 94abe05 commit e0f0c7f
Copy full SHA for e0f0c7f

File tree

1 file changed

+9
-10
lines changed
Filter options

1 file changed

+9
-10
lines changed

‎doc/modules/model_persistence.rst

Copy file name to clipboardExpand all lines: doc/modules/model_persistence.rst
+9-10Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ Security & maintainability limitations
5959
pickle (and joblib by extension), has some issues regarding maintainability
6060
and security. Because of this,
6161

62-
* Never unpickle untrusted data as it could lead to malicious code being
62+
* Never unpickle untrusted data as it could lead to malicious code being
6363
executed upon loading.
64-
* While models saved using one version of scikit-learn might load in
65-
other versions, this is entirely unsupported and inadvisable. It should
64+
* While models saved using one version of scikit-learn might load in
65+
other versions, this is entirely unsupported and inadvisable. It should
6666
also be kept in mind that operations performed on such data could give
6767
different and unexpected results.
6868

@@ -77,12 +77,11 @@ additional metadata should be saved along the pickled model:
7777
This should make it possible to check that the cross-validation score is in the
7878
same range as before.
7979

80-
Since a model internal representation may be different on two different
81-
architectures, dumping a model on one architecture and loading it on
82-
another architecture is not a supported behaviour, even if it might work
83-
on some cases.
84-
To overcome the issue of portability, pickle models are often deployed in
85-
production using containers, like docker.
80+
Aside for a few exceptions, pickled models should be portable across
81+
architectures assuming the same versions of dependencies and Python are used.
82+
If you encounter an estimator that is not portable please open an issue on
83+
GitHub. Pickled models are often deployed in production using containers, like
84+
Docker, in order to freeze the environment and dependencies.
8685

8786
If you want to know more about these issues and explore other possible
8887
serialization methods, please refer to this
@@ -108,7 +107,7 @@ models between different machine learning frameworks, and to improve their
108107
portability on different computing architectures. More details are available
109108
from the `ONNX tutorial <https://onnx.ai/get-started.html>`_.
110109
To convert scikit-learn model to ONNX a specific tool `sklearn-onnx
111-
<http://onnx.ai/sklearn-onnx/>`_ has been developed.
110+
<http://onnx.ai/sklearn-onnx/>`_ has been developed.
112111

113112
PMML is an implementation of the `XML
114113
<https://en.wikipedia.org/wiki/XML>`_ document standard

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.