action-rules 2.0.0__tar.gz → 2.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. {action_rules-2.0.0 → action_rules-2.0.1}/PKG-INFO +3 -3
  2. {action_rules-2.0.0 → action_rules-2.0.1}/README.md +2 -2
  3. {action_rules-2.0.0 → action_rules-2.0.1}/pyproject.toml +1 -1
  4. {action_rules-2.0.0 → action_rules-2.0.1}/src/action_rules/__init__.py +1 -1
  5. {action_rules-2.0.0 → action_rules-2.0.1}/tests/test_action_rules.py +45 -0
  6. {action_rules-2.0.0 → action_rules-2.0.1}/LICENSE +0 -0
  7. {action_rules-2.0.0 → action_rules-2.0.1}/src/action_rules/action_rules.py +0 -0
  8. {action_rules-2.0.0 → action_rules-2.0.1}/src/action_rules/candidates/__init__.py +0 -0
  9. {action_rules-2.0.0 → action_rules-2.0.1}/src/action_rules/candidates/candidate_generator.py +0 -0
  10. {action_rules-2.0.0 → action_rules-2.0.1}/src/action_rules/cli.py +0 -0
  11. {action_rules-2.0.0 → action_rules-2.0.1}/src/action_rules/evaluation/__init__.py +0 -0
  12. {action_rules-2.0.0 → action_rules-2.0.1}/src/action_rules/evaluation/cv.py +0 -0
  13. {action_rules-2.0.0 → action_rules-2.0.1}/src/action_rules/evaluation/metrics.py +0 -0
  14. {action_rules-2.0.0 → action_rules-2.0.1}/src/action_rules/inference/__init__.py +0 -0
  15. {action_rules-2.0.0 → action_rules-2.0.1}/src/action_rules/inference/analytic.py +0 -0
  16. {action_rules-2.0.0 → action_rules-2.0.1}/src/action_rules/inference/base.py +0 -0
  17. {action_rules-2.0.0 → action_rules-2.0.1}/src/action_rules/inference/bayesian.py +0 -0
  18. {action_rules-2.0.0 → action_rules-2.0.1}/src/action_rules/inference/bootstrap.py +0 -0
  19. {action_rules-2.0.0 → action_rules-2.0.1}/src/action_rules/input/__init__.py +0 -0
  20. {action_rules-2.0.0 → action_rules-2.0.1}/src/action_rules/input/input.py +0 -0
  21. {action_rules-2.0.0 → action_rules-2.0.1}/src/action_rules/output/__init__.py +0 -0
  22. {action_rules-2.0.0 → action_rules-2.0.1}/src/action_rules/output/output.py +0 -0
  23. {action_rules-2.0.0 → action_rules-2.0.1}/src/action_rules/rules/__init__.py +0 -0
  24. {action_rules-2.0.0 → action_rules-2.0.1}/src/action_rules/rules/rules.py +0 -0
  25. {action_rules-2.0.0 → action_rules-2.0.1}/src/action_rules/visualization/__init__.py +0 -0
  26. {action_rules-2.0.0 → action_rules-2.0.1}/src/action_rules/visualization/plots.py +0 -0
  27. {action_rules-2.0.0 → action_rules-2.0.1}/tests/__init__.py +0 -0
  28. {action_rules-2.0.0 → action_rules-2.0.1}/tests/candidates/__init__.py +0 -0
  29. {action_rules-2.0.0 → action_rules-2.0.1}/tests/candidates/test_candidate_generator.py +0 -0
  30. {action_rules-2.0.0 → action_rules-2.0.1}/tests/evaluation/__init__.py +0 -0
  31. {action_rules-2.0.0 → action_rules-2.0.1}/tests/evaluation/test_action_rules_method.py +0 -0
  32. {action_rules-2.0.0 → action_rules-2.0.1}/tests/evaluation/test_cv.py +0 -0
  33. {action_rules-2.0.0 → action_rules-2.0.1}/tests/evaluation/test_metrics.py +0 -0
  34. {action_rules-2.0.0 → action_rules-2.0.1}/tests/inference/__init__.py +0 -0
  35. {action_rules-2.0.0 → action_rules-2.0.1}/tests/inference/test_analytic.py +0 -0
  36. {action_rules-2.0.0 → action_rules-2.0.1}/tests/inference/test_base.py +0 -0
  37. {action_rules-2.0.0 → action_rules-2.0.1}/tests/inference/test_bayesian.py +0 -0
  38. {action_rules-2.0.0 → action_rules-2.0.1}/tests/inference/test_bootstrap.py +0 -0
  39. {action_rules-2.0.0 → action_rules-2.0.1}/tests/input/__init__.py +0 -0
  40. {action_rules-2.0.0 → action_rules-2.0.1}/tests/input/test_input.py +0 -0
  41. {action_rules-2.0.0 → action_rules-2.0.1}/tests/output/__init__.py +0 -0
  42. {action_rules-2.0.0 → action_rules-2.0.1}/tests/output/test_output.py +0 -0
  43. {action_rules-2.0.0 → action_rules-2.0.1}/tests/rules/__init__.py +0 -0
  44. {action_rules-2.0.0 → action_rules-2.0.1}/tests/rules/test_rules.py +0 -0
  45. {action_rules-2.0.0 → action_rules-2.0.1}/tests/simulation/__init__.py +0 -0
  46. {action_rules-2.0.0 → action_rules-2.0.1}/tests/simulation/coverage_simulation.py +0 -0
  47. {action_rules-2.0.0 → action_rules-2.0.1}/tests/simulation/test_coverage_simulation.py +0 -0
  48. {action_rules-2.0.0 → action_rules-2.0.1}/tests/test_confidence_intervals.py +0 -0
  49. {action_rules-2.0.0 → action_rules-2.0.1}/tests/visualization/__init__.py +0 -0
  50. {action_rules-2.0.0 → action_rules-2.0.1}/tests/visualization/test_plot_data.py +0 -0
  51. {action_rules-2.0.0 → action_rules-2.0.1}/tests/visualization/test_plots.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: action-rules
