Skip to main content

dtrees_rs/algorithms/common/
config.rs

1use serde::{Deserialize, Serialize};
2
3/// Settings shared by every search.
4#[derive(Copy, Clone, Debug, Serialize, Deserialize)]
5pub struct BaseSearchConfig {
6    /// Minimum number of instances in each leaf.
7    pub min_support: usize,
8    /// Maximum depth of the tree.
9    pub max_depth: usize,
10    /// Only trees with a lower error are accepted.
11    pub max_error: f64,
12    /// Time limit in seconds.
13    pub max_time: f64,
14}
15
16impl Default for BaseSearchConfig {
17    fn default() -> Self {
18        Self {
19            min_support: 1,
20            max_depth: 1,
21            max_error: f64::INFINITY,
22            max_time: f64::INFINITY,
23        }
24    }
25}