tpattern 0.1.0__tar.gz → 0.1.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 (31) hide show
  1. {tpattern-0.1.0/tpattern.egg-info → tpattern-0.1.1}/PKG-INFO +7 -2
  2. {tpattern-0.1.0 → tpattern-0.1.1}/README.md +6 -1
  3. {tpattern-0.1.0 → tpattern-0.1.1}/pyproject.toml +1 -1
  4. {tpattern-0.1.0 → tpattern-0.1.1}/tpattern/__init__.py +1 -1
  5. {tpattern-0.1.0 → tpattern-0.1.1}/tpattern/advisor.py +47 -1
  6. {tpattern-0.1.0 → tpattern-0.1.1/tpattern.egg-info}/PKG-INFO +7 -2
  7. {tpattern-0.1.0 → tpattern-0.1.1}/LICENSE +0 -0
  8. {tpattern-0.1.0 → tpattern-0.1.1}/setup.cfg +0 -0
  9. {tpattern-0.1.0 → tpattern-0.1.1}/tests/test_calibrated_pins.py +0 -0
  10. {tpattern-0.1.0 → tpattern-0.1.1}/tests/test_contrast.py +0 -0
  11. {tpattern-0.1.0 → tpattern-0.1.1}/tests/test_dedup.py +0 -0
  12. {tpattern-0.1.0 → tpattern-0.1.1}/tests/test_guided.py +0 -0
  13. {tpattern-0.1.0 → tpattern-0.1.1}/tests/test_reproduction.py +0 -0
  14. {tpattern-0.1.0 → tpattern-0.1.1}/tests/test_synthetic.py +0 -0
  15. {tpattern-0.1.0 → tpattern-0.1.1}/tpattern/ci.py +0 -0
  16. {tpattern-0.1.0 → tpattern-0.1.1}/tpattern/contrast.py +0 -0
  17. {tpattern-0.1.0 → tpattern-0.1.1}/tpattern/detect.py +0 -0
  18. {tpattern-0.1.0 → tpattern-0.1.1}/tpattern/diagnostics.py +0 -0
  19. {tpattern-0.1.0 → tpattern-0.1.1}/tpattern/guided.py +0 -0
  20. {tpattern-0.1.0 → tpattern-0.1.1}/tpattern/io.py +0 -0
  21. {tpattern-0.1.0 → tpattern-0.1.1}/tpattern/methods.py +0 -0
  22. {tpattern-0.1.0 → tpattern-0.1.1}/tpattern/pattern.py +0 -0
  23. {tpattern-0.1.0 → tpattern-0.1.1}/tpattern/randomise.py +0 -0
  24. {tpattern-0.1.0 → tpattern-0.1.1}/tpattern/report.py +0 -0
  25. {tpattern-0.1.0 → tpattern-0.1.1}/tpattern/significance.py +0 -0
  26. {tpattern-0.1.0 → tpattern-0.1.1}/tpattern/synthetic.py +0 -0
  27. {tpattern-0.1.0 → tpattern-0.1.1}/tpattern/viz.py +0 -0
  28. {tpattern-0.1.0 → tpattern-0.1.1}/tpattern.egg-info/SOURCES.txt +0 -0
  29. {tpattern-0.1.0 → tpattern-0.1.1}/tpattern.egg-info/dependency_links.txt +0 -0
  30. {tpattern-0.1.0 → tpattern-0.1.1}/tpattern.egg-info/requires.txt +0 -0
  31. {tpattern-0.1.0 → tpattern-0.1.1}/tpattern.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tpattern
3
- Version: 0.1.0
3
+ Version: 0.1.1
4
4
  Summary: Open, auditable temporal & sequential pattern analysis (T-patterns) for sport and behaviour
5
5
  Author-email: Andrew Callaway <acallaway@bournemouth.ac.uk>
6
6
  License: MIT
@@ -75,7 +75,12 @@ model and clear reporting:
75
75
 
76
76
  ## Installation
77
77
 
78
- From source (until published on PyPI):
78
+ ```bash
79
+ pip install tpattern
80
+ ```
81
+
82
+ Add the guided-wizard extras with `pip install tpattern[gui]`. To work from source
83
+ instead (for development or to run the reproduction scripts and shipped data):
79
84
 
80
85
  ```bash
81
86
  git clone https://github.com/ajcallaway/TPattern.git
@@ -39,7 +39,12 @@ model and clear reporting:
39
39
 
40
40
  ## Installation
41
41
 
42
- From source (until published on PyPI):
42
+ ```bash
43
+ pip install tpattern
44
+ ```
45
+
46
+ Add the guided-wizard extras with `pip install tpattern[gui]`. To work from source
47
+ instead (for development or to run the reproduction scripts and shipped data):
43
48
 
44
49
  ```bash
