pub struct HalvingRandomSearchCV {
pub param_distributions: ParameterDistributions,
pub n_candidates: usize,
pub cv: Box<dyn CrossValidator>,
pub scoring: Scoring,
pub factor: f64,
pub resource: String,
pub max_resource: Option<usize>,
pub min_resource: Option<usize>,
pub aggressive_elimination: bool,
pub random_state: Option<u64>,
pub n_jobs: Option<i32>,
}Expand description
Randomized search with successive halving for efficient hyperparameter optimization
HalvingRandomSearchCV is similar to HalvingGridSearch but samples parameter values randomly from distributions, making it more efficient for continuous parameter spaces.
Fields§
§param_distributions: ParameterDistributionsParameter distributions to sample from
n_candidates: usizeNumber of parameter settings that are sampled
cv: Box<dyn CrossValidator>Cross-validation strategy
scoring: ScoringScoring function
factor: f64The ‘halving’ parameter, which determines the proportion of candidates that are selected for each subsequent iteration
resource: StringThe amount of resource that gets allocated to each candidate at the first iteration
max_resource: Option<usize>The maximum amount of resource that any candidate can be allocated
min_resource: Option<usize>The minimum amount of resource that any candidate can be allocated
aggressive_elimination: boolWhether to use aggressive elimination strategy in the first iteration
random_state: Option<u64>Random state for reproducible results
n_jobs: Option<i32>Number of jobs for parallel execution
Implementations§
Source§impl HalvingRandomSearchCV
impl HalvingRandomSearchCV
pub fn new(param_distributions: ParameterDistributions) -> Self
Sourcepub fn n_candidates(self, n_candidates: usize) -> Self
pub fn n_candidates(self, n_candidates: usize) -> Self
Set the number of candidates to sample
Sourcepub fn cv(self, cv: Box<dyn CrossValidator>) -> Self
pub fn cv(self, cv: Box<dyn CrossValidator>) -> Self
Set the cross-validation strategy
Sourcepub fn max_resource(self, max_resource: usize) -> Self
pub fn max_resource(self, max_resource: usize) -> Self
Set the maximum resource
Sourcepub fn min_resource(self, min_resource: usize) -> Self
pub fn min_resource(self, min_resource: usize) -> Self
Set the minimum resource
Sourcepub fn aggressive_elimination(self, aggressive_elimination: bool) -> Self
pub fn aggressive_elimination(self, aggressive_elimination: bool) -> Self
Set aggressive elimination strategy
Sourcepub fn random_state(self, random_state: u64) -> Self
pub fn random_state(self, random_state: u64) -> Self
Set the random state
Sourcepub fn fit_regression<E, F>(
&self,
base_estimator: E,
x: &Array2<f64>,
y: &Array1<f64>,
) -> Result<HalvingGridSearchResults>
pub fn fit_regression<E, F>( &self, base_estimator: E, x: &Array2<f64>, y: &Array1<f64>, ) -> Result<HalvingGridSearchResults>
Fit the halving random search for regression
Auto Trait Implementations§
impl Freeze for HalvingRandomSearchCV
impl !RefUnwindSafe for HalvingRandomSearchCV
impl Send for HalvingRandomSearchCV
impl Sync for HalvingRandomSearchCV
impl Unpin for HalvingRandomSearchCV
impl !UnwindSafe for HalvingRandomSearchCV
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> 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