1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//! Optional JSON serialization for fitted transformers (gated on the
//! `serde` feature).
//!
//! Leaf transformers derive `Serialize`/`Deserialize`; use [`save_json`] and
//! [`load_json`] to persist fitted state. [`Pipeline`] and
//! [`ColumnTransformer`] are also serializable via the [`TransformerKind`]
//! enum wrapper.
//!
//! [`Pipeline`]: crate::pipeline::Pipeline
//! [`ColumnTransformer`]: crate::compose::ColumnTransformer
//! [`TransformerKind`]: crate::transformer_kind::TransformerKind
use Path;
use crateResult;
/// Serialize a fitted transformer to a pretty-printed JSON string.
/// Deserialize a transformer from a JSON string.
/// Serialize a fitted transformer and write it to the file at `path`.
///
/// `path` accepts anything implementing [`AsRef<Path>`] (e.g. `&str`, `String`,
/// `&Path`, `PathBuf`).
/// Read a transformer from the JSON file at `path`.
///
/// `path` accepts anything implementing [`AsRef<Path>`] (e.g. `&str`, `String`,
/// `&Path`, `PathBuf`).