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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
//!
//! # Feature Flags
//!
//! - **`serde`** (enabled by default): Enables serialization and deserialization support for all model types
//! using the [`serde`](https://serde.rs/) framework. This is useful for:
//! - Saving trained models to disk
//! - Loading pre-trained models for deployment
//! - Sharing models between applications
//! - Checkpointing during long-running processes
//!
//! To disable serialization support (e.g., for minimal dependencies), use:
//! ```toml
//! [dependencies]
//! libspot-rs = { version = "0.2", default-features = false }
//! ```
//!
//! ## Example with Serialization
//!
//! ```toml
//! [dependencies]
//! libspot-rs = { version = "0.2" } # serde is enabled by default
//! serde_json = "1.0"
//! ```
//!
//! ```ignore
//! use libspot_rs::{SpotConfig, SpotDetector};
//! use serde_json;
//!
//! // Train a model
//! let config = SpotConfig::default();
//! let mut spot = SpotDetector::new(config).unwrap();
//! let training_data: Vec<f64> = (0..1000).map(|i| i as f64 / 100.0).collect();
//! spot.fit(&training_data).unwrap();
//!
//! // Serialize to JSON (serde is enabled by default)
//! let json = serde_json::to_string(&spot).unwrap();
//!
//! // Save to file
//! std::fs::write("model.json", &json).unwrap();
//!
//! // Later, load and continue using
//! let json = std::fs::read_to_string("model.json").unwrap();
//! let mut loaded: SpotDetector = serde_json::from_str(&json).unwrap();
//! let status = loaded.step(50.0);
//! ```
// Re-export public types
pub use SpotConfig;
pub use ;
pub use Peaks;
pub use SpotDetector;
pub use SpotStatus;
pub use Tail;
pub use Ubend;
// Re-export commonly used types to match libspot crate
pub use f64 as SpotFloat;
/// Get the version of the pure Rust libspot implementation