shrinkage::Binomial
Shrinkage for Rust · rust · 0.3.0
Source: src/datafit/binomial.rs
Bernoulli negative log likelihood with a logit link, averaged over rows.
Responses must be finite and lie in [0, 1]; fractional responses represent proportions with equal observation weights. The complete linear predictor includes an optional unpenalized intercept, fitted by default.
The predictor Hessian is diagonal with entries at most 1 / (4n). Consequently, for an optimization-scale design augmented with an intercept column, the coefficient gradient has Lipschitz constant at most ||[X, 1]||² / (4n). crate::ProximalGradient uses backtracking to enforce the corresponding quadratic upper bound without computing this norm. crate::Irls uses the exact diagonal predictor Hessian to construct weighted quadratic models solved by coordinate descent.
use ;
use ;
let x = from_fn;
let y = ;
let fit = new
.fit_with?;
// Predictions are logits; apply the logistic function for probabilities.
let logits = fit.predict?;
Inherent implementation
Source: src/datafit/binomial.rs
fit_intercept
Source: src/datafit/binomial.rs
Enable or disable the unpenalized fitted intercept.
Explicit column centering can still induce an original-scale intercept.
fits_intercept
Source: src/datafit/binomial.rs
Whether fitting includes a free, unpenalized intercept.
inverse_link
Source: src/datafit/binomial.rs
Transform a predictor to a mean with the default link.
Errors
Reject nonfinite predictors or arithmetic.
link
Source: src/datafit/binomial.rs
Transform a mean with the default logit link.
Errors
Reject means outside the link domain or nonfinite arithmetic.
new
Source: src/datafit/binomial.rs
Borrow responses, fitting an intercept by default.
response
Source: src/datafit/binomial.rs
Borrow the observed responses.
with_link
Source: src/datafit/binomial.rs
Compose this family with a link for Fisher-scoring IRLS.
Implementation of Clone
Source: src/datafit/binomial.rs
clone
Source: src/datafit/binomial.rs
Implementation of ConvexLink
Source: src/link.rs
Implementation of ConvexLink
Source: src/link.rs
Implementation of Copy
Source: src/datafit/binomial.rs
Implementation of CrossValidationDatafit
Source: src/cross_validation/metric.rs
WithResponse
Source: src/cross_validation/metric.rs
type WithResponse<'a> = ;response
Source: src/cross_validation/metric.rs
supports_metric
Source: src/cross_validation/metric.rs
validate_training
Source: src/cross_validation/metric.rs
validation_metric
Source: src/cross_validation/metric.rs
with_response
Source: src/cross_validation/metric.rs
Implementation of Datafit
Source: src/datafit/binomial.rs
Error
Source: src/datafit/binomial.rs
type Error = FitError;value
Source: src/datafit/binomial.rs
Implementation of Debug
Source: src/datafit/binomial.rs
fmt
Source: src/datafit/binomial.rs
Implementation of DiagonalHessianDatafit
Source: src/datafit/binomial.rs
hessian_diagonal
Source: src/datafit/binomial.rs
Implementation of DifferentiableDatafit
Source: src/datafit/binomial.rs
fits_intercept
Source: src/datafit/binomial.rs
gradient
Source: src/datafit/binomial.rs
n_obs
Source: src/datafit/binomial.rs
Implementation of GapSafeDatafit
Source: src/datafit/binomial.rs
dual_candidate
Source: src/datafit/binomial.rs
dual_objective
Source: src/datafit/binomial.rs
fenchel_gap
Source: src/datafit/binomial.rs
finalize_dual
Source: src/datafit/binomial.rs
strong_concavity
Source: src/datafit/binomial.rs
Implementation of HybridPathDatafit
Source: src/solver/hybrid/path.rs
Outer
Source: src/solver/hybrid/path.rs
type Outer = Outer;fit
Source: src/solver/hybrid/path.rs
outer
Source: src/solver/hybrid/path.rs
path_deviance
Source: src/solver/hybrid/path.rs
validate_solver
Source: src/solver/hybrid/path.rs
Implementation of NullModelDatafit
Source: src/path/datafit.rs
deviance
Source: src/path/datafit.rs
null_intercepts
Source: src/path/datafit.rs
Implementation of QuadraticModelDatafit
Source: src/datafit/binomial.rs
working_curvature
Source: src/datafit/binomial.rs
Implementation of SmoothDatafit
Source: src/datafit/binomial.rs
gap_safe
Source: src/datafit/binomial.rs
Implementation of Freeze
Implementation of RefUnwindSafe
Implementation of Send
Implementation of Sync
Implementation of Unpin
Implementation of UnsafeUnpin
Implementation of UnwindSafe
Implementation of Any
Implementation of Borrow
Implementation of BorrowMut
Implementation of ByRef
Implementation of CastableFrom
Implementation of CastableFrom
Implementation of CloneToUninit
Implementation of From
Implementation of Imply
Implementation of Into
Implementation of IntoEither
Implementation of PathDatafit
Source: src/path/datafit.rs
Implementation of Pointable
Implementation of Read
Implementation of Same
Implementation of SupersetOf
Implementation of ToOwned
Implementation of TryFrom
Implementation of TryInto
