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§
fn len(&self) -> usize
fn is_empty(&self) -> bool
fn get_all_items(&self) -> Vec<&T>
Provided Methods§
Sourcefn get_all_inferable(&self) -> Vec<&T>
fn get_all_inferable(&self) -> Vec<&T>
Returns a vector containing all inferable items.
Filters the full set of items based on is_inferable().
Sourcefn get_all_inverse_inferable(&self) -> Vec<&T>
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().
Sourcefn get_all_non_inferable(&self) -> Vec<&T>
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()
Sourcefn all_inferable(&self) -> bool
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
Sourcefn all_inverse_inferable(&self) -> bool
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
Sourcefn all_non_inferable(&self) -> bool
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
Sourcefn conjoint_delta(&self) -> NumericalValue
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.
Sourcefn number_inferable(&self) -> NumericalValue
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.
Sourcefn number_inverse_inferable(&self) -> NumericalValue
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.
Sourcefn number_non_inferable(&self) -> NumericalValue
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.
Sourcefn percent_inferable(&self) -> NumericalValue
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.
Sourcefn percent_inverse_inferable(&self) -> NumericalValue
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.
Sourcefn percent_non_inferable(&self) -> NumericalValue
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.