Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Newfeatures #42

Closed
wants to merge 9 commits into from
Closed

Newfeatures #42

wants to merge 9 commits into from

Conversation

arplas
Copy link

@arplas arplas commented Aug 13, 2020

Hi !

I've added some new features for skope rules :

1) new filtering and deduplication criteria

  • added new parameter to SkopeRule class named "filtering_criteria" in place of recall_min et precision_min
filtering_criteria: dict, optional
                    default={'precision': 0.5, 'recall': 0.01}
    The criteria to be used for filtering the rules.
    In the form {criterion: min_value}.
    The keys can be among ('precision', 'recall', 'f1', 'mcc', 'myfunc').
  • added new parameter to SkopeRule class named "deduplication_criterion" in place of the default F1 score deduplication criterion which was used in deduplicate func
deduplication_criterion: str, optional (default='f1')
    The criterion to be used for deduplicating the rules.
    Either 'f1', 'mcc' or 'myfunc'.

"myfunc" being another new SkopeRule class parameter :

myfunc: FunctionType, optional (default=None)
    A personalised function that can be used as either/both a filtering
    or/and deduplication criterion.
    Has to take 4 parameters which are supposed to be the confusion matrix
    elements tn, fp, fn, tp (in that order).

2) Rounding of rule features values

  • native rounding function for rule's values (called round_rule) for more comprehensive rules.
Approximate the values of the features of a rule
according to a dict containing the features to round.

Arguments:
    rule: Rule
        Tuple containing the rule string and confusion matrix

    features_to_round: dict
        A dict containing the names of the quantitative features
        whose values are to be rounded.
        Should be in the form {var_name: power_of_ten_exponent}
        with types {str: int/float}.
        The power_of_ten_exponent should be an int
        (if float then rounded) either positive or negative.
        It is the exponent of the power of ten at which the value
        of the feature is rounded.

        example:
            - power_of_ten_exponent = 1 => 1357.914 becomes 1.36E+3
            - power_of_ten_exponent = 0 => 1357.914 becomes 1358
            - power_of_ten_exponent = -2 => 1357.914 becomes 1357.91

Returns:
    rounded rule: str
        A string representation of the rule with rounded features values.

Some issues that have been raised (but no merged) are also answered, such as :

@ngoix
Copy link
Member

ngoix commented Aug 30, 2020

thanks for the contribution, all of this look very exciting and very useful

could you please split this PR into different ones, so that each of them addresses a specific enhancement or fix?

@ngoix ngoix mentioned this pull request Dec 11, 2020
@arplas arplas closed this by deleting the head repository Jun 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants