InferableReasoning

Trait InferableReasoning 

Source
pub trait InferableReasoning<T>
where T: Inferable,
{
Show 16 methods // Required methods fn len(&self) -> usize; fn is_empty(&self) -> bool; fn get_all_items(&self) -> Vec<&T>; // Provided methods fn get_all_inferable(&self) -> Vec<&T> { ... } fn get_all_inverse_inferable(&self) -> Vec<&T> { ... } fn get_all_non_inferable(&self) -> Vec<&T> { ... } fn all_inferable(&self) -> bool { ... } fn all_inverse_inferable(&self) -> bool { ... } fn all_non_inferable(&self) -> bool { ... } fn conjoint_delta(&self) -> NumericalValue { ... } fn number_inferable(&self) -> NumericalValue { ... } fn number_inverse_inferable(&self) -> NumericalValue { ... } fn number_non_inferable(&self) -> NumericalValue { ... } fn percent_inferable(&self) -> NumericalValue { ... } fn percent_inverse_inferable(&self) -> NumericalValue { ... } fn percent_non_inferable(&self) -> NumericalValue { ... }
}
Expand description

Trait providing reasoning methods for collections of Inferable items.

Provides methods for:

  • Filtering inferable/non-inferable items
  • Checking if all items are inferable
  • Calculating inferability metrics
    • conjoint_delta
    • Counts
    • Percentages

Requires Inferable items that implement:

  • is_inferable()
  • is_inverse_inferable()

Provides default implementations using those methods.

Required Methods§

Source

fn len(&self) -> usize

Source

fn is_empty(&self) -> bool

Source

fn get_all_items(&self) -> Vec<&T>

Provided Methods§

Source

fn get_all_inferable(&self) -> Vec<&T>

Returns a vector containing all inferable items.

Filters the full set of items based on is_inferable().

Source

fn get_all_inverse_inferable(&self) -> Vec<&T>

Returns a vector containing all inverse inferable items.

Filters the full set of items based on is_inverse_inferable().

Source

fn get_all_non_inferable(&self) -> Vec<&T>

Returns a vector containing all non-inferable items.

An item is non-inferable if it is both inferable and inverse inferable, which makes it undecidable.

Filters the full set of items based on:

  • is_inferable()
  • is_inverse_inferable()
Source

fn all_inferable(&self) -> bool

Checks if all items in the collection are inferable.

Iterates through all items and checks is_inferable() on each.

Returns:

  • true if all items are inferable
  • false if any item is not inferable
Source

fn all_inverse_inferable(&self) -> bool

Checks if all items in the collection are inverse inferable.

Iterates through all items and checks is_inverse_inferable() on each.

Returns:

  • true if all items are inverse inferable
  • false if any item is not inverse inferable
Source

fn all_non_inferable(&self) -> bool

Checks if all items in the collection are non-inferable.

An item is non-inferable if it is both inferable and inverse inferable.

Iterates through all items and checks:

  • is_inferable()
  • is_inverse_inferable()

Returns:

  • true if any item is both inferable and inverse inferable
  • false if no items meet that criteria
Source

fn conjoint_delta(&self) -> NumericalValue

Estimates the ConJointDelta for this collection.

The conjoint delta represents the combined effect of unobserved factors and is used to determine the strength of the joint causal relationship.

It is calculated as the difference (delta) between the combined (joint) observation (conjecture) and a theoretical 100% if the conjecture were to explain all observations, hence the name ConJointDelta:

1.0 - (sum of observations / total items)

Where:

  • sum of observations = total items - non-inferable items
  • total items = length of the collection
  • non-inferable items = count of non-inferable items

Finally, the absolute value is taken.

The resulting value is interpreted as following:

Higher: THe higher the conjoint delta, the more unobserved factors are present and observed factors are not explaining the observation. Therefore, the joint causal relationship is weaker and doesn’t explain much of the observation.

Lower: The lower the conjoint delta, the more the observed factors explain the observation. Therefore, the joint causal relationship is stronger as it explains more of the observation.

Source

fn number_inferable(&self) -> NumericalValue

Counts the number of inferable items in the collection.

Filters all items based on is_inferable() and returns the count.

Source

fn number_inverse_inferable(&self) -> NumericalValue

Counts the number of inverse inferable items in the collection.

Filters all items based on is_inverse_inferable() and returns the count.

Source

fn number_non_inferable(&self) -> NumericalValue

Counts the number of non-inferable items in the collection.

An item is non-inferable if it is both inferable and inverse inferable.

Filters all items based on:

  • is_inferable()
  • is_inverse_inferable()

And returns the count.

Source

fn percent_inferable(&self) -> NumericalValue

Calculates the percentage of inferable items in the collection.

Divides the number of inferable items by the total length. Then multiplies by 100 to get a percentage.

Source

fn percent_inverse_inferable(&self) -> NumericalValue

Calculates the percentage of inverse inferable items in the collection.

Divides the number of inverse inferable items by the total length. Then multiplies by 100 to get a percentage.

Source

fn percent_non_inferable(&self) -> NumericalValue

Calculates the percentage of non-inferable items in the collection.

Divides the number of non-inferable items by the total length. Then multiplies by 100 to get a percentage.

Implementations on Foreign Types§

Source§

impl<K, V> InferableReasoning<V> for BTreeMap<K, V>
where K: Ord, V: Inferable,

Source§

fn len(&self) -> usize

Source§

fn is_empty(&self) -> bool

Source§

fn get_all_items(&self) -> Vec<&V>

Source§

impl<K, V> InferableReasoning<V> for HashMap<K, V>
where K: Eq + Hash, V: Inferable,

Source§

fn len(&self) -> usize

Source§

fn is_empty(&self) -> bool

Source§

fn get_all_items(&self) -> Vec<&V>

Source§

impl<T> InferableReasoning<T> for [T]
where T: Inferable,

Source§

fn len(&self) -> usize

Source§

fn is_empty(&self) -> bool

Source§

fn get_all_items(&self) -> Vec<&T>

Source§

impl<T> InferableReasoning<T> for VecDeque<T>
where T: Inferable,

Source§

fn len(&self) -> usize

Source§

fn is_empty(&self) -> bool

Source§

fn get_all_items(&self) -> Vec<&T>

Source§

impl<T> InferableReasoning<T> for Vec<T>
where T: Inferable,

Source§

fn len(&self) -> usize

Source§

fn is_empty(&self) -> bool

Source§

fn get_all_items(&self) -> Vec<&T>

Implementors§