Implement official PDGA rating calculation methodology

- Update predicted rating algorithm to match PDGA rating guide
- Focus on tournaments from last 12 months only (improved accuracy)
- Add proper outlier exclusion: rounds >2.5 std dev below average
- Implement double weighting for most recent 25% of rounds (9+ rounds)
- Apply PDGA minimum data requirements (7 rounds for outlier exclusion)
- Improve error handling and rate limiting for tournament scraping
- Add user-friendly error messages for failed calculations
- Reduce tournament scraping from 15 to 8 tournaments to avoid rate limits

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Samuel Enocsson
2025-08-12 16:58:00 +02:00
parent af54b30c6c
commit 55188a8269
2 changed files with 72 additions and 40 deletions
+3 -3
View File
@@ -315,7 +315,7 @@
const data = await response.json();
if (data.predictedRating) {
if (data.predictedRating && data.predictedRating > 0) {
predictedCell.textContent = data.predictedRating;
const currentRating = parseInt(document.querySelector(`#row-${pdgaNumber} .rating`).textContent);
@@ -326,8 +326,8 @@
diffCell.className = `difference ${diffClass}`;
diffCell.textContent = diffText;
} else {
predictedCell.textContent = 'Error';
diffCell.textContent = 'Error';
predictedCell.textContent = 'N/A';
diffCell.innerHTML = '<span style="color: #999; font-size: 12px;">Unable to calculate<br>(Try again later)</span>';
}
} catch (error) {