Shrinkage

shrinkage::CoordinateDescent

Shrinkage for Rust · rust · 0.3.0

pub struct CoordinateDescent

Cyclic coordinate descent settings for Gaussian lasso.

Full convergence checks run at initialization, after every ten sweeps over the current working set, and at the iteration limit. Each check refreshes the residuals and updates the working set; individual sweeps do not perform restricted KKT checks.

Inherent implementation

impl CoordinateDescent

max_iterations

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

Set the maximum number of sweeps over the current working set, checked when fitting.

new

pub fn new() -> Self

Use a relative duality-gap tolerance of 1e-6 and at most 10,000 sweeps. Zero-penalty problems use the lasso's absolute KKT default instead.

screening

pub fn screening(self, enabled: bool) -> Self

Enable Gap Safe screening in paths. Disabled at zero penalty. Single fits do not construct screening certificates.

terminate_on

pub fn terminate_on(self, criterion: StoppingCriterion) -> Self

Select a stopping criterion with its own tolerances.

tolerance

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

Set the absolute KKT tolerance, checked when fitting.

working_set_policy

pub fn working_set_policy(self, policy: WorkingSetPolicy) -> Self

Select the working-set policy for single fits and paths.

working_sets

pub fn working_sets(self, enabled: bool) -> Self

Enable automatic working sets, or disable heuristic restrictions. The last working-set setter wins.

Implementation of Clone

impl Clone for CoordinateDescent

clone

fn clone(&self) -> Self

Implementation of Copy

impl Copy for CoordinateDescent

Implementation of Debug

impl Debug for CoordinateDescent

fmt

fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result

Implementation of Default

impl Default for CoordinateDescent

default

fn default() -> Self

Implementation of ObservedSolver

impl<M> ObservedSolver<Problem<&M, Gaussian<'_>, L1>> for CoordinateDescent where M: RawColumns<f64> + ColumnStats<f64> + ?Sized

solve_from_with_observer

fn solve_from_with_observer<O: SolverObserver + ?Sized>(
    &self,
    problem: &Problem<&M, Gaussian<'_>, L1>,
    initial: Option<shrinkage::InitialPoint<'_>>,
    observer: &mut O
) -> Result<<Self as Solver>::Fit, <Self as Solver>::Error>

Implementation of PathSolver

impl<D, P, Q> PathSolver<Problem<Box<dyn RuntimeDesign + '_>, D, P>, Q> for shrinkage::CoordinateDescent where D: shrinkage::SmoothDatafit, Q: shrinkage::ProximalPenalty

Error

type Error = FitError<BackendError>;

Fit

type Fit = LassoFit;

solve_path

fn solve_path(
    &self,
    _problem: &Problem<Box<dyn shrinkage::RuntimeDesign + '_>, D, P>,
    _penalties: Vec<Q>
) -> Result<PathFit<LassoFit, Q>, <Self as PathSolver>::Error>

Implementation of PathSolver

impl<M, P> PathSolver<Problem<&M, Gaussian<'_>, P>, L1> for shrinkage::CoordinateDescent where M: RawColumns<f64> + ColumnStats<f64> + ?Sized

Error

type Error = FitError<<M as MatrixErrorType>::Error>;

Fit

type Fit = LassoFit;

solve_path

fn solve_path(
    &self,
    problem: &Problem<&M, Gaussian<'_>, P>,
    penalties: Vec<L1>
) -> Result<PathFit<LassoFit, L1>, <Self as PathSolver>::Error>

Implementation of RegularizationPathSolver

impl<D, P> RegularizationPathSolver<Problem<Box<dyn RuntimeDesign + '_>, D, P>> for shrinkage::CoordinateDescent where D: shrinkage::SmoothDatafit + NullModelDatafit, P: PathPenalty

Error

type Error = FitError<BackendError>;

Fit

type Fit = LassoFit;

Penalty

type Penalty = <P as PathPenalty>::AtStrength;

maximum_penalty

