Welcome to miar’s documentation!¶
Contents:
Modules¶
- miar.measures.added_value(arr)[source]¶
The function calculates the added value of the rule. Based on the fourfold table of the rule.
- Parameters:
arr – A list of four non-negative integers representing the fourfold table of the rule.
- Returns:
The added value.
- Return type:
float
- Raises:
TypeError – If the input is not a list.
ValueError – If the list does not have exactly four non-negative integers.
ZeroDivisionError – If the input leads to division by zero.
- miar.measures.all_confidence(arr)[source]¶
The function calculates the all-confidence value of the rule. Based on the fourfold table of the rule.
- Parameters:
arr – A list of four non-negative integers representing the fourfold table of the rule.
- Returns:
The all-confidence value.
- Return type:
float
- Raises:
TypeError – If the input is not a list.
ValueError – If the list does not have exactly four non-negative integers.
ZeroDivisionError – If the input leads to division by zero.
- miar.measures.bi_confidence(arr)[source]¶
The function calculates the bi-confidence value of the rule. Based on the fourfold table of the rule.
- Parameters:
arr – A list of four non-negative integers representing the fourfold table of the rule.
- Returns:
The bi-confidence value.
- Return type:
float
- Raises:
TypeError – If the input is not a list.
ValueError – If the list does not have exactly four non-negative integers.
ZeroDivisionError – If the input leads to division by zero.
- miar.measures.bi_improve(arr)[source]¶
The function calculates the bi-improve value of the rule. Based on the fourfold table of the rule.
- Parameters:
arr – A list of four non-negative integers representing the fourfold table of the rule.
- Returns:
The bi-improve value.
- Return type:
float
- Raises:
TypeError – If the input is not a list.
ValueError – If the list does not have exactly four non-negative integers.
ZeroDivisionError – If the input leads to division by zero.
- miar.measures.bi_lift(arr)[source]¶
The function calculates the bi-lift value of the rule. Based on the fourfold table of the rule.
- Parameters:
arr – A list of four non-negative integers representing the fourfold table of the rule.
- Returns:
The bi-lift value.
- Return type:
float
- Raises:
TypeError – If the input is not a list.
ValueError – If the list does not have exactly four non-negative integers.
ZeroDivisionError – If the input leads to division by zero.
- miar.measures.certainty_factor(arr)[source]¶
The function calculates the certainty factor value of the rule. Based on the fourfold table of the rule.
- Parameters:
arr – A list of four non-negative integers representing the fourfold table of the rule.
- Returns:
The certainty factor value.
- Return type:
float
- Raises:
TypeError – If the input is not a list.
ValueError – If the list does not have exactly four non-negative integers.
ZeroDivisionError – If the input leads to division by zero.
- miar.measures.chi_square(arr)[source]¶
The function calculates the chi-square value of the rule. Based on the fourfold table of the rule.
- Parameters:
arr – A list of four non-negative integers representing the fourfold table of the rule.
- Returns:
The chi-square value.
- Return type:
float
- Raises:
TypeError – If the input is not a list.
ValueError – If the list does not have exactly four non-negative integers.
ZeroDivisionError – If the input leads to division by zero.
- miar.measures.clm_4ft_int_functions = {'added_value': <function added_value>, 'all_confidence': <function all_confidence>, 'bi_confidence': <function bi_confidence>, 'bi_improve': <function bi_improve>, 'bi_lift': <function bi_lift>, 'certainty_factor': <function certainty_factor>, 'chi_square': <function chi_square>, 'collective_strength': <function collective_strength>, 'complement_class_support': <function complement_class_support>, 'conditional_entropy': <function conditional_entropy>, 'confidence': <function confidence>, 'confidence_causal': <function confidence_causal>, 'confirm_causal': <function confirm_causal>, 'confirm_descriptive': <function confirm_descriptive>, 'confirmed_confidence_causal': <function confirmed_confidence_causal>, 'confirmed_confidence_descriptive': <function confirmed_confidence_descriptive>, 'conviction': <function conviction>, 'correlation_all_confidence': <function correlation_all_confidence>, 'correlation_coefficient': <function correlation_coefficient>, 'correlation_confidence': <function correlation_confidence>, 'correlation_jaccard': <function correlation_jaccard>, 'correlation_kappa': <function correlation_kappa>, 'coverage': <function coverage>, 'example_counterexample_rate': <function example_counterexample_rate>, 'gini_index': <function gini_index>, 'information_gain': <function information_gain>, 'j_measure': <function j_measure>, 'jaccard': <function jaccard>, 'kappa': <function kappa>, 'klosgen': <function klosgen>, 'kulczynski_1': <function kulczynski_1>, 'kulczynski_2': <function kulczynski_2>, 'laplace_correction': <function laplace_correction>, 'least_contradiction': <function least_contradiction>, 'leverage': <function leverage>, 'lift': <function lift>, 'mutual_information': <function mutual_information>, 'normalized_mutual_information': <function normalized_mutual_information>, 'odd_multiplier': <function odd_multiplier>, 'odds_ratio': <function odds_ratio>, 'one_way_support': <function one_way_support>, 'piatetsky_shapiro': <function piatetsky_shapiro>, 'prevalence': <function prevalence>, 'recall': <function recall>, 'sebag_schoenauer': <function sebag_schoenauer>, 'support': <function support>, 'support_causal': <function support_causal>, 'theil_uncertainty_coefficient': <function theil_uncertainty_coefficient>, 'two_way_support': <function two_way_support>, 'validity': <function validity>, 'yule_q': <function yule_q>, 'yule_y': <function yule_y>, 'zhang': <function zhang>}¶
Dictionary of all measure functions included in this package.
Each key is the name of a measure as a string. Each value is a function that calculates the measure.
Example
clm_4ft_int_functions[“support”]([30, 10, 20, 40]) -> 0.3
- miar.measures.collective_strength(arr)[source]¶
The function calculates the collective strength value of the rule. Based on the fourfold table of the rule.
- Parameters:
arr – A list of four non-negative integers representing the fourfold table of the rule.
- Returns:
The collective strength value.
- Return type:
float
- Raises:
TypeError – If the input is not a list.
ValueError – If the list does not have exactly four non-negative integers.
ZeroDivisionError – If the input leads to division by zero.
- miar.measures.complement_class_support(arr)[source]¶
The function calculates the complement class support value of the rule. Based on the fourfold table of the rule.
- Parameters:
arr – A list of four non-negative integers representing the fourfold table of the rule.
- Returns:
The complement class support value.
- Return type:
float
- Raises:
TypeError – If the input is not a list.
ValueError – If the list does not have exactly four non-negative integers.
ZeroDivisionError – If the input leads to division by zero.
- miar.measures.conditional_entropy(arr)[source]¶
The function calculates the conditional entropy value of the rule. Based on the fourfold table of the rule.
- Parameters:
arr – A list of four non-negative integers representing the fourfold table of the rule.
- Returns:
The conditional entropy value.
- Return type:
float
- Raises:
TypeError – If the input is not a list.
ValueError – If the list does not have exactly four non-negative integers.
ValueError – If the input leads to logarithm of a non-positive integer.
ZeroDivisionError – If the input leads to division by zero.
- miar.measures.confidence(arr)[source]¶
The function calculates the confidence value of the rule. Based on the fourfold table of the rule.
- Parameters:
arr – A list of four non-negative integers representing the fourfold table of the rule.
- Returns:
The confidence value.
- Return type:
float
- Raises:
TypeError – If the input is not a list.
ValueError – If the list does not have exactly four non-negative integers.
ZeroDivisionError – If the input leads to division by zero.
- miar.measures.confidence_causal(arr)[source]¶
The function calculates the confidence causal value of the rule. Based on the fourfold table of the rule.
- Parameters:
arr – A list of four non-negative integers representing the fourfold table of the rule.
- Returns:
The confidence causal value.
- Return type:
float
- Raises:
TypeError – If the input is not a list.
ValueError – If the list does not have exactly four non-negative integers.
ZeroDivisionError – If the input leads to division by zero.
- miar.measures.confirm_causal(arr)[source]¶
The function calculates the confirm causal value of the rule. Based on the fourfold table of the rule.
- Parameters:
arr – A list of four non-negative integers representing the fourfold table of the rule.
- Returns:
The confirm causal value.
- Return type:
float
- Raises:
TypeError – If the input is not a list.
ValueError – If the list does not have exactly four non-negative integers.
ZeroDivisionError – If the input leads to division by zero.
- miar.measures.confirm_descriptive(arr)[source]¶
The function calculates the confirm descriptive value of the rule. Based on the fourfold table of the rule.
- Parameters:
arr – A list of four non-negative integers representing the fourfold table of the rule.
- Returns:
The confirm descriptive value.
- Return type:
float
- Raises:
TypeError – If the input is not a list.
ValueError – If the list does not have exactly four non-negative integers.
ZeroDivisionError – If the input leads to division by zero.
- miar.measures.confirmed_confidence_causal(arr)[source]¶
The function calculates the confirmed confidence causal value of the rule. Based on the fourfold table of the rule.
- Parameters:
arr – A list of four non-negative integers representing the fourfold table of the rule.
- Returns:
The confirmed confidence causal value.
- Return type:
float
- Raises:
TypeError – If the input is not a list.
ValueError – If the list does not have exactly four non-negative integers.
ZeroDivisionError – If the input leads to division by zero.
- miar.measures.confirmed_confidence_descriptive(arr)[source]¶
The function calculates the confirmed confidence descriptive value of the rule. Based on the fourfold table of the rule.
- Parameters:
arr – A list of four non-negative integers representing the fourfold table of the rule.
- Returns:
The confirmed confidence descriptive value.
- Return type:
float
- Raises:
TypeError – If the input is not a list.
ValueError – If the list does not have exactly four non-negative integers.
ZeroDivisionError – If the input leads to division by zero.
- miar.measures.conviction(arr)[source]¶
The function calculates the conviction value of the rule. Based on the fourfold table of the rule.
- Parameters:
arr – A list of four non-negative integers representing the fourfold table of the rule.
- Returns:
The conviction value.
- Return type:
float
- Raises:
TypeError – If the input is not a list.
ValueError – If the list does not have exactly four non-negative integers.
ZeroDivisionError – If the input leads to division by zero.
- miar.measures.correlation_all_confidence(arr)[source]¶
The function calculates the correlation all-confidence value of the rule. Based on the fourfold table of the rule.
- Parameters:
arr – A list of four non-negative integers representing the fourfold table of the rule.
- Returns:
The correlation all-confidence value.
- Return type:
float
- Raises:
TypeError – If the input is not a list.
ValueError – If the list does not have exactly four non-negative integers.
ZeroDivisionError – If the input leads to division by zero.
- miar.measures.correlation_coefficient(arr)[source]¶
The function calculates the correlation coefficient value of the rule. Based on the fourfold table of the rule.
- Parameters:
arr – A list of four non-negative integers representing the fourfold table of the rule.
- Returns:
The correlation coefficient value.
- Return type:
float
- Raises:
TypeError – If the input is not a list.
ValueError – If the list does not have exactly four non-negative integers.
ZeroDivisionError – If the input leads to division by zero.
- miar.measures.correlation_confidence(arr)[source]¶
The function calculates the correlation confidence value of the rule. Based on the fourfold table of the rule.
- Parameters:
arr – A list of four non-negative integers representing the fourfold table of the rule.
- Returns:
The correlation confidence value.
- Return type:
float
- Raises:
TypeError – If the input is not a list.
ValueError – If the list does not have exactly four non-negative integers.
ZeroDivisionError – If the input leads to division by zero.
- miar.measures.correlation_jaccard(arr)[source]¶
The function calculates the correlation jaccard value of the rule. Based on the fourfold table of the rule.
- Parameters:
arr – A list of four non-negative integers representing the fourfold table of the rule.
- Returns:
The correlation jaccard value.
- Return type:
float
- Raises:
TypeError – If the input is not a list.
ValueError – If the list does not have exactly four non-negative integers.
ZeroDivisionError – If the input leads to division by zero.
- miar.measures.correlation_kappa(arr)[source]¶
The function calculates the correlation kappa value of the rule. Based on the fourfold table of the rule.
- Parameters:
arr – A list of four non-negative integers representing the fourfold table of the rule.
- Returns:
The correlation kappa value.
- Return type:
float
- Raises:
TypeError – If the input is not a list.
ValueError – If the list does not have exactly four non-negative integers.
ZeroDivisionError – If the input leads to division by zero.
- miar.measures.coverage(arr)[source]¶
The function calculates the coverage value of the rule. Based on the fourfold table of the rule.
- Parameters:
arr – A list of four non-negative integers representing the fourfold table of the rule.
- Returns:
The coverage value.
- Return type:
float
- Raises:
TypeError – If the input is not a list.
ValueError – If the list does not have exactly four non-negative integers.
ZeroDivisionError – If the input leads to division by zero.
- miar.measures.example_counterexample_rate(arr)[source]¶
The function calculates the example-counterexample rate value of the rule. Based on the fourfold table of the rule.
- Parameters:
arr – A list of four non-negative integers representing the fourfold table of the rule.
- Returns:
The example-counterexample rate value.
- Return type:
float
- Raises:
TypeError – If the input is not a list.
ValueError – If the list does not have exactly four non-negative integers.
ZeroDivisionError – If the input leads to division by zero.
- miar.measures.gini_index(arr)[source]¶
The function calculates the Gini index value of the rule. Based on the fourfold table of the rule.
- Parameters:
arr – A list of four non-negative integers representing the fourfold table of the rule.
- Returns:
The Gini index value.
- Return type:
float
- Raises:
TypeError – If the input is not a list.
ValueError – If the list does not have exactly four non-negative integers.
ZeroDivisionError – If the input leads to division by zero.
- miar.measures.information_gain(arr)[source]¶
The function calculates the information gain value of the rule. Based on the fourfold table of the rule.
- Parameters:
arr – A list of four non-negative integers representing the fourfold table of the rule.
- Returns:
The information gain value.
- Return type:
float
- Raises:
TypeError – If the input is not a list.
ValueError – If the list does not have exactly four non-negative integers.
ValueError – If the input leads to logarithm of a non-positive integer.
ZeroDivisionError – If the input leads to division by zero.
- miar.measures.j_measure(arr)[source]¶
The function calculates the J-measure value of the rule. Based on the fourfold table of the rule.
- Parameters:
arr – A list of four non-negative integers representing the fourfold table of the rule.
- Returns:
The J-measure value.
- Return type:
float
- Raises:
TypeError – If the input is not a list.
ValueError – If the list does not have exactly four non-negative integers.
ValueError – If the input leads to logarithm of non-positive integer.
ZeroDivisionError – If the input leads to division by zero.
- miar.measures.jaccard(arr)[source]¶
The function calculates the Jaccard value of the rule. Based on the fourfold table of the rule.
- Parameters:
arr – A list of four non-negative integers representing the fourfold table of the rule.
- Returns:
The Jaccard value.
- Return type:
float
- Raises:
TypeError – If the input is not a list.
ValueError – If the list does not have exactly four non-negative integers.
ZeroDivisionError – If the input leads to division by zero.
- miar.measures.kappa(arr)[source]¶
The function calculates the kappa value of the rule. Based on the fourfold table of the rule.
- Parameters:
arr – A list of four non-negative integers representing the fourfold table of the rule.
- Returns:
The kappa value.
- Return type:
float
- Raises:
TypeError – If the input is not a list.
ValueError – If the list does not have exactly four non-negative integers.
ZeroDivisionError – If the input leads to division by zero.
- miar.measures.klosgen(arr)[source]¶
The function calculates the Klösgen value of the rule. Based on the fourfold table of the rule.
- Parameters:
arr – A list of four non-negative integers representing the fourfold table of the rule.
- Returns:
The Klösgen value.
- Return type:
float
- Raises:
TypeError – If the input is not a list.
ValueError – If the list does not have exactly four non-negative integers.
ZeroDivisionError – If the input leads to division by zero.
- miar.measures.kulczynski_1(arr)[source]¶
The function calculates the Kulczynski 1 value of the rule. Based on the fourfold table of the rule.
- Parameters:
arr – A list of four non-negative integers representing the fourfold table of the rule.
- Returns:
The Kulczynski 1 value.
- Return type:
float
- Raises:
TypeError – If the input is not a list.
ValueError – If the list does not have exactly four non-negative integers.
ZeroDivisionError – If the input leads to division by zero.
- miar.measures.kulczynski_2(arr)[source]¶
The function calculates the Kulczynski 2 value of the rule. Based on the fourfold table of the rule.
- Parameters:
arr – A list of four non-negative integers representing the fourfold table of the rule.
- Returns:
The Kulczynski 2 value.
- Return type:
float
- Raises:
TypeError – If the input is not a list.
ValueError – If the list does not have exactly four non-negative integers.
ZeroDivisionError – If the input leads to division by zero.
- miar.measures.laplace_correction(arr, k=None)[source]¶
The function calculates the Laplace correction value of the rule. Based on the fourfold table of the rule.
- Parameters:
arr – A list of four non-negative integers representing the fourfold table of the rule.
k – A parameter representing number of classes, default value = 2
- Returns:
The Laplace correction value.
- Return type:
float
- Raises:
TypeError – If the input is not a list.
ValueError – If the list does not have exactly four non-negative integers.
ZeroDivisionError – If the input leads to division by zero.
- miar.measures.least_contradiction(arr)[source]¶
The function calculates the Least contradiction value of the rule. Based on the fourfold table of the rule.
- Parameters:
arr – A list of four non-negative integers representing the fourfold table of the rule.
- Returns:
The Least contradiction value.
- Return type:
float
- Raises:
TypeError – If the input is not a list.
ValueError – If the list does not have exactly four non-negative integers.
ZeroDivisionError – If the input leads to division by zero.
- miar.measures.leverage(arr)[source]¶
The function calculates the leverage value of the rule. Based on the fourfold table of the rule.
- Parameters:
arr – A list of four non-negative integers representing the fourfold table of the rule.
- Returns:
The leverage value.
- Return type:
float
- Raises:
TypeError – If the input is not a list.
ValueError – If the list does not have exactly four non-negative integers.
ZeroDivisionError – If the input leads to division by zero.
- miar.measures.lift(arr)[source]¶
The function calculates the lift value of the rule. Based on the fourfold table of the rule.
- Parameters:
arr – A list of four non-negative integers representing the fourfold table of the rule.
- Returns:
The lift value.
- Return type:
float
- Raises:
TypeError – If the input is not a list.
ValueError – If the list does not have exactly four non-negative integers.
ZeroDivisionError – If the input leads to division by zero.
- miar.measures.mutual_information(arr)[source]¶
The function calculates the mutual information value of the rule. Based on the fourfold table of the rule.
- Parameters:
arr – A list of four non-negative integers representing the fourfold table of the rule.
- Returns:
The mutual information value.
- Return type:
float
- Raises:
TypeError – If the input is not a list.
ValueError – If the list does not have exactly four non-negative integers.
ValueError – If the input leads to logarithm of a non-positive integer.
ZeroDivisionError – If the input leads to division by zero.
- miar.measures.normalized_mutual_information(arr)[source]¶
The function calculates the normalized mutual information value of the rule. Based on the fourfold table of the rule.
- Parameters:
arr – A list of four non-negative integers representing the fourfold table of the rule.
- Returns:
The normalized mutual information value.
- Return type:
float
- Raises:
TypeError – If the input is not a list.
ValueError – If the list does not have exactly four non-negative integers.
ValueError – If the input leads to logarithm of a non-positive integer.
ZeroDivisionError – If the input leads to division by zero.
- miar.measures.odd_multiplier(arr)[source]¶
The function calculates the odd multiplier value of the rule. Based on the fourfold table of the rule.
- Parameters:
arr – A list of four non-negative integers representing the fourfold table of the rule.
- Returns:
The odd multiplier value.
- Return type:
float
- Raises:
TypeError – If the input is not a list.
ValueError – If the list does not have exactly four non-negative integers.
ZeroDivisionError – If the input leads to division by zero.
- miar.measures.odds_ratio(arr)[source]¶
The function calculates the odds ratio value of the rule. Based on the fourfold table of the rule.
- Parameters:
arr – A list of four non-negative integers representing the fourfold table of the rule.
- Returns:
The odds ratio value.
- Return type:
float
- Raises:
TypeError – If the input is not a list.
ValueError – If the list does not have exactly four non-negative integers.
ZeroDivisionError – If the input leads to division by zero.
- miar.measures.one_way_support(arr)[source]¶
The function calculates the one-way-support value of the rule. Based on the fourfold table of the rule.
- Parameters:
arr – A list of four non-negative integers representing the fourfold table of the rule.
- Returns:
The one-way-support value.
- Return type:
float
- Raises:
TypeError – If the input is not a list.
ValueError – If the list does not have exactly four non-negative integers.
ValueError – If the input leads to logarithm of non-positive integer.
ZeroDivisionError – If the input leads to division by zero.
- miar.measures.piatetsky_shapiro(arr)[source]¶
The function calculates the Piatetsky-Shapiro value of the rule. Based on the fourfold table of the rule.
- Parameters:
arr – A list of four non-negative integers representing the fourfold table of the rule.
- Returns:
The Piatetsky-Shapiro value.
- Return type:
float
- Raises:
TypeError – If the input is not a list.
ValueError – If the list does not have exactly four non-negative integers.
ZeroDivisionError – If the input leads to division by zero.
- miar.measures.prevalence(arr)[source]¶
The function calculates the prevalence value of the rule. Based on the fourfold table of the rule.
- Parameters:
arr – A list of four non-negative integers representing the fourfold table of the rule.
- Returns:
The prevalence value.
- Return type:
float
- Raises:
TypeError – If the input is not a list.
ValueError – If the list does not have exactly four non-negative integers.
ZeroDivisionError – If the input leads to division by zero.
- miar.measures.recall(arr)[source]¶
The function calculates the recall value of the rule. Based on the fourfold table of the rule.
- Parameters:
arr – A list of four non-negative integers representing the fourfold table of the rule.
- Returns:
The recall value.
- Return type:
float
- Raises:
TypeError – If the input is not a list.
ValueError – If the list does not have exactly four non-negative integers.
ZeroDivisionError – If the input leads to division by zero.
- miar.measures.sebag_schoenauer(arr)[source]¶
The function calculates the Sebag-Schoenauer value of the rule. Based on the fourfold table of the rule.
- Parameters:
arr – A list of four non-negative integers representing the fourfold table of the rule.
- Returns:
The Sebag-Schoenauer value.
- Return type:
float
- Raises:
TypeError – If the input is not a list.
ValueError – If the list does not have exactly four non-negative integers.
ZeroDivisionError – If the input leads to division by zero.
- miar.measures.support(arr)[source]¶
The function calculates the support value of the rule. Based on the fourfold table of the rule.
- Parameters:
arr – A list of four non-negative integers representing the fourfold table of the rule.
- Returns:
The support value.
- Return type:
float
- Raises:
TypeError – If the input is not a list.
ValueError – If the list does not have exactly four non-negative integers.
ZeroDivisionError – If the input leads to division by zero.
- miar.measures.support_causal(arr)[source]¶
The function calculates the support causal value of the rule. Based on the fourfold table of the rule.
- Parameters:
arr – A list of four non-negative integers representing the fourfold table of the rule.
- Returns:
The support causal value.
- Return type:
float
- Raises:
TypeError – If the input is not a list.
ValueError – If the list does not have exactly four non-negative integers.
ZeroDivisionError – If the input leads to division by zero.
- miar.measures.theil_uncertainty_coefficient(arr)[source]¶
The function calculates the Theil uncertainty coefficient value of the rule. Based on the fourfold table of the rule.
- Parameters:
arr – A list of four non-negative integers representing the fourfold table of the rule.
- Returns:
The Theil uncertainty coefficient value.
- Return type:
float
- Raises:
TypeError – If the input is not a list.
ValueError – If the list does not have exactly four non-negative integers.
ValueError – If the input leads to logarithm of a non-positive integer.
ZeroDivisionError – If the input leads to division by zero.
- miar.measures.two_way_support(arr)[source]¶
The function calculates the two-way-support value of the rule. Based on the fourfold table of the rule.
- Parameters:
arr – A list of four non-negative integers representing the fourfold table of the rule.
- Returns:
The two-way-support value.
- Return type:
float
- Raises:
TypeError – If the input is not a list.
ValueError – If the list does not have exactly four non-negative integers.
ValueError – If the input leads to logarithm of non-positive integer.
ZeroDivisionError – If the input leads to division by zero.
- miar.measures.validity(arr)[source]¶
The function calculates the Validity value of the rule. Based on the fourfold table of the rule.
- Parameters:
arr – A list of four non-negative integers representing the fourfold table of the rule.
- Returns:
The Validity value.
- Return type:
float
- Raises:
TypeError – If the input is not a list.
ValueError – If the list does not have exactly four non-negative integers.
ZeroDivisionError – If the input leads to division by zero.
- miar.measures.yule_q(arr)[source]¶
The function calculates the Yule’s Q value of the rule. Based on the fourfold table of the rule.
- Parameters:
arr – A list of four non-negative integers representing the fourfold table of the rule.
- Returns:
The Yule’s Q value.
- Return type:
float
- Raises:
TypeError – If the input is not a list.
ValueError – If the list does not have exactly four non-negative integers.
ZeroDivisionError – If the input leads to division by zero.
- miar.measures.yule_y(arr)[source]¶
The function calculates the Yule’s Y value of the rule. Based on the fourfold table of the rule.
- Parameters:
arr – A list of four non-negative integers representing the fourfold table of the rule.
- Returns:
The Yule’s Y value.
- Return type:
float
- Raises:
TypeError – If the input is not a list.
ValueError – If the list does not have exactly four non-negative integers.
ZeroDivisionError – If the input leads to division by zero.
- miar.measures.zhang(arr)[source]¶
The function calculates the Zhang value of the rule. Based on the fourfold table of the rule.
- Parameters:
arr – A list of four non-negative integers representing the fourfold table of the rule.
- Returns:
The Zhang value.
- Return type:
float
- Raises:
TypeError – If the input is not a list.
ValueError – If the list does not have exactly four non-negative integers.
ZeroDivisionError – If the input leads to division by zero.