{"id":24543639,"url":"https://github.com/aditya-ranjan1234/ipl-winpredictor","last_synced_at":"2025-06-28T08:32:24.350Z","repository":{"id":242112370,"uuid":"808714958","full_name":"Aditya-Ranjan1234/IPL-WinPredictor","owner":"Aditya-Ranjan1234","description":"Enter Team Names , Target , Runs etc and get Win Percentage ","archived":false,"fork":false,"pushed_at":"2024-06-02T19:07:53.000Z","size":1903,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-16T07:44:45.333Z","etag":null,"topics":["aiml","beginner","ml"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Aditya-Ranjan1234.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-31T16:54:15.000Z","updated_at":"2024-12-22T05:21:30.000Z","dependencies_parsed_at":"2024-05-31T18:37:12.484Z","dependency_job_id":"c8260004-d7eb-458b-ae8f-439a85c128c8","html_url":"https://github.com/Aditya-Ranjan1234/IPL-WinPredictor","commit_stats":null,"previous_names":["aditya-ranjan1234/ipl_winpredictor","aditya-ranjan1234/ipl-winpredictor"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Aditya-Ranjan1234/IPL-WinPredictor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aditya-Ranjan1234%2FIPL-WinPredictor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aditya-Ranjan1234%2FIPL-WinPredictor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aditya-Ranjan1234%2FIPL-WinPredictor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aditya-Ranjan1234%2FIPL-WinPredictor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Aditya-Ranjan1234","download_url":"https://codeload.github.com/Aditya-Ranjan1234/IPL-WinPredictor/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aditya-Ranjan1234%2FIPL-WinPredictor/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262400775,"owners_count":23305367,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aiml","beginner","ml"],"created_at":"2025-01-22T20:14:35.904Z","updated_at":"2025-06-28T08:32:24.333Z","avatar_url":"https://github.com/Aditya-Ranjan1234.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# IPL_WinPredictor\n\n## Project Overview\n\nIPL_WinPredictor is a machine learning project designed to predict the probability of a team winning or losing a match in the Indian Premier League (IPL). Using historical IPL data from 2008 to 2019, the model analyzes various factors such as team performance, match conditions, and current match status to provide real-time win/loss probabilities during a game.\n\n## Dataset\n\nThe dataset used for this project includes IPL match data from 2008 to 2019. The dataset consists of various features such as:\n\n- `match_id`: Unique identifier for each match\n- `batting_team`: The team currently batting\n- `bowling_team`: The team currently bowling\n- `city`: The city where the match is being played\n- `runs_left`: Runs required to win the match\n- `balls_left`: Balls remaining in the innings\n- `wickets`: Wickets lost by the batting team\n- `total_runs_x`: Target runs set by the opponent team\n- `crr`: Current run rate\n- `rrr`: Required run rate\n\n## Model\n\nThe model used in this project is RandomForestClassifier that predicts the win/loss probabilities for the batting team. The model is trained on historical IPL data and uses features such as current score, overs completed, wickets lost, and match location to make predictions.\n\n### Features\n\n- **batting_team**: The team currently batting.\n- **bowling_team**: The team currently bowling.\n- **city**: The city where the match is being played.\n- **runs_left**: The number of runs left to achieve the target.\n- **balls_left**: The number of balls left in the innings.\n- **wickets**: The number of wickets remaining for the batting team.\n- **total_runs_x**: The target score set by the opponent team.\n- **crr**: Current run rate of the batting team.\n- **rrr**: Required run rate to achieve the target.\n\n## Usage\n\n## Run app.py on terminal\n\n    ```\n    streamlit run app.py\n    ```\n\n**Prepare Input Data**: Prepare a DataFrame with the input features as shown in the example below:\n\n    # Sample input data\n    batting_team = 'Chennai Super Kings'\n    bowling_team = 'Mumbai Indians'\n    selected_city = 'Mumbai'\n    target = 180\n    score = 12\n    overs = 2.2\n\n    # Calculations\n    runs_left = target - score\n    balls_left = 120 - (int(overs) * 6 + (overs - int(overs)) * 10)\n    wickets = 10 - 2  # Assuming 2 wickets down\n    crr = score / overs\n    rrr = (runs_left * 6) / balls_left\n\n    # Create DataFrame\n    temp_df = pd.DataFrame({\n        'batting_team': [batting_team],\n        'bowling_team': [bowling_team],\n        'city': [selected_city],\n        'runs_left': [runs_left],\n        'balls_left': [balls_left],\n        'wickets': [wickets],\n        'total_runs_x': [target],\n        'crr': [crr],\n        'rrr': [rrr]\n    })\n\n    # Load the model (assuming pipe is the trained model)\n    result = pipe.predict_proba(temp_df)\n\n    # Add predicted probabilities to DataFrame\n    temp_df['lose'] = np.round(result.T[0] * 100, 1)\n    temp_df['win'] = np.round(result.T[1] * 100, 1)\n\n    # Display the results\n    temp_df = temp_df[['lose', 'win']]\n    print(temp_df)\n    ```\n\n**Interpret the Results**: The output DataFrame will provide the probabilities of winning and losing for the batting team.\n\n## Dependencies\n\n- Python 3.x\n- pandas\n- numpy\n- scikit-learn (or other machine learning libraries used for training the model)\n\n## Installation\n\nClone the repository:\n    ```\n    git clone https://github.com/Aditya-Ranjan1234/IPL_WinPredictor.git\n    ```\n\n## Credits\n\nThis code was originally created by CampusX (@campusx-official). \\\nVarious other models have been added and modified.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faditya-ranjan1234%2Fipl-winpredictor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faditya-ranjan1234%2Fipl-winpredictor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faditya-ranjan1234%2Fipl-winpredictor/lists"}