45
50
  git clone https://github.com/ajcallaway/TPattern.git
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "tpattern"
7
- version = "0.1.0"
7
+ version = "0.1.1"
8
8
  description = "Open, auditable temporal & sequential pattern analysis (T-patterns) for sport and behaviour"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
@@ -19,7 +19,7 @@ from .methods import methods_text
19
19
  from .guided import run_analysis, launch
20
20
  from .contrast import group_contrast, contrast_items
21
21
 
22
- __version__ = "0.1.0"
22
+ __version__ = "0.1.1"
23
23
 
24
24
  __all__ = [
25
25
  "Observation", "read_observation", "read_sample", "read_table",
@@ -191,5 +191,51 @@ def recommend(observations, *, min_count: int = 15,
191
191
  evidence={"n_obs": n_obs},
192
192
  )
193
193
 
194
+ # --- Frequent-event exclusion (a detection-time choice; matches Config.freq_exclude) ---
195
+ # A near-ubiquitous event type links to almost everything, so it acts as a universal
196
+ # connector and inflates the pattern hierarchy. The default excludes any type whose mean
197
+ # occurrences per observation exceed 1.50 from *building* patterns (they stay in Level 0).
198
+ # This is consequential, so the advisor surfaces it rather than leaving it a silent default.
199
+ threshold = 1.50
200
+ totals: dict[str, int] = {}
201
+ for o in observations:
202
+ for _, ev in o.events:
203
+ totals[ev] = totals.get(ev, 0) + 1
204
+ means = {ev: totals[ev] / n_obs for ev in totals} if n_obs else {}
205
+ frequent = sorted((ev for ev, m in means.items() if m > threshold),
206
+ key=lambda e: -means[e])
207
+ if frequent:
208
+ lst = ", ".join(f"{e} ({means[e]:.2f}/obs)" for e in frequent)
209
+ freq_choice = Choice(
210
+ "Frequent-event exclusion",
211
+ f"exclude {len(frequent)} type(s) from pattern-building (default)",
212
+ rationale=(f"{len(frequent)} event type(s) occur more than {threshold} times per "
213
+ f"observation on average and are excluded by default from building "
214
+ f"multi-event patterns (they remain in the Level-0 univariate set): "
215
+ f"{lst}. Excluding a near-ubiquitous event stops it acting as a universal "
216
+ f"connector and inflating the hierarchy; retaining it "
217
+ f"(Config(exclude_events=[]), or a higher freq_exclude) keeps its "
218
+ f"connector patterns at the cost of combinatorial growth. Because this "
219
+ f"materially changes the pattern set, it is reported here rather than "
220
+ f"applied silently."),
221
+ plain=("<b>Very common events are set aside from pattern-building.</b> An event that "
222
+ "happens many times in almost every sequence (here: " + ", ".join(frequent) +
223
+ ") links to nearly everything, so leaving it in would flood the results with "
224
+ "patterns that are really just 'this common event, then anything'. By default "
225
+ "we keep such events in the counts but not in the built patterns. <i>Why it "
226
+ "matters:</i> it keeps the patterns meaningful; if that event is central to "
227
+ "your question you can choose to keep it in."),
228
+ evidence={"threshold": threshold, "frequent": {e: means[e] for e in frequent}},
229
+ )
230
+ else:
231
+ freq_choice = Choice(
232
+ "Frequent-event exclusion", "none needed",
233
+ rationale=(f"No event type exceeds {threshold} occurrences per observation on "
234
+ f"average, so none is excluded from pattern-building."),
235
+ plain=("No single event is common enough to swamp the patterns, so every event type "
236
+ "is kept in the analysis."),
237
+ evidence={"threshold": threshold, "frequent": {}},
238
+ )
239
+
194
240
  return Recommendation(n_obs=n_obs, n_events=n_events,
195
- choices=[null_choice, lag_choice, err_choice])
241
+ choices=[freq_choice, null_choice, lag_choice, err_choice])
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tpattern
3
- Version: 0.1.0
3
+ Version: 0.1.1
4
4
  Summary: Open, auditable temporal & sequential pattern analysis (T-patterns) for sport and behaviour
5
5
  Author-email: Andrew Callaway <acallaway@bournemouth.ac.uk>
6
6
  License: MIT
@@ -75,7 +75,12 @@ model and clear reporting:
75
75
 
76
76
  ## Installation
77
77
 
78
- From source (until published on PyPI):
78
+ ```bash
79
+ pip install tpattern
80
+ ```
81
+
82
+ Add the guided-wizard extras with `pip install tpattern[gui]`. To work from source
83
+ instead (for development or to run the reproduction scripts and shipped data):
79
84
 
80
85
  ```bash
81
86
  git clone https://github.com/ajcallaway/TPattern.git
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes