#[non_exhaustive]pub struct BernoulliDistribution {
pub p: f64,
}
Expand description
Represents a Bernoulli distribution
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.p: f64
Probability of positive event
Implementations§
Source§impl BernoulliDistribution
impl BernoulliDistribution
Sourcepub fn new(p: f64) -> Result<BernoulliDistribution, RegressionError>
pub fn new(p: f64) -> Result<BernoulliDistribution, RegressionError>
Constructs a new Bernoulli distribution from the provided parameter
§Arguments
p
- The probability of a positive event
Trait Implementations§
Source§impl Clone for BernoulliDistribution
impl Clone for BernoulliDistribution
Source§fn clone(&self) -> BernoulliDistribution
fn clone(&self) -> BernoulliDistribution
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 Debug for BernoulliDistribution
impl Debug for BernoulliDistribution
Source§impl<'de> Deserialize<'de> for BernoulliDistribution
impl<'de> Deserialize<'de> for BernoulliDistribution
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 Serialize for BernoulliDistribution
impl Serialize for BernoulliDistribution
Source§impl VariationalRegression<BernoulliDistribution> for VariationalLogisticRegression
impl VariationalRegression<BernoulliDistribution> for VariationalLogisticRegression
Source§fn predict(
&self,
features: &[f64],
) -> Result<BernoulliDistribution, RegressionError>
fn predict( &self, features: &[f64], ) -> Result<BernoulliDistribution, RegressionError>
Computes the predictive distribution for the provided features Read more
impl Copy for BernoulliDistribution
Auto Trait Implementations§
impl Freeze for BernoulliDistribution
impl RefUnwindSafe for BernoulliDistribution
impl Send for BernoulliDistribution
impl Sync for BernoulliDistribution
impl Unpin for BernoulliDistribution
impl UnwindSafe for BernoulliDistribution
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.