pub struct Control {
pub minimal_relative_segment_length: f64,
pub minimal_gain_to_split: Option<f64>,
pub model_selection_alpha: f64,
pub model_selection_n_permutations: usize,
pub number_of_wild_segments: usize,
pub seeded_segments_alpha: f64,
pub seed: u64,
pub random_forest_parameters: RandomForestParameters,
pub forbidden_segments: Option<Vec<(usize, usize)>>,
}
Expand description
Storage container for hyperparameters.
Fields§
§minimal_relative_segment_length: f64
Segments with length smaller than 2 * n * minimal_relative_segment_length
will
not be split.
minimal_gain_to_split: Option<f64>
Only keep split point if the gain exceeds minimal_gain_to_split
. Relevant for
change in mean. Note that this is relative to the number of observations.
Use value motivated by BIC minimal_gain_to_split = log(n_samples) * n_features / n_samples
if None
.
model_selection_alpha: f64
Type two error in model selection to be approximated. Relevant for classifier- based changepoint detection.
model_selection_n_permutations: usize
Number of permutations for model selection in classifier-based change point detection.
number_of_wild_segments: usize
Number of randomly drawn segments. Corresponds to parameter M
in
https://arxiv.org/pdf/1411.0858.pdf.
seeded_segments_alpha: f64
Decay parameter in seeded binary segmentation. Should be in [1/2, 1)
, with a
value close to 1 resulting in many segments. Corresponds to \alpha
in
https://arxiv.org/pdf/2002.06633.pdf.
seed: u64
Seed used for segmentation.
random_forest_parameters: RandomForestParameters
Hyperparameters for random forests.
forbidden_segments: Option<Vec<(usize, usize)>>
Segments of indexes were no segmentation is allowed.
Implementations§
Source§impl Control
impl Control
pub fn default() -> Control
pub fn with_minimal_relative_segment_length( self, minimal_relative_segment_length: f64, ) -> Self
pub fn with_minimal_gain_to_split( self, minimal_gain_to_split: Option<f64>, ) -> Self
pub fn with_model_selection_alpha(self, model_selection_alpha: f64) -> Self
pub fn with_model_selection_n_permutations( self, model_selection_n_permutations: usize, ) -> Self
pub fn with_number_of_wild_segments( self, number_of_wild_segments: usize, ) -> Self
pub fn with_seeded_segments_alpha(self, seeded_segments_alpha: f64) -> Self
pub fn with_seed(self, seed: u64) -> Self
pub fn with_random_forest_parameters( self, random_forest_parameters: RandomForestParameters, ) -> Self
pub fn with_forbidden_segments( self, forbidden_segments: Option<Vec<(usize, usize)>>, ) -> Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Control
impl RefUnwindSafe for Control
impl Send for Control
impl Sync for Control
impl Unpin for Control
impl UnwindSafe for Control
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
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>
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>
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