pub struct VariationalLinearRegression {
pub noise_precision: GammaDistribution,
pub bound: f64,
/* private fields */
}
Expand description
Represents a linear regression model trained via variational inference
Fields§
§noise_precision: GammaDistribution
Noise precision distribution
bound: f64
Variational lower bound
Implementations§
Source§impl VariationalLinearRegression
impl VariationalLinearRegression
Sourcepub fn train(
features: impl Features,
labels: impl RealLabels,
config: &LinearTrainConfig,
) -> Result<VariationalLinearRegression, RegressionError>
pub fn train( features: impl Features, labels: impl RealLabels, config: &LinearTrainConfig, ) -> Result<VariationalLinearRegression, RegressionError>
Trains the model on the provided data
§Arguments
features
- The feature values (in row-major orientation)
labels
- The vector of corresponding labels
config
- The training configuration
Trait Implementations§
Source§impl Clone for VariationalLinearRegression
impl Clone for VariationalLinearRegression
Source§fn clone(&self) -> VariationalLinearRegression
fn clone(&self) -> VariationalLinearRegression
Returns a copy 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<'de> Deserialize<'de> for VariationalLinearRegression
impl<'de> Deserialize<'de> for VariationalLinearRegression
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl VariationalRegression<GaussianDistribution> for VariationalLinearRegression
impl VariationalRegression<GaussianDistribution> for VariationalLinearRegression
Source§fn predict(
&self,
features: &[f64],
) -> Result<GaussianDistribution, RegressionError>
fn predict( &self, features: &[f64], ) -> Result<GaussianDistribution, RegressionError>
Computes the predictive distribution for the provided features Read more
Auto Trait Implementations§
impl Freeze for VariationalLinearRegression
impl RefUnwindSafe for VariationalLinearRegression
impl Send for VariationalLinearRegression
impl Sync for VariationalLinearRegression
impl Unpin for VariationalLinearRegression
impl UnwindSafe for VariationalLinearRegression
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<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>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
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
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.