pub struct KernelCenteringStats {
pub row_means: Array1<f64>,
pub grand_mean: f64,
}Expand description
Training-time centering statistics kept around so that we can center the test-time kernel evaluations against the same reference frame.
Given a training kernel matrix K of shape (n, n):
row_means[j] = (1/n) sum_i K[i, j]— the mean of columnj(equivalently, rowj;Kis symmetric). These are the means of the training kernels with every training point.grand_mean = (1/n^2) sum_{i,j} K[i, j]— the double sum.
The two statistics are exactly what appears in the transformation applied to test-time kernel evaluations:
k_c(x, X_j) = k(x, X_j) - row_means[j] - (1/n) sum_i k(x, X_i) + grand_meanFields§
§row_means: Array1<f64>Per-column means of the training Gram matrix, length n.
grand_mean: f64Scalar grand mean of the training Gram matrix.
Implementations§
Trait Implementations§
Source§impl Clone for KernelCenteringStats
impl Clone for KernelCenteringStats
Source§fn clone(&self) -> KernelCenteringStats
fn clone(&self) -> KernelCenteringStats
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for KernelCenteringStats
impl Debug for KernelCenteringStats
Source§impl PartialEq for KernelCenteringStats
impl PartialEq for KernelCenteringStats
impl StructuralPartialEq for KernelCenteringStats
Auto Trait Implementations§
impl Freeze for KernelCenteringStats
impl RefUnwindSafe for KernelCenteringStats
impl Send for KernelCenteringStats
impl Sync for KernelCenteringStats
impl Unpin for KernelCenteringStats
impl UnsafeUnpin for KernelCenteringStats
impl UnwindSafe for KernelCenteringStats
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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 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>
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