Rules

Contains classes representing rules and rulesets.

class rulekit.rules.InductionParameters(java_object)

Induction parameters.

property induction_measure

Returns: Union[Measures, str]: Measure used for induction

property pruning_measure

Returns: Union[Measures, str]: Measure used for pruning

property voting_measure

Returns: Union[Measures, str]: Measure used for voting

class rulekit.rules.Rule(java_object)

Class representing single rule.

get_covering_information()dict

Returns information about rule covering

Returns:

covering_data – Dictionary containing covering information.

Return type:

dict

print_stats()

Prints rule statistics as formatted text.

property pvalue

Rule significance.

property stats

Rule statistics.

property weight

Rule weight

property weighted_N

Number of negatives in the training set (accounting weights).

property weighted_P

Number of positives in the training set (accounting weights).

property weighted_n

Number of negatives covered by the rule (accounting weights).

property weighted_p

Number of positives covered by the rule (accounting weights).

class rulekit.rules.RuleSet(java_object)

Class representing ruleset.

calculate_avg_rule_coverage()float
Returns:

count – Average rule coverage.

Return type:

float

calculate_avg_rule_precision()float
Returns:

count – Average rule precision.

Return type:

float

calculate_avg_rule_quality()float
Returns:

count – Average rule quality.

Return type:

float

calculate_conditions_count()float
Returns:

count – Number of conditions.

Return type:

float

calculate_induced_conditions_count()float
Returns:

count – Number of induced conditions.

Return type:

float

calculate_significance(alpha: float)dict
Parameters:

alpha (float) –

Returns:

count – Significance of the rule set.

Return type:

float

calculate_significance_fdr(alpha: float)dict
Returns:

count – Significance of the rule set with false discovery rate correction. Dictionary contains two fields: fraction (fraction of rules significant at assumed level) and p (average p-value of all rules).

Return type:

dict

calculate_significance_fwer(alpha: float)dict
Returns:

count – Significance of the rule set with familiy-wise error rate correction. Dictionary contains two fields: fraction (fraction of rules significant at assumed level) and p (average p-value of all rules).

Return type:

dict

property growing_time

Time of growing in seconds

property is_voting

Value indicating whether rules are voting.

property parameters

Parameters used during rule set induction.

property pruning_time

Time of pruning in seconds

property rules

List of rules objects.

property stats

Rule set statistics.

property total_time

Time of constructing the rule set in seconds