Skip to content

Commit

Permalink
UI changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kuharan committed Apr 27, 2018
1 parent 431cd15 commit 4f9642a
Show file tree
Hide file tree
Showing 8 changed files with 260 additions and 161 deletions.
342 changes: 223 additions & 119 deletions .idea/workspace.xml

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions DataCleaning.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import csv
import json

import pandas as pd

# Read the file Matches Data set.
def read_csv() -> list:
with open('./Dataset/matches.csv', newline='') as rawFile:
def read_csv(src) -> list:
with open(file=src, newline='') as rawFile:
reader = csv.reader(rawFile)
# for row in reader:
# print(row)
Expand Down Expand Up @@ -50,7 +50,7 @@ def replace_matched_items(word_list, dictionary):


if "__main__" == __name__:
matches_list = read_csv()
matches_list = read_csv('./Dataset/matches.csv')
# create a team name list
team_list = []
city_list = []
Expand All @@ -68,7 +68,7 @@ def replace_matched_items(word_list, dictionary):
team_dict = {}
for i in range(len(team_list)):
team_dict[team_list[i]] = var1[i]
print(team_dict)
# print(team_dict)
with open('./jsonDumps/team_dict.json', 'w') as outfile:
json.dump(team_dict, outfile)

Expand Down
11 changes: 11 additions & 0 deletions Dataset/ipl_winners.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Year, Winner
2008, Rajasthan Royals
2009, Deccan Charger
2010, Chennai Super Kings
2011, Chennai Super Kings
2012, Kolkata Knight Riders
2013, Mumbai Indians
2014, Kolkata Knight Riders
2015, Mumbai Indians
2016, Sunrisers Hyderabad
2017, Mumbai Indians
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ These instructions will get you a copy of the project up and running on your loc
```
Pandas, sklearn, sklearn.tree, model_selection, DecisionTreeClassifier, csv, Flask, BeautifulSoup, requests, json
```
_List of all the packages that have been used in this project are freezed into requirements.txt file._
_List of all the packages that have been used in this project are freezed into [requirements.txt](requirements.txt) file._
## We are Live on Heroku!
* [Link1](https://ipl2018prediction.herokuapp.com/)
* [Link2](https://iplprediction2018.herokuapp.com/)
Expand Down
Empty file added favicon.ico
Empty file.
2 changes: 1 addition & 1 deletion jsonDumps/city_dict.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"Sharjah": 30, "Cuttack": 22, "Mumbai": 6, "East London": 17, "Centurion": 16, "Bangalore": 5, "Visakhapatnam": 26, "Port Elizabeth": 14, "Kolkata": 7, "Rajkot": 3, "Chennai": 12, "Kochi": 25, "Raipur": 27, "Cape Town": 13, "Durban": 15, "Kanpur": 10, "Ranchi": 28, "Kimberley": 19, "Bloemfontein": 20, "Dubai": 31, "Nagpur": 23, "Jaipur": 11, "Delhi": 8, "Abu Dhabi": 29, "Pune": 2, "Johannesburg": 18, "Hyderabad": 1, "Dharamshala": 24, "Chandigarh": 9, "Ahmedabad": 21, "Indore": 4}
{"Hyderabad": 1, "Pune": 2, "Rajkot": 3, "Indore": 4, "Bangalore": 5, "Mumbai": 6, "Kolkata": 7, "Delhi": 8, "Chandigarh": 9, "Kanpur": 10, "Jaipur": 11, "Chennai": 12, "Cape Town": 13, "Port Elizabeth": 14, "Durban": 15, "Centurion": 16, "East London": 17, "Johannesburg": 18, "Kimberley": 19, "Bloemfontein": 20, "Ahmedabad": 21, "Cuttack": 22, "Nagpur": 23, "Dharamshala": 24, "Kochi": 25, "Visakhapatnam": 26, "Raipur": 27, "Ranchi": 28, "Abu Dhabi": 29, "Sharjah": 30, "Dubai": 31}
2 changes: 1 addition & 1 deletion jsonDumps/team_dict.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"Rising Pune Supergiant": 4, "Kochi Tuskers Kerala": 12, "Pune Warriors": 13, "Delhi Daredevils": 7, "Mumbai Indians": 2, "Sunrisers Hyderabad": 1, "Rajasthan Royals": 10, "Kings XI Punjab": 8, "Deccan Chargers": 11, "Chennai Super Kings": 9, "Rising Pune Supergiants": 14, "Kolkata Knight Riders": 6, "Gujarat Lions": 3, "Royal Challengers Bangalore": 5}
{"Sunrisers Hyderabad": 1, "Mumbai Indians": 2, "Gujarat Lions": 3, "Rising Pune Supergiant": 4, "Royal Challengers Bangalore": 5, "Kolkata Knight Riders": 6, "Delhi Daredevils": 7, "Kings XI Punjab": 8, "Chennai Super Kings": 9, "Rajasthan Royals": 10, "Deccan Chargers": 11, "Kochi Tuskers Kerala": 12, "Pune Warriors": 13, "Rising Pune Supergiants": 14}
52 changes: 18 additions & 34 deletions templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ <h1>IPL Match Prediction </h1>
{% for message in messages %}
{% if "Error" not in message[1]: %}
<div class="flash-msg" role="alert" align="center" style="font-size: xx-large;color: lawngreen;font-style: normal;font-family: unset;font-weight: initial;align-items: stretch;">
<strong>Result : </strong> {{ message[1] }}
<strong></strong> {{ message[1] }}
</div>
{% endif %}
{% if "Error" in message[1]: %}
Expand All @@ -47,37 +47,12 @@ <h1>IPL Match Prediction </h1>
{% endwith %}
<form action="/submit" method=post onsubmit="">
<h3 class="sub-heading-agileits">Match Details</h3>
<!--<div class="main-flex-w3ls-sectns">
<div class="field-agileinfo-spc form-w3-agile-text1">
<input type="text" name="Name" placeholder="First Name" required="">
</div>
<div class="field-agileinfo-spc form-w3-agile-text2">
<input type="text" name="Name" placeholder="Last Name" required="">
</div>
</div>

