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>,
}Fields§
§objective: ModelObjective§feature_names: Vec<String>§feature_infos: Vec<String>BinMapper::info_string per feature.
trees: Vec<Tree>§parameters: Vec<(String, String)>[key: value] lines of the parameters: block.
pandas_categorical: Option<String>The JSON after pandas_categorical: (LightGBM’s Python package stores pandas category levels there).
Implementations§
Source§impl Model
impl Model
Sourcepub fn predict_raw_row(&self, row: &[f64], num_trees: Option<usize>) -> f64
pub fn predict_raw_row(&self, row: &[f64], num_trees: Option<usize>) -> f64
Sum of the leaf values row reaches in the first num_trees trees (all when None).
row holds at least num_features() values; NaN is a missing value.
Sourcepub fn predict(
&self,
matrix: &DenseMatrix<'_>,
raw_score: bool,
num_trees: Option<usize>,
) -> Vec<f64>
pub fn predict( &self, matrix: &DenseMatrix<'_>, raw_score: bool, num_trees: Option<usize>, ) -> Vec<f64>
Predictions for every row, parallel over rows; raw_score = false applies the objective’s transform.
§Panics
When matrix has fewer columns than the model has features.
Sourcepub fn feature_importance(&self, kind: ImportanceType) -> Vec<f64>
pub fn feature_importance(&self, kind: ImportanceType) -> Vec<f64>
LightGBM GBDT::FeatureImportance: per feature, the number of splits (Split) or their summed gain (Gain),
counting only splits with positive gain.
Trait Implementations§
impl StructuralPartialEq for Model
Auto Trait Implementations§
impl Forget for Model
impl Freeze for Model
impl Move for Model
impl RefUnwindSafe for Model
impl Send for Model
impl Sync for Model
impl Unpin for Model
impl UnsafeUnpin for Model
impl UnwindSafe for Model
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more