mod predict;
mod text;
use crate::tree::Tree;
#[derive(Debug, Clone, PartialEq)]
pub enum ModelObjective {
Regression,
Binary {
sigmoid: f64,
},
LambdaRank,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum ImportanceType {
Split,
Gain,
}
#[derive(Debug, Clone, PartialEq)]
pub struct Model {
pub objective: ModelObjective,
pub feature_names: Vec<String>,
pub feature_infos: Vec<String>,
pub trees: Vec<Tree>,
pub parameters: Vec<(String, String)>,
pub pandas_categorical: Option<String>,
}
impl Model {
pub fn num_features(&self) -> usize {
self.feature_names.len()
}
pub fn num_trees(&self) -> usize {
self.trees.len()
}
}