fn maximum_penalty(
    &self,
    _problem: &Problem<Box<dyn shrinkage::RuntimeDesign + '_>, D, P>
) -> Result<PenaltyMaximum, <Self as RegularizationPathSolver>::Error>

solve_regularization_path

fn solve_regularization_path(
    &self,
    _problem: &Problem<Box<dyn shrinkage::RuntimeDesign + '_>, D, P>,
    _options: &PathOptions
) -> Result<PathFit<LassoFit, <P as PathPenalty>::AtStrength>, <Self as RegularizationPathSolver>::Error>

Implementation of RegularizationPathSolver

impl<M> RegularizationPathSolver<Problem<&M, Gaussian<'_>, L1>> for shrinkage::CoordinateDescent where M: RawColumns<f64> + ColumnStats<f64> + ?Sized

Error

type Error = FitError<<M as MatrixErrorType>::Error>;

Fit

type Fit = LassoFit;

Penalty

type Penalty = L1;

maximum_penalty

fn maximum_penalty(
    &self,
    problem: &Problem<&M, Gaussian<'_>, L1>
) -> Result<PenaltyMaximum, <Self as RegularizationPathSolver>::Error>

solve_regularization_path

fn solve_regularization_path(
    &self,
    problem: &Problem<&M, Gaussian<'_>, L1>,
    options: &PathOptions
) -> Result<PathFit<LassoFit, L1>, <Self as RegularizationPathSolver>::Error>

Implementation of Solver

impl Solver<Problem<Box<dyn RuntimeDesign + '_>, Box<dyn SmoothDatafit<Error = FitError> + '_>, Box<dyn ProximalPenalty<Error = FitError> + '_>>> for shrinkage::CoordinateDescent

Error

type Error = FitError<BackendError>;

Fit

type Fit = LassoFit;

solve

fn solve(
    &self,
    _problem: &RuntimeProblem<'_>
) -> Result<<Self as Solver>::Fit, <Self as Solver>::Error>

Implementation of Solver

impl<M> Solver<Problem<&M, Gaussian<'_>, L1>> for CoordinateDescent where M: RawColumns<f64> + ColumnStats<f64> + ?Sized

Error

type Error = FitError<<M as MatrixErrorType>::Error>;

Fit

type Fit = LassoFit;

solve

fn solve(
    &self,
    problem: &Problem<&M, Gaussian<'_>, L1>
) -> Result<<Self as Solver>::Fit, <Self as Solver>::Error>

Implementation of Freeze

impl Freeze for CoordinateDescent

Implementation of RefUnwindSafe

impl RefUnwindSafe for CoordinateDescent

Implementation of Send

impl Send for CoordinateDescent

Implementation of Sync

impl Sync for CoordinateDescent

Implementation of Unpin

impl Unpin for CoordinateDescent

Implementation of UnsafeUnpin

impl UnsafeUnpin for CoordinateDescent

Implementation of UnwindSafe

impl UnwindSafe for CoordinateDescent

Implementation of Any

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

Implementation of Borrow

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

Implementation of BorrowMut

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

Implementation of ByRef

impl<T> ByRef<T> for T

Implementation of CastableFrom

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT where ST: ?Sized, DT: ?Sized

Implementation of CastableFrom

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT where ST: ?Sized, DT: ?Sized

Implementation of CloneToUninit

impl<T> CloneToUninit for T where T: Clone

Implementation of From

impl<T> From<T> for T

Implementation of Imply

impl<T, U> Imply<T> for U where T: ?Sized, U: ?Sized

Implementation of Into

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

Implementation of IntoEither

impl<T> IntoEither for T

Implementation of Pointable

impl<T> Pointable for T

Implementation of Read

impl<T> Read<Exclusive, BecauseExclusive> for T where T: ?Sized

Implementation of Same

impl<T> Same for T

Implementation of SupersetOf

impl<SS, SP> SupersetOf<SS> for SP where SS: SubsetOf<SP>

Implementation of ToOwned

impl<T> ToOwned for T where T: Clone

Implementation of TryFrom

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

Implementation of TryInto

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