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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
//! # Perpetual
//!
//! `perpetual` is a high-performance, self-generalizing Gradient Boosting Machine (GBM) written in Rust.
//!
//! Unlike traditional GBMs (like XGBoost, LightGBM, CatBoost) that require extensive hyperparameter tuning
//! (learning rate, tree depth, number of leaves, L1/L2 regularization, etc.), Perpetual introduces a
//! novel **Budget**-based hyperparameter `budget`.
//!
//! The `budget` parameter controls the complexity of the model. A higher budget allows the model to
//! learn more complex patterns (more trees, deeper interactions), while a lower budget keeps the model
//! simple and robust. The algorithm automatically adjusts its internal learning rate and structure
//! based on this single parameter.
//!
//! ## Key Features
//!
//! * **Self-Generalizing**: Minimizes the need for hyperparameter tuning. The `budget` parameter is often sufficient.
//! * **High Performance**: Parallelized training and prediction using [Rayon](https://docs.rs/rayon).
//! * **Zero-Copy Data**: Efficiently handles data layouts with `ColumnarMatrix`, ideal for use with arrow or polars.
//! * **Versatile Objectives**: Supports Regression (Squared, Huber, Absolute, Quantile, Poisson, Gamma, Tweedie, Mape), Classification (LogLoss, BrierLoss, HingeLoss), and Learning-to-Rank (ListNet).
//! * **Production Ready**: Handles missing values natively, supports monotonic constraints, and provides prediction intervals (conformal prediction).
//!
//! ## Quick Start
//!
//! ```rust
//! use perpetual::PerpetualBooster;
//! use perpetual::objective::Objective;
//! use perpetual::Matrix;
//! use perpetual::booster::config::MissingNodeTreatment;
//! use std::collections::{HashSet, HashMap};
//!
//! // 1. Prepare Data
//! let data_vec = vec![
//! 1.0, 2.0, // Row 1
//! 3.0, 4.0, // Row 2
//! 5.0, 6.0 // Row 3
//! ];
//! let matrix = Matrix::new(&data_vec, 3, 2); // 3 rows, 2 columns
//! let target = vec![0.0, 1.0, 0.0];
//!
//! // 2. Configure and Initialize Booster
//! // Most parameters can be left to defaults/None, but 'budget' and 'objective' are key.
//! let budget = 1.0;
//! let objective = Objective::LogLoss;
//!
//! let mut model = PerpetualBooster::new(
//! objective,
//! budget,
//! f64::NAN, // base_score (NAN = auto-calculated)
//! 255, // max_bin
//! None, // num_threads (None = all cores)
//! None, // monotone_constraints
//! None, // interaction_constraints
//! false, // force_children_to_bound_parent
//! f64::NAN, // missing value representation
//! true, // allow_missing_splits
//! true, // create_missing_branch
//! HashSet::new(), // terminate_missing_features
//! MissingNodeTreatment::AverageNodeWeight,
//! 10, // log_iterations
//! 42, // seed
//! None, // reset
//! None, // categorical_features
//! None, // timeout
//! None, // iteration_limit
//! None, // memory_limit
//! None, // stopping_rounds
//! false, // save_node_stats
//! ).expect("Failed to initialize booster");
//!
//! // 3. Fit the Model
//! model.fit(&matrix, &target, None, None).expect("Training failed");
//!
//! // 4. Predict
//! let predictions = model.predict(&matrix, false);
//! println!("Predictions: {:?}", predictions);
//! ```
//!
//! ### Alternative Initialization
//!
//! You can also initialize the booster using the `Default` trait and configure it with setters:
//!
//! ```rust
//! use perpetual::PerpetualBooster;
//! use perpetual::objective::Objective;
//!
//! let mut model = PerpetualBooster::default()
//! .set_objective(Objective::LogLoss)
//! .set_budget(1.0)
//! .set_seed(42);
//! ```
// Modules
// Individual classes, and functions
pub use ;
pub use PerpetualBooster;
pub use MultiOutputBooster;
pub use ;