3
- Version: 2.0.0
3
+ Version: 2.0.1
4
4
  Summary: The package for action rules mining using Action-Apriori (Apriori Modified for Action Rules Mining)..
5
5
  License: MIT
6
6
  License-File: LICENSE
@@ -101,9 +101,9 @@ target = 'Survived'
101
101
  min_stable_attributes = 2
102
102
  min_flexible_attributes = 1 # min 1
103
103
  min_undesired_support = 1
104
- min_undesired_confidence = 0.5 # min 0.5
104
+ min_undesired_confidence = 0.5
105
105
  min_desired_support = 1
106
- min_desired_confidence = 0.5 # min 0.5
106
+ min_desired_confidence = 0.5
107
107
  undesired_state = '0'
108
108
  desired_state = '1'
109
109
  # Action Rules Mining
@@ -48,9 +48,9 @@ target = 'Survived'
48
48
  min_stable_attributes = 2
49
49
  min_flexible_attributes = 1 # min 1
50
50
  min_undesired_support = 1
51
- min_undesired_confidence = 0.5 # min 0.5
51
+ min_undesired_confidence = 0.5
52
52
  min_desired_support = 1
53
- min_desired_confidence = 0.5 # min 0.5
53
+ min_desired_confidence = 0.5
54
54
  undesired_state = '0'
55
55
  desired_state = '1'
56
56
  # Action Rules Mining
@@ -1,7 +1,7 @@
1
1
  [tool]
2
2
  [tool.poetry]
3
3
  name = "action-rules"
4
- version = "2.0.0"
4
+ version = "2.0.1"
5
5
  homepage = "https://github.com/lukassykora/action-rules"
6
6
  description = "The package for action rules mining using Action-Apriori (Apriori Modified for Action Rules Mining).."
7
7
  authors = ["Lukas Sykora <lukas.sykora@vse.cz>"]
@@ -17,4 +17,4 @@ __all__ = [
17
17
  ]
18
18
  __author__ = """Lukas Sykora"""
19
19
  __email__ = 'lukas.sykora@vse.cz'
20
- __version__ = '2.0.0'
20
+ __version__ = '2.0.1'
@@ -675,3 +675,48 @@ def test_fit_uses_bfs_candidate_expansion(action_rules, monkeypatch):
675
675
  )
676
676
 
677
677
  assert visited_prefixes == [tuple(), ('a',), ('b',), ('a', 'a1')]
678
+
679
+
680
+ def test_mining_below_half_confidence():
681
+ """
682
+ Test that confidence thresholds below 0.5 are accepted and honoured.
683
+
684
+ The package does not enforce a lower bound on
685
+ ``min_undesired_confidence`` / ``min_desired_confidence``; mining must
686
+ therefore also return rules whose side confidences lie below 0.5.
687
+
688
+ Asserts
689
+ -------
690
+ Asserts that rules are mined with thresholds of 0.3 and that at least
691
+ one discovered rule has an undesired-side confidence below 0.5.
692
+ """
693
+ import json
694
+
695
+ df = pd.DataFrame(
696
+ {
697
+ 'A': ['x'] * 10,
698
+ 'F': ['a'] * 5 + ['b'] * 5,
699
+ 'T': ['u', 'u', 'd', 'd', 'd', 'd', 'd', 'd', 'd', 'u'],
700
+ }
701
+ )
702
+ ar = ActionRules(
703
+ min_stable_attributes=1,
704
+ min_flexible_attributes=1,
705
+ min_undesired_support=1,
706
+ min_undesired_confidence=0.3,
707
+ min_desired_support=1,
708
+ min_desired_confidence=0.3,
709
+ verbose=False,
710
+ )
711
+ ar.fit(
712
+ data=df,
713
+ stable_attributes=['A'],
714
+ flexible_attributes=['F'],
715
+ target='T',
716
+ target_undesired_state='u',
717
+ target_desired_state='d',
718
+ )
719
+ exported = json.loads(ar.get_rules().get_export_notation())
720
+ assert len(exported) > 0
721
+ undesired_confidences = [float(r['confidence of undesired part']) for r in exported]
722
+ assert any(c < 0.5 for c in undesired_confidences)
File without changes