pub enum Model {
DecisionTreeClassifier(DecisionTreeClassifier),
DecisionTreeRegressor(DecisionTreeRegressor),
RandomForest(RandomForest),
GradientBoostedTrees(GradientBoostedTrees),
}Expand description
Top-level semantic model enum.
This type stays close to the learned structure rather than the fastest possible runtime layout. That is what makes it suitable for introspection, serialization, and exact behavior parity across bindings.
Variants§
DecisionTreeClassifier(DecisionTreeClassifier)
DecisionTreeRegressor(DecisionTreeRegressor)
RandomForest(RandomForest)
GradientBoostedTrees(GradientBoostedTrees)
Implementations§
Source§impl Model
impl Model
pub fn predict_table(&self, table: &dyn TableAccess) -> Vec<f64>
pub fn predict_rows( &self, rows: Vec<Vec<f64>>, ) -> Result<Vec<f64>, PredictError>
pub fn predict_proba_table( &self, table: &dyn TableAccess, ) -> Result<Vec<Vec<f64>>, PredictError>
pub fn predict_proba_rows( &self, rows: Vec<Vec<f64>>, ) -> Result<Vec<Vec<f64>>, PredictError>
pub fn predict_named_columns( &self, columns: BTreeMap<String, Vec<f64>>, ) -> Result<Vec<f64>, PredictError>
pub fn predict_proba_named_columns( &self, columns: BTreeMap<String, Vec<f64>>, ) -> Result<Vec<Vec<f64>>, PredictError>
pub fn predict_sparse_binary_columns( &self, n_rows: usize, n_features: usize, columns: Vec<Vec<usize>>, ) -> Result<Vec<f64>, PredictError>
pub fn predict_proba_sparse_binary_columns( &self, n_rows: usize, n_features: usize, columns: Vec<Vec<usize>>, ) -> Result<Vec<Vec<f64>>, PredictError>
pub fn algorithm(&self) -> TrainAlgorithm
pub fn task(&self) -> Task
pub fn criterion(&self) -> Criterion
pub fn tree_type(&self) -> TreeType
pub fn mean_value(&self) -> Option<f64>
pub fn canaries(&self) -> usize
pub fn max_depth(&self) -> Option<usize>
pub fn min_samples_split(&self) -> Option<usize>
pub fn min_samples_leaf(&self) -> Option<usize>
pub fn n_trees(&self) -> Option<usize>
pub fn max_features(&self) -> Option<usize>
pub fn seed(&self) -> Option<u64>
pub fn compute_oob(&self) -> bool
pub fn oob_score(&self) -> Option<f64>
pub fn learning_rate(&self) -> Option<f64>
pub fn bootstrap(&self) -> bool
pub fn top_gradient_fraction(&self) -> Option<f64>
pub fn other_gradient_fraction(&self) -> Option<f64>
pub fn tree_count(&self) -> usize
pub fn tree_structure( &self, tree_index: usize, ) -> Result<TreeStructureSummary, IntrospectionError>
pub fn tree_prediction_stats( &self, tree_index: usize, ) -> Result<PredictionValueStats, IntrospectionError>
pub fn tree_node( &self, tree_index: usize, node_index: usize, ) -> Result<NodeTreeNode, IntrospectionError>
pub fn tree_level( &self, tree_index: usize, level_index: usize, ) -> Result<ObliviousLevel, IntrospectionError>
pub fn tree_leaf( &self, tree_index: usize, leaf_index: usize, ) -> Result<IndexedLeaf, IntrospectionError>
pub fn to_ir(&self) -> ModelPackageIr
pub fn to_ir_json(&self) -> Result<String, Error>
pub fn to_ir_json_pretty(&self) -> Result<String, Error>
pub fn serialize(&self) -> Result<String, Error>
pub fn serialize_pretty(&self) -> Result<String, Error>
pub fn optimize_inference( &self, physical_cores: Option<usize>, ) -> Result<OptimizedModel, OptimizeError>
pub fn json_schema() -> RootSchema
pub fn json_schema_json() -> Result<String, IrError>
pub fn json_schema_json_pretty() -> Result<String, IrError>
pub fn deserialize(serialized: &str) -> Result<Self, IrError>
pub fn used_feature_indices(&self) -> Vec<usize>
pub fn used_feature_count(&self) -> usize
Trait Implementations§
Auto Trait Implementations§
impl Freeze 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> 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