shrinkage::DisjointGroups
Shrinkage for Rust · rust · 0.3.0
Source: src/penalty/groups.rs
Validated disjoint groups of optimization-scale coefficient indices.
Groups and their members retain the supplied order. Indices address a vector of ncoefficients entries, excluding intercepts. For a flattened coefficient matrix, use crate::CoefficientLayout::index to respect its response-major layout. Each coefficient belongs to at most one group.
Supply one finite, nonnegative weight per group. Weights are multipliers of group penalty values, stored without adjustment for group size or count. A zero weight still counts as coverage and must obey all membership rules. The coverage policy explicitly requires full coverage or leaves uncovered coefficients unpenalized. All definitions are checked at construction and exposed through immutable slices.
use ;
let groups = new?;
assert_eq!;
assert_eq!;
assert_eq!;
Inherent implementation
Source: src/penalty/groups.rs
groups
Source: src/penalty/groups.rs
Disjoint index vectors in their supplied group and member order.
ncoefficients
Source: src/penalty/groups.rs
Coefficient vector length, excluding intercepts.
new
Source: src/penalty/groups.rs
Validate and own weighted groups over a fixed coefficient vector.
Individual groups must be nonempty. An empty collection is valid for zero coefficients under either policy, or for any coefficient count under UncoveredPolicy::Unpenalized.
Errors
Reject a weight count different from the group count, nonfinite or negative weights, empty groups, repeated indices within a group, overlapping groups (including duplicate groups), or indices outside 0..ncoefficients. UncoveredPolicy::Reject also rejects any coefficient omitted from the groups. Errors identify group and coefficient indices using zero-based numbering when applicable.
uncovered
Source: src/penalty/groups.rs
Uncovered coefficient indices in increasing order.
Always empty under UncoveredPolicy::Reject. Under UncoveredPolicy::Unpenalized, these coefficients remain unpenalized.
uncovered_policy
Source: src/penalty/groups.rs
Policy governing coefficients outside every group.
weights
Source: src/penalty/groups.rs
One finite, nonnegative weight per group, in group order.
Implementation of Clone
Source: src/penalty/groups.rs
clone
Source: src/penalty/groups.rs
Implementation of Debug
Source: src/penalty/groups.rs
fmt
Source: src/penalty/groups.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 Pointable
Implementation of Read
Implementation of Same
Implementation of SupersetOf
Implementation of ToOwned
Implementation of TryFrom
Implementation of TryInto
