Skip to content

Commit fa3b006

Browse files
authored
Merge pull request #34 from mu373/random-seed-update
Validation with tail-estimation
2 parents e205f0a + e65dfa7 commit fa3b006

File tree

7 files changed

+1984
-3
lines changed

7 files changed

+1984
-3
lines changed

README.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,60 @@ from tailestim import TailData
132132
data = TailData(name='dataset_name').data
133133
```
134134

135+
## Testing
136+
137+
The package includes comprehensive test suites to ensure correctness and numerical accuracy.
138+
139+
### Running Tests
140+
141+
Run the test suite using pytest:
142+
```bash
143+
pytest tests/
144+
```
145+
146+
For verbose output:
147+
```bash
148+
pytest tests/ -v
149+
```
150+
151+
### Test Structure
152+
153+
#### Unit Tests
154+
Located in `tests/test_*.py`, these tests verify:
155+
- Individual estimator functionality (Hill, Moments, Kernel, Pickands)
156+
- Noise generation and random seed handling
157+
- Edge cases and error handling
158+
- Result data structures and attributes
159+
160+
#### Validation Tests
161+
`tests/test_tailestimation_validation.py` provides cross-package validation against the original [tail-estimation](https://github.com/ivanvoitalov/tail-estimation) implementation:
162+
- Validates numerical equivalence for each estimator (Hill, Moments, Kernel, Pickands)
163+
- Comprehensive multi-dataset validation across all estimators
164+
- Reproducibility tests with various random seeds
165+
- Plot data comparison (PDF, CCDF, bootstrap AMSE)
166+
167+
The validation tests ensure that `tailestim` produces **identical results** to the original implementation when using the same `base_seed` parameter.
168+
169+
**Example datasets tested:**
170+
- CAIDA_KONECT (26,475 samples)
171+
- Libimseti_in_KONECT (168,791 samples)
172+
- Pareto distributions (synthetic, various sizes)
173+
- Complete graphs (synthetic): produces error in both cases, as intended
174+
175+
Run validation tests:
176+
```bash
177+
pytest tests/test_tailestimation_validation.py -v
178+
```
179+
180+
Run quick validation (smaller datasets):
181+
```bash
182+
pytest tests/test_tailestimation_validation.py -k "quick" -v
183+
```
184+
185+
### Interactive Validation
186+
187+
The [`examples/validation.ipynb`](examples/validation.ipynb) notebook provides an interactive demonstration of the validation process with visualizations comparing `tailestim` and `tail-estimation` outputs side-by-side.
188+
135189
## References
136190
- I. Voitalov, P. van der Hoorn, R. van der Hofstad, and D. Krioukov. Scale-free networks well done. *Phys. Rev. Res.*, Oct. 2019, doi: [10.1103/PhysRevResearch.1.033034](https://doi.org/10.1103/PhysRevResearch.1.033034).
137191
- I. Voitalov. `ivanvoitalov/tail-estimation`, GitHub. Mar. 2018. [https://github.com/ivanvoitalov/tail-estimation](https://github.com/ivanvoitalov/tail-estimation).

0 commit comments

Comments
 (0)