Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions src/gradient_boost.rs
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,27 @@ impl GBDT {
predicted
}

/// Compute raw decision scores for the given test data.
///
/// This function returns the unnormalized raw scores (logits) from the gradient boosting model.
/// It does not apply any transformation such as the logistic sigmoid function, allowing the user
/// to interpret the raw values directly. Higher values indicate stronger confidence in the positive class.
///
/// This is similar to `decision_function` in scikit-learn or `BinaryLogisticRaw` in XGBoost.
///
/// # Example
/// ```rust
/// let raw_scores = gbdt.decision_function(&test_data);
/// ```
///
/// # Panic
/// If the number of trained trees does not match the configured iterations, it will panic.
pub fn decision_function(&self, test_data: &DataVec) -> PredVec {
assert_eq!(self.conf.iterations, self.trees.len());
self.predict_n(test_data, 0, self.conf.iterations, test_data.len())
}


/// Predict the given data.
///
/// Note that for log likelyhood loss type, the predicted value will be
Expand Down