Struct lace::DatalessOracle

source ·
pub struct DatalessOracle {
    pub states: Vec<State>,
    pub codebook: Codebook,
}
Expand description

An oracle without data for sensitive data applications

Fields§

§states: Vec<State>

Vector of states

§codebook: Codebook

Metadata for the rows and columns

Trait Implementations§

source§

impl Clone for DatalessOracle

source§

fn clone(&self) -> DatalessOracle

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for DatalessOracle

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for DatalessOracle

source§

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 From<DatalessOracle> for Metadata

source§

fn from(oracle: DatalessOracle) -> Self

Converts to this type from the input type.
source§

impl From<Metadata> for DatalessOracle

source§

fn from(md: Metadata) -> Self

Converts to this type from the input type.
source§

impl From<Oracle> for DatalessOracle

source§

fn from(oracle: Oracle) -> Self

Converts to this type from the input type.
source§

impl HasData for DatalessOracle

source§

fn summarize_feature(&self, _ix: usize) -> SummaryStatistics

Summarize the data in a feature
source§

fn cell(&self, _row_ix: usize, _col_ix: usize) -> Datum

Return the datum in a cell
source§

impl HasStates for DatalessOracle

source§

fn states(&self) -> &Vec<State>

Get a reference to the States
source§

fn states_mut(&mut self) -> &mut Vec<State>

Get a mutable reference to the States
source§

fn n_states(&self) -> usize

Get the number of states
source§

fn n_rows(&self) -> usize

Get the number of rows in the states
source§

fn n_cols(&self) -> usize

Get the number of columns in the states
source§

impl Serialize for DatalessOracle

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> DynClone for T
where T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> OracleT for T
where T: CanOracle,

source§

fn state_diagnostics(&self) -> Vec<StateDiagnostics>

Returns the diagnostics for each state
source§

fn shape(&self) -> (usize, usize, usize)

Returns a tuple containing the number of rows, the number of columns, and the number of states Read more
source§

fn is_empty(&self) -> bool

Returns true if the object is empty, having no structure to analyze.
source§

fn ftype<Ix: ColumnIndex>(&self, col_ix: Ix) -> Result<FType, IndexError>

Return the FType of the column col_ix Read more
source§

fn ftypes(&self) -> Vec<FType>

Returns a vector of the feature types of each row Read more
source§

fn summarize_col<Ix: ColumnIndex>( &self, col_ix: Ix ) -> Result<SummaryStatistics, IndexError>

Return a summary of the data in the column Read more
source§

fn depprob<Ix: ColumnIndex>( &self, col_a: Ix, col_b: Ix ) -> Result<f64, IndexError>

Estimated dependence probability between col_a and col_b Read more
source§

fn depprob_pw<'x, Ix>( &self, pairs: &'x [(Ix, Ix)] ) -> Result<Vec<f64>, IndexError>
where Ix: ColumnIndex, &'x [(Ix, Ix)]: IntoParallelIterator<Item = &'x (Ix, Ix)>,

Compute dependence probability for a list of column pairs. Read more
source§

fn _rowsim_validation( &self, row_a: usize, row_b: usize, wrt: &Option<&Vec<usize>> ) -> Result<(), RowSimError>

source§

fn rowsim<RIx: RowIndex, CIx: ColumnIndex>( &self, row_a: RIx, row_b: RIx, wrt: Option<&[CIx]>, variant: RowSimilarityVariant ) -> Result<f64, RowSimError>

Estimated row similarity between row_a and row_b Read more
source§

fn rowsim_pw<'x, RIx, CIx>( &self, pairs: &'x [(RIx, RIx)], wrt: Option<&[CIx]>, variant: RowSimilarityVariant ) -> Result<Vec<f64>, RowSimError>
where RIx: RowIndex, CIx: ColumnIndex + Sync, &'x [(RIx, RIx)]: IntoParallelIterator<Item = &'x (RIx, RIx)>,

Compute row similarity for pairs of rows Read more
source§

fn novelty<RIx: RowIndex, CIx: ColumnIndex>( &self, row_ix: RIx, wrt: Option<&[CIx]> ) -> Result<f64, IndexError>

Determine the relative novelty of a row. Read more
source§

fn mi<Ix: ColumnIndex>( &self, col_a: Ix, col_b: Ix, n: usize, mi_type: MiType ) -> Result<f64, MiError>

Estimate the mutual information between col_a and col_b using Monte Carlo integration Read more
source§

fn mi_pw<Ix: ColumnIndex>( &self, col_pairs: &[(Ix, Ix)], n: usize, mi_type: MiType ) -> Result<Vec<f64>, MiError>

Compute mutual information over pairs of columns Read more
source§

fn entropy<Ix: ColumnIndex>( &self, col_ixs: &[Ix], n: usize ) -> Result<f64, EntropyError>

Estimate joint entropy Read more
Determine the set of predictors that most efficiently account for the most information in a set of target columns. Read more
source§

fn info_prop<IxT: ColumnIndex, IxX: ColumnIndex>( &self, cols_t: &[IxT], cols_x: &[IxX], n: usize ) -> Result<f64, InfoPropError>

Compute the proportion of information in cols_t accounted for by cols_x. Read more
source§

fn conditional_entropy<IxT: ColumnIndex, IxX: ColumnIndex>( &self, col_t: IxT, cols_x: &[IxX], n: usize ) -> Result<f64, ConditionalEntropyError>

Conditional entropy H(T|X) where X is lists of column indices Read more
source§

fn conditional_entropy_pw<Ix: ColumnIndex>( &self, col_pairs: &[(Ix, Ix)], n: usize, kind: ConditionalEntropyType ) -> Result<Vec<f64>, ConditionalEntropyError>

Pairwise copmutation of conditional entreopy or information proportion Read more
source§

fn surprisal<RIx: RowIndex, CIx: ColumnIndex>( &self, x: &Datum, row_ix: RIx, col_ix: CIx, state_ixs: Option<Vec<usize>> ) -> Result<Option<f64>, SurprisalError>

Negative log PDF/PMF of a datum, x, in a specific cell of the table at position row_ix, col_ix. Read more
source§

fn self_surprisal<RIx: RowIndex, CIx: ColumnIndex>( &self, row_ix: RIx, col_ix: CIx, state_ixs: Option<Vec<usize>> ) -> Result<Option<f64>, SurprisalError>

Get the surprisal of the datum in a cell. Read more
source§

fn datum<RIx: RowIndex, CIx: ColumnIndex>( &self, row_ix: RIx, col_ix: CIx ) -> Result<Datum, IndexError>

Get the datum at an index Read more
source§

fn logp<Ix: ColumnIndex, GIx: ColumnIndex>( &self, col_ixs: &[Ix], vals: &[Vec<Datum>], given: &Given<GIx>, state_ixs_opt: Option<&[usize]> ) -> Result<Vec<f64>, LogpError>

Compute the log PDF/PMF of a set of values possibly conditioned on the values of other columns Read more
source§

fn logp_scaled<Ix: ColumnIndex, GIx: ColumnIndex>( &self, col_ixs: &[Ix], vals: &[Vec<Datum>], given: &Given<GIx>, state_ixs_opt: Option<&[usize]> ) -> Result<Vec<f64>, LogpError>
where Self: Sized,

A version of logp where the likelihood are scaled by the column modes. Read more
source§

fn draw<RIx: RowIndex, CIx: ColumnIndex, R: Rng>( &self, row_ix: RIx, col_ix: CIx, n: usize, rng: &mut R ) -> Result<Vec<Datum>, IndexError>

Draw n samples from the cell at [row_ix, col_ix]. Read more
source§

fn simulate<Ix: ColumnIndex, GIx: ColumnIndex, R: Rng>( &self, col_ixs: &[Ix], given: &Given<GIx>, n: usize, state_ixs_opt: Option<Vec<usize>>, rng: &mut R ) -> Result<Vec<Vec<Datum>>, SimulateError>

Simulate values from joint or conditional distribution Read more
source§

fn impute<RIx: RowIndex, CIx: ColumnIndex>( &self, row_ix: RIx, col_ix: CIx, with_uncertainty: bool ) -> Result<(Datum, Option<f64>), IndexError>

Return the most likely value for a cell in the table along with the confidence in that imputation. Read more
source§

fn predict<Ix: ColumnIndex, GIx: ColumnIndex>( &self, col_ix: Ix, given: &Given<GIx>, with_uncertainty: bool, state_ixs_opt: Option<&[usize]> ) -> Result<(Datum, Option<f64>), PredictError>

Return the most likely value for a column given a set of conditions along with the confidence in that prediction. Read more
source§

fn variability<Ix: ColumnIndex, GIx: ColumnIndex>( &self, col_ix: Ix, given: &Given<GIx>, state_ixs_opt: Option<&[usize]> ) -> Result<Variability, VariabilityError>

Compute the variability of a conditional distribution Read more
source§

fn feature_error<Ix: ColumnIndex>( &self, col_ix: Ix ) -> Result<(f64, f64), IndexError>

Compute the error between the observed data in a feature and the feature model. Read more
source§

fn _logp_unchecked( &self, col_ixs: &[usize], vals: &[Vec<Datum>], given: &Given<usize>, state_ixs_opt: Option<&[usize]>, scaled: bool ) -> Vec<f64>

source§

fn _simulate_unchecked<R: Rng>( &self, col_ixs: &[usize], given: &Given<usize>, n: usize, state_ixs_opt: Option<Vec<usize>>, rng: &mut R ) -> Vec<Vec<Datum>>

source§

fn _surprisal_unchecked( &self, x: &Datum, row_ix: usize, col_ix: usize, state_ixs_opt: Option<Vec<usize>> ) -> Option<f64>

source§

fn _dual_entropy(&self, col_a: usize, col_b: usize, n: usize) -> f64

specialization for column pairs. If a specialization is not founds for the specific columns types, will fall back to MC approximation
source§

fn _mi_components(&self, col_a: usize, col_b: usize, n: usize) -> MiComponents

Get the components of mutual information between two columns
source§

fn _sobol_joint_entropy(&self, col_ixs: &[usize], n: usize) -> f64

Use a Sobol QMC sequence to appropriate joint entropy Read more
source§

fn _mc_joint_entropy<R: Rng>( &self, col_ixs: &[usize], n: usize, rng: &mut R ) -> f64

source§

fn _entropy_unchecked(&self, col_ixs: &[usize], n: usize) -> f64

source§

fn _impute_uncertainty(&self, row_ix: usize, col_ix: usize) -> f64

Computes the predictive uncertainty for the datum at (row_ix, col_ix) as mean the pairwise KL divergence between the components to which the datum is assigned. Read more
source§

fn _predict_uncertainty( &self, col_ix: usize, given: &Given<usize>, state_ixs_opt: Option<&[usize]> ) -> f64

Computes the uncertainty associated with predicting the value of a features with optional given conditions. Uses Jensen-Shannon divergence computed on the mixture of mixtures. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,