pub struct Engine {
pub states: Vec<State>,
pub state_ids: Vec<usize>,
pub codebook: Codebook,
pub rng: Xoshiro256Plus,
}
Expand description
The engine runs states in parallel
Fields§
§states: Vec<State>
Vector of states
state_ids: Vec<usize>
§codebook: Codebook
§rng: Xoshiro256Plus
Implementations§
source§impl Engine
impl Engine
Maintains and samples states
sourcepub fn new(
n_states: usize,
codebook: Codebook,
data_source: DataSource,
id_offset: usize,
rng: Xoshiro256Plus
) -> Result<Self, NewEngineError>
pub fn new( n_states: usize, codebook: Codebook, data_source: DataSource, id_offset: usize, rng: Xoshiro256Plus ) -> Result<Self, NewEngineError>
Create a new engine
§Arguments
- n_states: number of states
- id_offset: the state IDs will start at
id_offset
. This is useful for when you run multiple engines on multiple machines and want to easily combine the states in a singleOracle
after the runs - data_source: struct defining the type or data and path
- id_offset: the state IDs will be
0+id_offset, ..., n_states + id_offset
. If offset is helpful when you want to run a single model on multiple machines and merge the states into the same metadata folder. - rng: Random number generator
sourcepub fn seed_from_u64(&mut self, seed: u64)
pub fn seed_from_u64(&mut self, seed: u64)
Re-seed the RNG
sourcepub fn del_rows_at(&mut self, ix: usize, n: usize)
pub fn del_rows_at(&mut self, ix: usize, n: usize)
Delete n rows starting at index ix.
If ix + n exceeds the number of rows, all of the rows starting at ix will be deleted.
sourcepub fn del_column<Ix: ColumnIndex>(
&mut self,
col_ix: Ix
) -> Result<(), IndexError>
pub fn del_column<Ix: ColumnIndex>( &mut self, col_ix: Ix ) -> Result<(), IndexError>
Delete the column at col_ix
§Example
use lace::examples::Example;
use lace::OracleT;
let mut engine = Example::Animals.engine().unwrap();
let shape = engine.shape();
assert_eq!(shape, (50, 85, 16));
// String index
engine.del_column("swims");
assert_eq!(engine.shape(), (50, 84, 16));
// Integer index
engine.del_column(3);
assert_eq!(engine.shape(), (50, 83, 16));
Deleting a column that does not exist returns and IndexError
let mut engine = Example::Animals.engine().unwrap();
let result = engine.del_column("likes_milk_in_coffee");
assert!(result.is_err());
sourcepub fn insert_data<R: RowIndex, C: ColumnIndex>(
&mut self,
rows: Vec<Row<R, C>>,
new_metadata: Option<ColMetadataList>,
mode: WriteMode
) -> Result<InsertDataActions, InsertDataError>
pub fn insert_data<R: RowIndex, C: ColumnIndex>( &mut self, rows: Vec<Row<R, C>>, new_metadata: Option<ColMetadataList>, mode: WriteMode ) -> Result<InsertDataActions, InsertDataError>
Insert new, or overwrite existing data
§Notes
It is assumed that the user will run a transition after the new data are inserted. No effort is made to update any of the state according to the MCMC kernel, so the state will likely be sub optimal.
New columns are assigned to a random existing view; new rows are reassigned using the Gibbs kernel. Overwritten cells are left alone.
When extending the support of a categorical column with a value_map
,
you must supply an entry in column_metadata
for that column, and the
entry must have a value_map
that contains mapping for all valid
values including those being added.
§Arguments
- rows: The rows of data containing the cells to insert or re-write
- new_metadata: Contains the column metadata for columns to be
inserted. The columns will be inserted in the order they appear in
the metadata list. If there are columns that appear in the
column metadata that do not appear in
rows
, it will cause an error. - mode: Defines how states may be modified.
§Example
Add a pegasus row with a few important values.
use lace::{OracleT, HasStates};
use lace_data::Datum;
use lace::{Row, Value, WriteMode};
let mut engine = Example::Animals.engine().unwrap();
let starting_rows = engine.n_rows();
let rows = vec![
Row::<&str, &str> {
row_ix: "pegasus".into(),
values: vec![
Value {
col_ix: "flys".into(),
value: Datum::Categorical(1_u8.into()),
},
Value {
col_ix: "hooves".into(),
value: Datum::Categorical(1_u8.into()),
},
Value {
col_ix: "swims".into(),
value: Datum::Categorical(0_u8.into()),
},
]
}
];
// Allow insert_data to add new rows, but not new columns, and prevent
// any existing data (even missing cells) from being overwritten.
let result = engine.insert_data(
rows,
None,
WriteMode::unrestricted()
);
assert!(result.is_ok());
assert_eq!(engine.n_rows(), starting_rows + 1);
Add a column that may help us categorize a new type of animal. Note that Rows can be constructed from other simpler representations.
use lace_codebook::{ColMetadataList, ColMetadata, ColType, ValueMap};
use lace_stats::prior::csd::CsdHyper;
let rows: Vec<Row<&str, &str>> = vec![
("bat", vec![("drinks+blood", Datum::Categorical(1_u8.into()))]).into(),
("beaver", vec![("drinks+blood", Datum::Categorical(0_u8.into()))]).into(),
];
// The partial codebook is required to define the data type and
// distribution of new columns
let col_metadata = ColMetadataList::new(
vec![
ColMetadata {
name: "drinks+blood".into(),
coltype: ColType::Categorical {
k: 2,
hyper: Some(CsdHyper::default()),
prior: None,
value_map: ValueMap::U8(2),
},
notes: None,
missing_not_at_random: false,
}
]
).unwrap();
let starting_cols = engine.n_cols();
// Allow insert_data to add new columns, but not new rows, and prevent
// any existing data (even missing cells) from being overwritten.
let result = engine.insert_data(
rows,
Some(col_metadata),
WriteMode::unrestricted(),
);
assert!(result.is_ok());
assert_eq!(engine.n_cols(), starting_cols + 1);
Add several new columns.
use lace_codebook::{ColMetadataList, ColMetadata, ColType, ValueMap};
use lace_stats::prior::csd::CsdHyper;
let rows: Vec<Row<&str, &str>> = vec![
("bat", vec![
("drinks+blood", Datum::Categorical(1_u8.into())),
]).into(),
("wolf", vec![
("drinks+blood", Datum::Categorical(1_u8.into())),
("howls+at+the+moon", Datum::Categorical(1_u8.into())),
]).into(),
];
// The partial codebook is required to define the data type and
// distribution of new columns. It must contain metadata for only the
// new columns.
let col_metadata = ColMetadataList::new(
vec![
ColMetadata {
name: "drinks+blood".into(),
coltype: ColType::Categorical {
k: 2,
hyper: Some(CsdHyper::default()),
prior: None,
value_map: ValueMap::U8(2),
},
notes: None,
missing_not_at_random: false,
},
ColMetadata {
name: "howls+at+the+moon".into(),
coltype: ColType::Categorical {
k: 2,
hyper: Some(CsdHyper::default()),
prior: None,
value_map: ValueMap::U8(2),
},
notes: None,
missing_not_at_random: false,
}
]
).unwrap();
let starting_cols = engine.n_cols();
// Allow insert_data to add new columns, but not new rows, and prevent
// any existing data (even missing cells) from being overwritten.
let result = engine.insert_data(
rows,
Some(col_metadata),
WriteMode::unrestricted(),
);
assert!(result.is_ok());
assert_eq!(engine.n_cols(), starting_cols + 2);
We could also insert to a new category. In the animals data set all values are binary, {0, 1}. What if we decided a pig was neither fierce or docile, that it was something else, that we will capture with the value ‘2’?
use lace::examples::animals;
// Get the value before we edit.
let x_before = engine.datum("pig", "fierce").unwrap();
// Turns out pigs are fierce.
assert_eq!(x_before, Datum::Categorical(1_u8.into()));
let rows: Vec<Row<&str, &str>> = vec![
// Inserting a 2 into a binary column
("pig", vec![("fierce", Datum::Categorical(2_u8.into()))]).into(),
];
let result = engine.insert_data(
rows,
None,
WriteMode::unrestricted(),
);
assert!(result.is_ok());
// Make sure that the 2 exists in the table
let x_after = engine.datum("pig", "fierce").unwrap();
assert_eq!(x_after, Datum::Categorical(2_u8.into()));
To add a category to a column with value_map
let mut engine = Example::Satellites.engine().unwrap();
use lace_codebook::{ColMetadata, ColType, ValueMap};
use std::collections::HashMap;
let rows: Vec<Row<&str, &str>> = vec![(
"Artemis (Advanced Data Relay and Technology Mission Satellite)",
vec![("Class_of_Orbit", Datum::Categorical("MEO".into()))]
).into()];
let result = engine.insert_data(
rows,
None,
WriteMode::unrestricted(),
);
assert!(result.is_ok());
sourcepub fn remove_data<R: RowIndex, C: ColumnIndex>(
&mut self,
indices: Vec<TableIndex<R, C>>
) -> Result<(), RemoveDataError>
pub fn remove_data<R: RowIndex, C: ColumnIndex>( &mut self, indices: Vec<TableIndex<R, C>> ) -> Result<(), RemoveDataError>
Remove data from the engine
§Notes
- Removing a
Datum::Missing
cell will do nothing - Removing all the cells in a row or column will completely remove that row or column
§Arguments
- indices: A
Vec
ofIndex
.
§Example
Remove a cell.
use lace::{TableIndex, OracleT};
use lace_data::Datum;
let mut engine = Example::Animals.engine().unwrap();
assert_eq!(
engine.datum("horse", "flys").unwrap(),
Datum::Categorical(0_u8.into()),
);
// Row and Column implement Into<TableIndex>
engine.remove_data(vec![("horse", "flys").into()]);
assert_eq!(engine.datum("horse", "flys").unwrap(), Datum::Missing);
Remove a row and column.
let mut engine = Example::Animals.engine().unwrap();
assert_eq!(engine.n_rows(), 50);
assert_eq!(engine.n_cols(), 85);
engine.remove_data(vec![
TableIndex::Row("horse"),
TableIndex::Column("flys"),
]);
assert_eq!(engine.n_rows(), 49);
assert_eq!(engine.n_cols(), 84);
Removing all the cells in a row, will delete the row
let mut engine = Example::Animals.engine().unwrap();
assert_eq!(engine.n_rows(), 50);
assert_eq!(engine.n_cols(), 85);
// You can convert a tuple of (row_ix, col_ix) to an Index
let ixs = (0..engine.n_cols())
.map(|ix| TableIndex::from((6, ix)))
.collect();
engine.remove_data(ixs);
assert_eq!(engine.n_rows(), 49);
assert_eq!(engine.n_cols(), 85);
sourcepub fn cell_gibbs(&mut self, row_ix: usize, col_ix: usize)
pub fn cell_gibbs(&mut self, row_ix: usize, col_ix: usize)
Run the Gibbs reassignment kernel on a specific column and row withing a view. Used when the user would like to focus more updating on specific regions of the table.
§Notes
- The entire column will be reassigned, but only the part of row within
the view to which column
col_ix
is assigned will be updated. - Do not use a part of Geweke. This function assumes all transitions will be run, so it cannot be guaranteed to be valid for all Geweke configurations.
sourcepub fn save<P: AsRef<Path>>(
&self,
path: P,
ser_type: SerializedType
) -> Result<(), Error>
pub fn save<P: AsRef<Path>>( &self, path: P, ser_type: SerializedType ) -> Result<(), Error>
Save the Engine to a lacefile
sourcepub fn run(&mut self, n_iters: usize) -> Result<(), Error>
pub fn run(&mut self, n_iters: usize) -> Result<(), Error>
Run each State
in the Engine
for n_iters
iterations using the
default algorithms and transitions. If the Engine is empty, update
will immediately return.
sourcepub fn update<U>(
&mut self,
config: EngineUpdateConfig,
update_handler: U
) -> Result<(), Error>where
U: UpdateHandler,
pub fn update<U>(
&mut self,
config: EngineUpdateConfig,
update_handler: U
) -> Result<(), Error>where
U: UpdateHandler,
Run each State
in the Engine
according to the config. If the
Engine
is empty, update
will return immediately.
sourcepub fn flatten_cols(&mut self)
pub fn flatten_cols(&mut self)
Flatten the column assignment of each state so that each state has only one view
Trait Implementations§
source§impl<'de> Deserialize<'de> for Engine
impl<'de> Deserialize<'de> for Engine
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>,
source§impl HasStates for Engine
impl HasStates for Engine
source§fn states_mut(&mut self) -> &mut Vec<State>
fn states_mut(&mut self) -> &mut Vec<State>
Auto Trait Implementations§
impl RefUnwindSafe for Engine
impl Send for Engine
impl Sync for Engine
impl Unpin for Engine
impl UnwindSafe for Engine
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
source§impl<T> OracleT for Twhere
T: CanOracle,
impl<T> OracleT for Twhere
T: CanOracle,
source§fn state_diagnostics(&self) -> Vec<StateDiagnostics>
fn state_diagnostics(&self) -> Vec<StateDiagnostics>
source§fn shape(&self) -> (usize, usize, usize)
fn shape(&self) -> (usize, usize, usize)
source§fn is_empty(&self) -> bool
fn is_empty(&self) -> bool
source§fn ftype<Ix: ColumnIndex>(&self, col_ix: Ix) -> Result<FType, IndexError>
fn ftype<Ix: ColumnIndex>(&self, col_ix: Ix) -> Result<FType, IndexError>
col_ix
Read moresource§fn summarize_col<Ix: ColumnIndex>(
&self,
col_ix: Ix
) -> Result<SummaryStatistics, IndexError>
fn summarize_col<Ix: ColumnIndex>( &self, col_ix: Ix ) -> Result<SummaryStatistics, IndexError>
source§fn depprob<Ix: ColumnIndex>(
&self,
col_a: Ix,
col_b: Ix
) -> Result<f64, IndexError>
fn depprob<Ix: ColumnIndex>( &self, col_a: Ix, col_b: Ix ) -> Result<f64, IndexError>
source§fn depprob_pw<'x, Ix>(
&self,
pairs: &'x [(Ix, Ix)]
) -> Result<Vec<f64>, IndexError>
fn depprob_pw<'x, Ix>( &self, pairs: &'x [(Ix, Ix)] ) -> Result<Vec<f64>, IndexError>
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>
fn rowsim<RIx: RowIndex, CIx: ColumnIndex>( &self, row_a: RIx, row_b: RIx, wrt: Option<&[CIx]>, variant: RowSimilarityVariant ) -> Result<f64, RowSimError>
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)>,
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)>,
source§fn novelty<RIx: RowIndex, CIx: ColumnIndex>(
&self,
row_ix: RIx,
wrt: Option<&[CIx]>
) -> Result<f64, IndexError>
fn novelty<RIx: RowIndex, CIx: ColumnIndex>( &self, row_ix: RIx, wrt: Option<&[CIx]> ) -> Result<f64, IndexError>
source§fn mi<Ix: ColumnIndex>(
&self,
col_a: Ix,
col_b: Ix,
n: usize,
mi_type: MiType
) -> Result<f64, MiError>
fn mi<Ix: ColumnIndex>( &self, col_a: Ix, col_b: Ix, n: usize, mi_type: MiType ) -> Result<f64, MiError>
source§fn mi_pw<Ix: ColumnIndex>(
&self,
col_pairs: &[(Ix, Ix)],
n: usize,
mi_type: MiType
) -> Result<Vec<f64>, MiError>
fn mi_pw<Ix: ColumnIndex>( &self, col_pairs: &[(Ix, Ix)], n: usize, mi_type: MiType ) -> Result<Vec<f64>, MiError>
source§fn entropy<Ix: ColumnIndex>(
&self,
col_ixs: &[Ix],
n: usize
) -> Result<f64, EntropyError>
fn entropy<Ix: ColumnIndex>( &self, col_ixs: &[Ix], n: usize ) -> Result<f64, EntropyError>
source§fn predictor_search<Ix: ColumnIndex>(
&self,
cols_t: &[Ix],
max_predictors: usize,
n_qmc_samples: usize
) -> Result<Vec<(usize, f64)>, IndexError>
fn predictor_search<Ix: ColumnIndex>( &self, cols_t: &[Ix], max_predictors: usize, n_qmc_samples: usize ) -> Result<Vec<(usize, f64)>, IndexError>
source§fn info_prop<IxT: ColumnIndex, IxX: ColumnIndex>(
&self,
cols_t: &[IxT],
cols_x: &[IxX],
n: usize
) -> Result<f64, InfoPropError>
fn info_prop<IxT: ColumnIndex, IxX: ColumnIndex>( &self, cols_t: &[IxT], cols_x: &[IxX], n: usize ) -> Result<f64, InfoPropError>
source§fn conditional_entropy<IxT: ColumnIndex, IxX: ColumnIndex>(
&self,
col_t: IxT,
cols_x: &[IxX],
n: usize
) -> Result<f64, ConditionalEntropyError>
fn conditional_entropy<IxT: ColumnIndex, IxX: ColumnIndex>( &self, col_t: IxT, cols_x: &[IxX], n: usize ) -> Result<f64, ConditionalEntropyError>
source§fn conditional_entropy_pw<Ix: ColumnIndex>(
&self,
col_pairs: &[(Ix, Ix)],
n: usize,
kind: ConditionalEntropyType
) -> Result<Vec<f64>, ConditionalEntropyError>
fn conditional_entropy_pw<Ix: ColumnIndex>( &self, col_pairs: &[(Ix, Ix)], n: usize, kind: ConditionalEntropyType ) -> Result<Vec<f64>, ConditionalEntropyError>
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>
fn surprisal<RIx: RowIndex, CIx: ColumnIndex>( &self, x: &Datum, row_ix: RIx, col_ix: CIx, state_ixs: Option<Vec<usize>> ) -> Result<Option<f64>, SurprisalError>
source§fn self_surprisal<RIx: RowIndex, CIx: ColumnIndex>(
&self,
row_ix: RIx,
col_ix: CIx,
state_ixs: Option<Vec<usize>>
) -> Result<Option<f64>, SurprisalError>
fn self_surprisal<RIx: RowIndex, CIx: ColumnIndex>( &self, row_ix: RIx, col_ix: CIx, state_ixs: Option<Vec<usize>> ) -> Result<Option<f64>, SurprisalError>
source§fn datum<RIx: RowIndex, CIx: ColumnIndex>(
&self,
row_ix: RIx,
col_ix: CIx
) -> Result<Datum, IndexError>
fn datum<RIx: RowIndex, CIx: ColumnIndex>( &self, row_ix: RIx, col_ix: CIx ) -> Result<Datum, IndexError>
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>
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>
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,
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,
logp
where the likelihood are scaled by the column modes. Read moresource§fn draw<RIx: RowIndex, CIx: ColumnIndex, R: Rng>(
&self,
row_ix: RIx,
col_ix: CIx,
n: usize,
rng: &mut R
) -> Result<Vec<Datum>, IndexError>
fn draw<RIx: RowIndex, CIx: ColumnIndex, R: Rng>( &self, row_ix: RIx, col_ix: CIx, n: usize, rng: &mut R ) -> Result<Vec<Datum>, IndexError>
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>
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>
source§fn impute<RIx: RowIndex, CIx: ColumnIndex>(
&self,
row_ix: RIx,
col_ix: CIx,
with_uncertainty: bool
) -> Result<(Datum, Option<f64>), IndexError>
fn impute<RIx: RowIndex, CIx: ColumnIndex>( &self, row_ix: RIx, col_ix: CIx, with_uncertainty: bool ) -> Result<(Datum, Option<f64>), IndexError>
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>
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>
source§fn variability<Ix: ColumnIndex, GIx: ColumnIndex>(
&self,
col_ix: Ix,
given: &Given<GIx>,
state_ixs_opt: Option<&[usize]>
) -> Result<Variability, VariabilityError>
fn variability<Ix: ColumnIndex, GIx: ColumnIndex>( &self, col_ix: Ix, given: &Given<GIx>, state_ixs_opt: Option<&[usize]> ) -> Result<Variability, VariabilityError>
source§fn feature_error<Ix: ColumnIndex>(
&self,
col_ix: Ix
) -> Result<(f64, f64), IndexError>
fn feature_error<Ix: ColumnIndex>( &self, col_ix: Ix ) -> Result<(f64, f64), IndexError>
fn _logp_unchecked( &self, col_ixs: &[usize], vals: &[Vec<Datum>], given: &Given<usize>, state_ixs_opt: Option<&[usize]>, scaled: bool ) -> Vec<f64>
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>>
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
fn _dual_entropy(&self, col_a: usize, col_b: usize, n: usize) -> f64
source§fn _mi_components(&self, col_a: usize, col_b: usize, n: usize) -> MiComponents
fn _mi_components(&self, col_a: usize, col_b: usize, n: usize) -> MiComponents
source§fn _sobol_joint_entropy(&self, col_ixs: &[usize], n: usize) -> f64
fn _sobol_joint_entropy(&self, col_ixs: &[usize], n: usize) -> f64
fn _mc_joint_entropy<R: Rng>( &self, col_ixs: &[usize], n: usize, rng: &mut R ) -> f64
fn _entropy_unchecked(&self, col_ixs: &[usize], n: usize) -> f64
source§fn _impute_uncertainty(&self, row_ix: usize, col_ix: usize) -> f64
fn _impute_uncertainty(&self, row_ix: usize, col_ix: usize) -> f64
source§fn _predict_uncertainty(
&self,
col_ix: usize,
given: &Given<usize>,
state_ixs_opt: Option<&[usize]>
) -> f64
fn _predict_uncertainty( &self, col_ix: usize, given: &Given<usize>, state_ixs_opt: Option<&[usize]> ) -> f64
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read more§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).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.