CoolFace
Apppublic

NirmitSachde/Valorant-Match-Predictor

sourceHugging Facemitupdated 1y agoView on Hugging Face
0likes
App README

๐ŸŽฎ Valorant Match Predictor API

A comprehensive ML-powered prediction API for VALORANT esports matches.

๐Ÿš€ Features

  • โ€”Team Matchup Predictions: Head-to-head analysis with historical data
  • โ€”Player Synergy Calculations: Team chemistry and compatibility scores
  • โ€”Map Preference Analysis: Team performance on different maps
  • โ€”Role Composition Optimization: Best team compositions for each map
  • โ€”Agent Selection Recommendations: Optimal agent picks for players
  • โ€”Comprehensive Match Predictions: Multi-factor analysis with confidence scores

๐Ÿ“ก API Endpoints

Data Endpoints (GET)

  • โ€”/api/health - Health check
  • โ€”/api/data/teams - Get all teams with ratings
  • โ€”/api/data/players - Get all players with stats
  • โ€”/api/data/maps - Get available maps
  • โ€”/api/data/agents - Get agents by role
  • โ€”/api/data/rankings - Get current team rankings
  • โ€”/api/stats/team/{team_name} - Get detailed team statistics
  • โ€”/api/stats/player/{player_name} - Get detailed player statistics

Prediction Endpoints (POST)

  • โ€”/api/predict/matchup - Predict team vs team outcome
  • โ€”/api/predict/synergy - Calculate player synergy scores
  • โ€”/api/predict/map-preference - Get map advantages for teams
  • โ€”/api/predict/role-composition - Get optimal role distributions
  • โ€”/api/predict/agent-selection - Get agent recommendations
  • โ€”/api/predict/final - Generate comprehensive match prediction

๐Ÿ”ง Usage Example

javascript
// Predict a match
fetch('https://your-space.hf.space/api/predict/matchup', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    team_a: 'Sentinels',
    team_b: 'Gen.G'
  })
})
.then(res => res.json())
.then(data => console.log(data));

๐Ÿ“Š Response Format

json
{
  "win_probability": 0.52,
  "confidence": 0.85,
  "components": {
    "team_matchup": 0.48,
    "player_synergy": 0.55,
    "map_advantage": 0.51,
    "role_composition": 0.53,
    "agent_selection": 0.50,
    "individual_form": 0.54
  }
}

๐Ÿ› ๏ธ Technical Stack

  • โ€”Framework: FastAPI
  • โ€”ML Models: Scikit-learn (pickle format)
  • โ€”Data Processing: Pandas, NumPy
  • โ€”Server: Uvicorn
  • โ€”Deployment: Docker on Hugging Face Spaces

๐Ÿ“ˆ Model Components

  1. 1.Team Network Model: Analyzes team relationships and historical performance
  2. 2.Player Synergy Model: Evaluates player compatibility and team chemistry
  3. 3.Map Selection Model: Predicts map-specific advantages
  4. 4.Role Composition Model: Optimizes team role distributions
  5. 5.Agent Selection Model: Recommends optimal agent picks

๐Ÿ”— Frontend Integration

This API is designed to work with the Valorant Predictor React application.

CORS is enabled for all origins. For production, update the CORS settings in app.py:

python
app.add_middleware(
    CORSMiddleware,
    allow_origins=["https://your-frontend-domain.com"],
    allow_credentials=True,
    allow_methods=["*"],
    allow_headers=["*"],
)

๐Ÿ“ Environment Variables

  • โ€”HF_TOKEN: Hugging Face token for private model access (optional)
  • โ€”PORT: Server port (default: 7860)

๐Ÿšฆ Status

  • โ€”โœ… API Status: Active
  • โ€”โœ… Models Loaded: 5/5
  • โ€”โœ… Data Files: 12/12
  • โ€”โœ… Health Check: Passing

๐Ÿ“ง Contact

For issues or questions, please open an issue on the repository.


Built with โค๏ธ for the VALORANT esports community