[−][src]Struct gbdt::config::Config
The config for the gradient boosting algorithm.
Fields
feature_size: usize
The size of features. Training data and test data should have the same feature size. (default = 1)
max_depth: u32
The max depth of a single decision tree. The root node is considered to be in the layer 0. (default = 2)
iterations: usize
The iterations to train, which is also the number of trees in the gradient boosting algorithm. (default = 2)
shrinkage: ValueType
The learning rate parameter of the gradient boosting algorithm.(default = 1.0)
feature_sample_ratio: f64
Portion of features to be splited. (default = 1.0)
data_sample_ratio: f64
Portion of data to be splited. (default = 1.0)
min_leaf_size: usize
The minimum number of samples required to be at a leaf node during training. (default = 1.0)
loss: Loss
The loss function type. (default = SquareError)
debug: bool
Whether the debug information should be outputed. (default = false)
initial_guess_enabled: bool
Whether initial guess for test data is enabled. (default = false)
training_optimization_level: u8
Training optimization level (default = 2).
0: least memory, slowest speed.
1: more memory usage, faster speed.
2: most memory usage, fastest speed.
Methods
impl Config
[src]
pub fn new() -> Config
[src]
Return a new config with default settings.
Example
use gbdt::config::Config; let mut cfg = Config::new();
pub fn set_feature_size(&mut self, n: usize)
[src]
Set feature size.
Example
use gbdt::config::Config; let mut cfg = Config::new(); cfg.set_feature_size(10);
pub fn set_shrinkage(&mut self, eta: ValueType)
[src]
Set learning rate.
Example
use gbdt::config::Config; let mut cfg = Config::new(); cfg.set_shrinkage(1.0);
pub fn set_training_optimization_level(&mut self, level: u8)
[src]
Set training optimization level (default = 2).
0: least memory, slowest speed.
1: more memory usage, faster speed.
2: most memory usage, fastest speed.
Example
use gbdt::config::Config; let mut cfg = Config::new(); cfg.set_training_optimization_level(2);
pub fn set_max_depth(&mut self, n: u32)
[src]
Set max depth of the tree.
Example
use gbdt::config::Config; let mut cfg = Config::new(); cfg.set_max_depth(5);
pub fn set_iterations(&mut self, n: usize)
[src]
Set iterations of the algorithm.
Example
use gbdt::config::Config; let mut cfg = Config::new(); cfg.set_iterations(5);
pub fn set_feature_sample_ratio(&mut self, n: f64)
[src]
Set feature sample ratio.
Example
use gbdt::config::Config; let mut cfg = Config::new(); cfg.set_feature_sample_ratio(0.9);
pub fn set_data_sample_ratio(&mut self, n: f64)
[src]
Set data sample ratio.
Example
use gbdt::config::Config; let mut cfg = Config::new(); cfg.set_data_sample_ratio(0.9);
pub fn set_min_leaf_size(&mut self, n: usize)
[src]
Set minimal leaf size.
Example
use gbdt::config::Config; let mut cfg = Config::new(); cfg.set_min_leaf_size(3);
pub fn set_loss(&mut self, l: &str)
[src]
Set loss type: "SquaredError", "LogLikelyhood", "LAD", "reg:linear", "binary:logistic", "reg:logistic", "binary:logitraw", "multi:softprob", "multi:softmax", "rank:pairwise"
Example
use gbdt::config::{Config, Loss, loss2string}; let mut cfg = Config::new(); cfg.set_loss("LAD"); // Alternative way cfg.set_loss(&loss2string(&Loss::SquaredError));
pub fn set_debug(&mut self, option: bool)
[src]
pub fn enabled_initial_guess(&mut self, option: bool)
[src]
Set whether initial guess of test data is enabled.
Example
use gbdt::config::Config; let mut cfg = Config::new(); cfg.enabled_initial_guess(false);
pub fn to_string(&self) -> String
[src]
Dump the config to string for presentation.
Example
use gbdt::config::Config; let mut cfg = Config::new(); println!("{}", cfg.to_string());
Trait Implementations
impl Clone for Config
[src]
fn clone(&self) -> Config
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Default for Config
[src]
impl Serialize for Config
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<'de> Deserialize<'de> for Config
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,