HalvingRandomSearchCV

Struct HalvingRandomSearchCV 

Source
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: ParameterDistributions

Parameter distributions to sample from

§n_candidates: usize

Number of parameter settings that are sampled

§cv: Box<dyn CrossValidator>

Cross-validation strategy

§scoring: Scoring

Scoring function

§factor: f64

The ‘halving’ parameter, which determines the proportion of candidates that are selected for each subsequent iteration

§resource: String

The 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: bool

Whether 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

Source

pub fn new(param_distributions: ParameterDistributions) -> Self

Source

pub fn n_candidates(self, n_candidates: usize) -> Self

Set the number of candidates to sample

Source

pub fn factor(self, factor: f64) -> Self

Set the halving factor

Source

pub fn cv(self, cv: Box<dyn CrossValidator>) -> Self

Set the cross-validation strategy

Source

pub fn scoring(self, scoring: Scoring) -> Self

Set the scoring function

Source

pub fn resource(self, resource: String) -> Self

Set the resource parameter

Source

pub fn max_resource(self, max_resource: usize) -> Self

Set the maximum resource

Source

pub fn min_resource(self, min_resource: usize) -> Self

Set the minimum resource

Source

pub fn aggressive_elimination(self, aggressive_elimination: bool) -> Self

Set aggressive elimination strategy

Source

pub fn random_state(self, random_state: u64) -> Self

Set the random state

Source

pub fn n_jobs(self, n_jobs: i32) -> Self

Set the number of parallel jobs

Source

pub fn fit_regression<E, F>( &self, base_estimator: E, x: &Array2<f64>, y: &Array1<f64>, ) -> Result<HalvingGridSearchResults>
where E: Estimator + Clone + Fit<Array2<f64>, Array1<f64>, Fitted = F>, F: Predict<Array2<f64>, Array1<f64>>,

Fit the halving random search for regression

Source

pub fn fit_classification<E, F>( &self, base_estimator: E, x: &Array2<f64>, y: &Array1<i32>, ) -> Result<HalvingGridSearchResults>
where E: Estimator + Clone + Fit<Array2<f64>, Array1<i32>, Fitted = F>, F: Predict<Array2<f64>, Array1<i32>>,

Fit the halving random search for classification

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V