%global _empty_manifest_terminate_build 0 Name: python-actionrules-lukassykora Version: 1.1.26 Release: 1 Summary: Action rules mining package License: MIT License URL: https://github.com/lukassykora/actionrules Source0: https://mirrors.nju.edu.cn/pypi/web/packages/f4/93/b1690f7d8083c26ee27c8d0454c763191a77a9f547b2b22ff1a329cec32b/actionrules-lukassykora-1.1.26.tar.gz BuildArch: noarch Requires: python3-pandas Requires: python3-numpy Requires: python3-pyfim %description # Action Rules [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) Action Rules (actionrules) is an implementation of Action Rules from Classification Rules algorithm described in ```Dardzinska, A. (2013). Action rules mining. Berlin: Springer.``` If you use this package, please cite: ```Sýkora, Lukáš, and Tomáš Kliegr. "Action Rules: Counterfactual Explanations in Python." RuleML Challenge 2020. CEUR-WS. ``` http://ceur-ws.org/Vol-2644/paper36.pdf ## GIT repository https://github.com/lukassykora/actionrules ## Installation pip install actionrules-lukassykora ## Jupyter Notebooks - [Titanic](https://github.com/lukassykora/actionrules/blob/master/notebooks/Titanic%20-%20Action%20Rules.ipynb) It is the best explanation of all possibilities. - [Telco](https://github.com/lukassykora/actionrules/blob/master/notebooks/Telco%20-%20Action%20Rules.ipynb) A brief demonstration. - [Ras](https://github.com/lukassykora/actionrules/blob/master/notebooks/Ras%20-%20Acton%20Rules.ipynb) Based on the example in (Ras, Zbigniew W and Wyrzykowska, ARAS: Action rules discovery based on agglomerative strategy, 2007). - [Attrition](https://github.com/lukassykora/actionrules/blob/master/notebooks/Employee%20Attrition%20-%20High%20Utility%20Action%20Rules.ipynb) High-Utility Action Rules Mining example. ## Example 1 Get data from csv. Get action rules from classification rules. Classification rules have confidence 55% and support 3%. Stable part of action rule is "Age". Flexible attributes are "Embarked", "Fare", "Pclass". Target is a Survived value 1.0. No nan values. Use reduction tables for speeding up. Minimal 1 stable antecedent Minimal 1 flexible antecedent ```python from actionrules.actionRulesDiscovery import ActionRulesDiscovery actionRulesDiscovery = ActionRulesDiscovery() actionRulesDiscovery.read_csv("data/titanic.csv", sep="\t") actionRulesDiscovery.fit(stable_attributes = ["Age"], flexible_attributes = ["Embarked", "Fare", "Pclass"], consequent = "Survived", conf=55, supp=3, desired_classes = ["1.0"], is_nan=False, is_reduction=True, min_stable_attributes=1, min_flexible_attributes=1, max_stable_attributes=5, max_flexible_attributes=5) actionRulesDiscovery.get_action_rules() ``` The output is a list where the first part is an action rule and the second part is a tuple of (support before, support after, action rule support) and (confidence before, confidence after, action rule confidence). ## Example 2 Get data from pandas dataframe. Get action rules from classification rules. Classification rules have confidence 50% and support 3%. Stable attributes are "Age" and "Sex". Flexible attributes are "Embarked", "Fare", "Pclass". Target is a Survived that changes from 0.0 to 1.0. No nan values. Use reduction tables for speeding up. Minimal 1 stable antecedent Minimal 1 flexible antecedent ```python from actionrules.actionRulesDiscovery import ActionRulesDiscovery import pandas as pd dataFrame = pd.read_csv("data/titanic.csv", sep="\t") actionRulesDiscovery = ActionRulesDiscovery() actionRulesDiscovery.load_pandas(dataFrame) actionRulesDiscovery.fit(stable_attributes = ["Age", "Sex"], flexible_attributes = ["Embarked", "Fare", "Pclass"], consequent = "Survived", conf=50, supp=3, desired_changes = [["0.0", "1.0"]], is_nan=False, is_reduction=True, min_stable_attributes=1, min_flexible_attributes=1, max_stable_attributes=5, max_flexible_attributes=5) actionRulesDiscovery.get_pretty_action_rules() ``` The output is a list of action rules in pretty text form. %package -n python3-actionrules-lukassykora Summary: Action rules mining package Provides: python-actionrules-lukassykora BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-pip %description -n python3-actionrules-lukassykora # Action Rules [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) Action Rules (actionrules) is an implementation of Action Rules from Classification Rules algorithm described in ```Dardzinska, A. (2013). Action rules mining. Berlin: Springer.``` If you use this package, please cite: ```Sýkora, Lukáš, and Tomáš Kliegr. "Action Rules: Counterfactual Explanations in Python." RuleML Challenge 2020. CEUR-WS. ``` http://ceur-ws.org/Vol-2644/paper36.pdf ## GIT repository https://github.com/lukassykora/actionrules ## Installation pip install actionrules-lukassykora ## Jupyter Notebooks - [Titanic](https://github.com/lukassykora/actionrules/blob/master/notebooks/Titanic%20-%20Action%20Rules.ipynb) It is the best explanation of all possibilities. - [Telco](https://github.com/lukassykora/actionrules/blob/master/notebooks/Telco%20-%20Action%20Rules.ipynb) A brief demonstration. - [Ras](https://github.com/lukassykora/actionrules/blob/master/notebooks/Ras%20-%20Acton%20Rules.ipynb) Based on the example in (Ras, Zbigniew W and Wyrzykowska, ARAS: Action rules discovery based on agglomerative strategy, 2007). - [Attrition](https://github.com/lukassykora/actionrules/blob/master/notebooks/Employee%20Attrition%20-%20High%20Utility%20Action%20Rules.ipynb) High-Utility Action Rules Mining example. ## Example 1 Get data from csv. Get action rules from classification rules. Classification rules have confidence 55% and support 3%. Stable part of action rule is "Age". Flexible attributes are "Embarked", "Fare", "Pclass". Target is a Survived value 1.0. No nan values. Use reduction tables for speeding up. Minimal 1 stable antecedent Minimal 1 flexible antecedent ```python from actionrules.actionRulesDiscovery import ActionRulesDiscovery actionRulesDiscovery = ActionRulesDiscovery() actionRulesDiscovery.read_csv("data/titanic.csv", sep="\t") actionRulesDiscovery.fit(stable_attributes = ["Age"], flexible_attributes = ["Embarked", "Fare", "Pclass"], consequent = "Survived", conf=55, supp=3, desired_classes = ["1.0"], is_nan=False, is_reduction=True, min_stable_attributes=1, min_flexible_attributes=1, max_stable_attributes=5, max_flexible_attributes=5) actionRulesDiscovery.get_action_rules() ``` The output is a list where the first part is an action rule and the second part is a tuple of (support before, support after, action rule support) and (confidence before, confidence after, action rule confidence). ## Example 2 Get data from pandas dataframe. Get action rules from classification rules. Classification rules have confidence 50% and support 3%. Stable attributes are "Age" and "Sex". Flexible attributes are "Embarked", "Fare", "Pclass". Target is a Survived that changes from 0.0 to 1.0. No nan values. Use reduction tables for speeding up. Minimal 1 stable antecedent Minimal 1 flexible antecedent ```python from actionrules.actionRulesDiscovery import ActionRulesDiscovery import pandas as pd dataFrame = pd.read_csv("data/titanic.csv", sep="\t") actionRulesDiscovery = ActionRulesDiscovery() actionRulesDiscovery.load_pandas(dataFrame) actionRulesDiscovery.fit(stable_attributes = ["Age", "Sex"], flexible_attributes = ["Embarked", "Fare", "Pclass"], consequent = "Survived", conf=50, supp=3, desired_changes = [["0.0", "1.0"]], is_nan=False, is_reduction=True, min_stable_attributes=1, min_flexible_attributes=1, max_stable_attributes=5, max_flexible_attributes=5) actionRulesDiscovery.get_pretty_action_rules() ``` The output is a list of action rules in pretty text form. %package help Summary: Development documents and examples for actionrules-lukassykora Provides: python3-actionrules-lukassykora-doc %description help # Action Rules [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) Action Rules (actionrules) is an implementation of Action Rules from Classification Rules algorithm described in ```Dardzinska, A. (2013). Action rules mining. Berlin: Springer.``` If you use this package, please cite: ```Sýkora, Lukáš, and Tomáš Kliegr. "Action Rules: Counterfactual Explanations in Python." RuleML Challenge 2020. CEUR-WS. ``` http://ceur-ws.org/Vol-2644/paper36.pdf ## GIT repository https://github.com/lukassykora/actionrules ## Installation pip install actionrules-lukassykora ## Jupyter Notebooks - [Titanic](https://github.com/lukassykora/actionrules/blob/master/notebooks/Titanic%20-%20Action%20Rules.ipynb) It is the best explanation of all possibilities. - [Telco](https://github.com/lukassykora/actionrules/blob/master/notebooks/Telco%20-%20Action%20Rules.ipynb) A brief demonstration. - [Ras](https://github.com/lukassykora/actionrules/blob/master/notebooks/Ras%20-%20Acton%20Rules.ipynb) Based on the example in (Ras, Zbigniew W and Wyrzykowska, ARAS: Action rules discovery based on agglomerative strategy, 2007). - [Attrition](https://github.com/lukassykora/actionrules/blob/master/notebooks/Employee%20Attrition%20-%20High%20Utility%20Action%20Rules.ipynb) High-Utility Action Rules Mining example. ## Example 1 Get data from csv. Get action rules from classification rules. Classification rules have confidence 55% and support 3%. Stable part of action rule is "Age". Flexible attributes are "Embarked", "Fare", "Pclass". Target is a Survived value 1.0. No nan values. Use reduction tables for speeding up. Minimal 1 stable antecedent Minimal 1 flexible antecedent ```python from actionrules.actionRulesDiscovery import ActionRulesDiscovery actionRulesDiscovery = ActionRulesDiscovery() actionRulesDiscovery.read_csv("data/titanic.csv", sep="\t") actionRulesDiscovery.fit(stable_attributes = ["Age"], flexible_attributes = ["Embarked", "Fare", "Pclass"], consequent = "Survived", conf=55, supp=3, desired_classes = ["1.0"], is_nan=False, is_reduction=True, min_stable_attributes=1, min_flexible_attributes=1, max_stable_attributes=5, max_flexible_attributes=5) actionRulesDiscovery.get_action_rules() ``` The output is a list where the first part is an action rule and the second part is a tuple of (support before, support after, action rule support) and (confidence before, confidence after, action rule confidence). ## Example 2 Get data from pandas dataframe. Get action rules from classification rules. Classification rules have confidence 50% and support 3%. Stable attributes are "Age" and "Sex". Flexible attributes are "Embarked", "Fare", "Pclass". Target is a Survived that changes from 0.0 to 1.0. No nan values. Use reduction tables for speeding up. Minimal 1 stable antecedent Minimal 1 flexible antecedent ```python from actionrules.actionRulesDiscovery import ActionRulesDiscovery import pandas as pd dataFrame = pd.read_csv("data/titanic.csv", sep="\t") actionRulesDiscovery = ActionRulesDiscovery() actionRulesDiscovery.load_pandas(dataFrame) actionRulesDiscovery.fit(stable_attributes = ["Age", "Sex"], flexible_attributes = ["Embarked", "Fare", "Pclass"], consequent = "Survived", conf=50, supp=3, desired_changes = [["0.0", "1.0"]], is_nan=False, is_reduction=True, min_stable_attributes=1, min_flexible_attributes=1, max_stable_attributes=5, max_flexible_attributes=5) actionRulesDiscovery.get_pretty_action_rules() ``` The output is a list of action rules in pretty text form. %prep %autosetup -n actionrules-lukassykora-1.1.26 %build %py3_build %install %py3_install install -d -m755 %{buildroot}/%{_pkgdocdir} if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi pushd %{buildroot} if [ -d usr/lib ]; then find usr/lib -type f -printf "\"/%h/%f\"\n" >> filelist.lst fi if [ -d usr/lib64 ]; then find usr/lib64 -type f -printf "\"/%h/%f\"\n" >> filelist.lst fi if [ -d usr/bin ]; then find usr/bin -type f -printf "\"/%h/%f\"\n" >> filelist.lst fi if [ -d usr/sbin ]; then find usr/sbin -type f -printf "\"/%h/%f\"\n" >> filelist.lst fi touch doclist.lst if [ -d usr/share/man ]; then find usr/share/man -type f -printf "\"/%h/%f.gz\"\n" >> doclist.lst fi popd mv %{buildroot}/filelist.lst . mv %{buildroot}/doclist.lst . %files -n python3-actionrules-lukassykora -f filelist.lst %dir %{python3_sitelib}/* %files help -f doclist.lst %{_docdir}/* %changelog * Thu Jun 08 2023 Python_Bot - 1.1.26-1 - Package Spec generated