pub struct ParallelUtils;Expand description
Parallel utilities for tree algorithms
Implementations§
Source§impl ParallelUtils
impl ParallelUtils
Sourcepub fn maybe_parallel_map<T, U, F>(items: Vec<T>, f: F) -> Vec<U>where
F: Fn(T) -> U,
pub fn maybe_parallel_map<T, U, F>(items: Vec<T>, f: F) -> Vec<U>where
F: Fn(T) -> U,
Execute a function sequentially if parallel feature is disabled
Sourcepub fn parallel_bootstrap_samples(
x: &Array2<f64>,
y: &Array1<i32>,
n_estimators: usize,
n_samples: usize,
random_seeds: &[u64],
) -> Vec<(Array2<f64>, Array1<i32>)>
pub fn parallel_bootstrap_samples( x: &Array2<f64>, y: &Array1<i32>, n_estimators: usize, n_samples: usize, random_seeds: &[u64], ) -> Vec<(Array2<f64>, Array1<i32>)>
Sequential bootstrap sampling fallback
Sourcepub fn parallel_predict_proba_aggregate(
predictions: Vec<Array2<f64>>,
) -> Result<Array2<f64>>
pub fn parallel_predict_proba_aggregate( predictions: Vec<Array2<f64>>, ) -> Result<Array2<f64>>
Sequential prediction aggregation fallback
Sourcepub fn parallel_permutation_importance<F>(
x: &Array2<f64>,
y: &Array1<i32>,
baseline_score: f64,
scoring_fn: F,
n_repeats: usize,
random_seeds: &[u64],
) -> Result<Array1<f64>>
pub fn parallel_permutation_importance<F>( x: &Array2<f64>, y: &Array1<i32>, baseline_score: f64, scoring_fn: F, n_repeats: usize, random_seeds: &[u64], ) -> Result<Array1<f64>>
Sequential feature importance calculation fallback
Sourcepub fn optimal_n_threads(n_jobs: Option<i32>) -> usize
pub fn optimal_n_threads(n_jobs: Option<i32>) -> usize
Determine optimal number of threads to use
Sourcepub fn with_thread_pool<T, F>(n_threads: usize, f: F) -> Twhere
F: FnOnce() -> T,
pub fn with_thread_pool<T, F>(n_threads: usize, f: F) -> Twhere
F: FnOnce() -> T,
Sequential execution fallback
Sourcepub fn parallel_find_best_split(
x: &Array2<f64>,
y: &Array1<f64>,
sample_indices: &[usize],
config: &ParallelFeatureConfig,
) -> Result<Option<FeatureSplit>>
pub fn parallel_find_best_split( x: &Array2<f64>, y: &Array1<f64>, sample_indices: &[usize], config: &ParallelFeatureConfig, ) -> Result<Option<FeatureSplit>>
Sequential fallback for finding best split
Sourcepub fn parallel_find_best_classification_split(
x: &Array2<f64>,
y: &Array1<i32>,
sample_indices: &[usize],
n_classes: usize,
config: &ParallelFeatureConfig,
) -> Result<Option<FeatureSplit>>
pub fn parallel_find_best_classification_split( x: &Array2<f64>, y: &Array1<i32>, sample_indices: &[usize], n_classes: usize, config: &ParallelFeatureConfig, ) -> Result<Option<FeatureSplit>>
Sequential fallback for classification splits
Sourcepub fn parallel_compute_feature_stats(
x: &Array2<f64>,
sample_indices: &[usize],
feature_indices: &[usize],
) -> Vec<FeatureStats>
pub fn parallel_compute_feature_stats( x: &Array2<f64>, sample_indices: &[usize], feature_indices: &[usize], ) -> Vec<FeatureStats>
Sequential fallback for feature statistics
Auto Trait Implementations§
impl Freeze for ParallelUtils
impl RefUnwindSafe for ParallelUtils
impl Send for ParallelUtils
impl Sync for ParallelUtils
impl Unpin for ParallelUtils
impl UnwindSafe for ParallelUtils
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> 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