Struct rustrees::DecisionTree
source · pub struct DecisionTree { /* private fields */ }Expand description
Represents the decision tree model. Each node represents a split on a feature.
Implementations§
source§impl DecisionTree
impl DecisionTree
Methods for training and predicting with a decision tree. These methods are exposed to python.
sourcepub fn train_reg(
train: &Dataset,
max_depth: Option<i32>,
min_samples_leaf: Option<i32>,
max_features: Option<i32>,
random_state: Option<u64>
) -> DecisionTree
pub fn train_reg( train: &Dataset, max_depth: Option<i32>, min_samples_leaf: Option<i32>, max_features: Option<i32>, random_state: Option<u64> ) -> DecisionTree
Trains a decision tree for regression. A regression tree uses the mean squared error as the split criterion.
Trait Implementations§
source§impl PyClassImpl for DecisionTree
impl PyClassImpl for DecisionTree
source§const DOC: &'static str = "Represents the decision tree model. Each node represents a split on a feature.\u{0}"
const DOC: &'static str = "Represents the decision tree model. Each node represents a split on a feature.\u{0}"
Class doc string
source§const IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
#[pyclass(subclass)]
source§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
#[pyclass(extends=…)]
source§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
#[pyclass(mapping)]
source§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
#[pyclass(sequence)]
§type Layout = PyCell<DecisionTree>
type Layout = PyCell<DecisionTree>
Layout
§type ThreadChecker = ThreadCheckerStub<DecisionTree>
type ThreadChecker = ThreadCheckerStub<DecisionTree>
This handles following two situations: Read more
§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
Immutable or mutable
§type BaseNativeType = PyAny
type BaseNativeType = PyAny
The closest native ancestor. This is
PyAny by default, and when you declare
#[pyclass(extends=PyDict)], it’s PyDict.fn items_iter() -> PyClassItemsIter
fn lazy_type_object() -> &'static LazyTypeObject<Self>
fn dict_offset() -> Option<isize>
fn weaklist_offset() -> Option<isize>
source§impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a DecisionTree
impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a DecisionTree
source§impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a mut DecisionTree
impl<'a, 'py> PyFunctionArgument<'a, 'py> for &'a mut DecisionTree
source§impl PyMethods<DecisionTree> for PyClassImplCollector<DecisionTree>
impl PyMethods<DecisionTree> for PyClassImplCollector<DecisionTree>
fn py_methods(self) -> &'static PyClassItems
source§impl PyTypeInfo for DecisionTree
impl PyTypeInfo for DecisionTree
§type AsRefTarget = PyCell<DecisionTree>
type AsRefTarget = PyCell<DecisionTree>
Utility type to make Py::as_ref work.
source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
Returns the PyTypeObject instance for this type.
source§fn type_object(py: Python<'_>) -> &PyType
fn type_object(py: Python<'_>) -> &PyType
Returns the safe abstraction over the type object.
source§fn is_type_of(object: &PyAny) -> bool
fn is_type_of(object: &PyAny) -> bool
Checks if
object is an instance of this type or a subclass of this type.source§fn is_exact_type_of(object: &PyAny) -> bool
fn is_exact_type_of(object: &PyAny) -> bool
Checks if
object is an instance of this type.Auto Trait Implementations§
impl RefUnwindSafe for DecisionTree
impl Send for DecisionTree
impl Sync for DecisionTree
impl Unpin for DecisionTree
impl UnwindSafe for DecisionTree
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