pub struct MultinomialPredictiveModel<'a> {
pub training_design: ArrayView2<'a, f64>,
pub training_class_index: &'a [u32],
pub training_weights: ArrayView1<'a, f64>,
pub joint_penalty: ArrayView2<'a, f64>,
pub n_classes: usize,
}Expand description
The training data and penalty a saved multinomial model needs in order to evaluate its own log-posterior away from the mode.
A Laplace SUMMARY (β̂, H⁻¹) is not enough to compute a posterior mean:
the summary is precisely the quadratic model whose inadequacy is the defect.
The predictive therefore needs the likelihood itself, which means the rows.
Fields§
§training_design: ArrayView2<'a, f64>Training design in the SAME (raw) basis as the saved coefficients and as
the design rebuilt for prediction, shape (n, P).
training_class_index: &'a [u32]Training class index per row, values in 0..K, aligned to
class_levels.
training_weights: ArrayView1<'a, f64>Training row weights, length n.
joint_penalty: ArrayView2<'a, f64>The joint penalty S_λ at the selected smoothing parameters, in the
stacked class-major coefficient order θ[a·P + i] = β[i, a], shape
(P·M, P·M) with M = K − 1.
n_classes: usizeTotal class count K (the reference class K − 1 carries η ≡ 0).
Implementations§
Source§impl<'a> MultinomialPredictiveModel<'a>
impl<'a> MultinomialPredictiveModel<'a>
Sourcepub fn predictive_moments(
&self,
mode: ArrayView1<'_, f64>,
x_new: ArrayView2<'_, f64>,
want_second_moments: bool,
) -> Result<MultinomialPredictiveMoments, EstimationError>
pub fn predictive_moments( &self, mode: ArrayView1<'_, f64>, x_new: ArrayView2<'_, f64>, want_second_moments: bool, ) -> Result<MultinomialPredictiveMoments, EstimationError>
Posterior-predictive moments at each row of x_new.
mode is the un-augmented posterior mode in the same stacked class-major
order; it is the warm start for every augmented solve and the base of
every ratio.
Trait Implementations§
Source§impl<'a> Clone for MultinomialPredictiveModel<'a>
impl<'a> Clone for MultinomialPredictiveModel<'a>
Source§fn clone(&self) -> MultinomialPredictiveModel<'a>
fn clone(&self) -> MultinomialPredictiveModel<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl<'a> Copy for MultinomialPredictiveModel<'a>
Auto Trait Implementations§
impl<'a> Freeze for MultinomialPredictiveModel<'a>
impl<'a> RefUnwindSafe for MultinomialPredictiveModel<'a>
impl<'a> Send for MultinomialPredictiveModel<'a>
impl<'a> Sync for MultinomialPredictiveModel<'a>
impl<'a> Unpin for MultinomialPredictiveModel<'a>
impl<'a> UnsafeUnpin for MultinomialPredictiveModel<'a>
impl<'a> UnwindSafe for MultinomialPredictiveModel<'a>
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T, U> Imply<T> for U
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.