<div class="main-flex-w3ls-sectns">
<div class="field-agileinfo-spc form-w3-agile-text1">
<input type="email" name="Email" placeholder="Email" required="">
</div>
<div class="field-agileinfo-spc form-w3-agile-text2">
<input type="text" name="Phone no" placeholder="Phone Number" required="">
</div>
</div>
-->
<div class="main-flex-w3ls-sectns">
<div class="field-agileinfo-spc form-w3-agile-text1">
<!--<div class="field-agileinfo-spc form-w3-agile-text1">
<input id="datepicker" name="Text" type="text" placeholder="Date of the Match" value="" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'mm/dd/yyyy';}"
required="">
</div>
<div class="field-agileinfo-spc form-w3-agile-text2">
<select class="form-control" name="tossWinner" id="toss" onmousedown="whichTeamHasWonToss()">
<option selected disabled>Which Team Has Won The Toss</option>

</select>
</div>
</div>
<div class="main-flex-w3ls-sectns">
</div>-->
<div class="field-agileinfo-spc form-w3-agile-text1">
<select class="form-control" id="homeId" name="homeTeam" onchange="getStadium(this.value); checkSameTeam(this.value); ">
<option selected disabled>Home Team</option>
Expand All @@ -91,12 +66,6 @@ <h3 class="sub-heading-agileits">Match Details</h3>
<option value="Hyderabad">SRH</option>
</select>
</div>
<div class="field-agileinfo-spc form-w3-agile-text2">
<input type="text" name="city" id="city" readonly/>
</select>
</div>
</div>
<div class="main-flex-w3ls-sectns">
<div class="field-agileinfo-spc form-w3-agile-text1">
<select class="form-control" id="awayId" name="awayTeam" onchange="checkSameTeam(this.value); ">
<option selected disabled hidden>Away Team</option>
Expand All @@ -110,6 +79,21 @@ <h3 class="sub-heading-agileits">Match Details</h3>
<option value="Hyderabad">SRH</option>
</select>
</div>
<div class="field-agileinfo-spc form-w3-agile-text1">
<select class="form-control" name="tossWinner" id="toss" onmousedown="whichTeamHasWonToss()">
<option selected disabled>Which Team Has Won The Toss</option>
</select>
</div>
</div>
<div class="main-flex-w3ls-sectns">

<div class="field-agileinfo-spc form-w3-agile-text1">
<input type="text" name="city" id="city" readonly/>
</select>
</div>
</div>
<div class="main-flex-w3ls-sectns">

</div>
<div class="radio-section">
<h6>Toss Decision?</h6>
Expand Down

0 comments on commit 4f9642a

Please sign in to comment.