all teams

This commit is contained in:
s460941 2020-06-09 19:57:26 +02:00
parent 7d3410874e
commit db152210e7
5 changed files with 3268 additions and 833 deletions

View File

@ -4,6 +4,9 @@
<list default="true" id="0fc070d1-3753-43f5-b5e7-37c2bc110b95" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/main.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/matches_list.csv" beforeDir="false" afterPath="$PROJECT_DIR$/matches_list.csv" afterDir="false" />
<change beforePath="$PROJECT_DIR$/teams_list.csv" beforeDir="false" afterPath="$PROJECT_DIR$/teams_list.csv" afterDir="false" />
<change beforePath="$PROJECT_DIR$/worker.fcl" beforeDir="false" afterPath="$PROJECT_DIR$/worker.fcl" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -89,31 +92,57 @@
<screen x="67" y="27" width="1533" height="873" />
</state>
<state x="291" y="120" key="#com.intellij.execution.impl.EditConfigurationsDialog/67.27.1533.873/1600.0.1920.1080@67.27.1533.873" timestamp="1591713379914" />
<state width="1510" height="284" key="GridCell.Tab.0.bottom" timestamp="1591715422110">
<state width="1510" height="272" key="GridCell.Tab.0.bottom" timestamp="1591725393594">
<screen x="67" y="27" width="1533" height="873" />
</state>
<state width="1510" height="284" key="GridCell.Tab.0.bottom/67.27.1533.873/1600.0.1920.1080@67.27.1533.873" timestamp="1591715422110" />
<state width="1510" height="284" key="GridCell.Tab.0.center" timestamp="1591715422110">
<state width="1510" height="272" key="GridCell.Tab.0.bottom/67.27.1533.873/1600.0.1920.1080@67.27.1533.873" timestamp="1591725393594" />
<state width="1510" height="272" key="GridCell.Tab.0.center" timestamp="1591725393594">
<screen x="67" y="27" width="1533" height="873" />
</state>
<state width="1510" height="284" key="GridCell.Tab.0.center/67.27.1533.873/1600.0.1920.1080@67.27.1533.873" timestamp="1591715422110" />
<state width="1510" height="284" key="GridCell.Tab.0.left" timestamp="1591715422110">
<state width="1510" height="272" key="GridCell.Tab.0.center/67.27.1533.873/1600.0.1920.1080@67.27.1533.873" timestamp="1591725393594" />
<state width="1510" height="272" key="GridCell.Tab.0.left" timestamp="1591725393594">
<screen x="67" y="27" width="1533" height="873" />
</state>
<state width="1510" height="284" key="GridCell.Tab.0.left/67.27.1533.873/1600.0.1920.1080@67.27.1533.873" timestamp="1591715422110" />
<state width="1510" height="284" key="GridCell.Tab.0.right" timestamp="1591715422110">
<state width="1510" height="272" key="GridCell.Tab.0.left/67.27.1533.873/1600.0.1920.1080@67.27.1533.873" timestamp="1591725393594" />
<state width="1510" height="272" key="GridCell.Tab.0.right" timestamp="1591725393594">
<screen x="67" y="27" width="1533" height="873" />
</state>
<state width="1510" height="284" key="GridCell.Tab.0.right/67.27.1533.873/1600.0.1920.1080@67.27.1533.873" timestamp="1591715422110" />
<state width="1510" height="272" key="GridCell.Tab.0.right/67.27.1533.873/1600.0.1920.1080@67.27.1533.873" timestamp="1591725393594" />
<state width="1510" height="272" key="GridCell.Tab.1.bottom" timestamp="1591725393594">
<screen x="67" y="27" width="1533" height="873" />
</state>
<state width="1510" height="272" key="GridCell.Tab.1.bottom/67.27.1533.873/1600.0.1920.1080@67.27.1533.873" timestamp="1591725393594" />
<state width="1510" height="272" key="GridCell.Tab.1.center" timestamp="1591725393594">
<screen x="67" y="27" width="1533" height="873" />
</state>
<state width="1510" height="272" key="GridCell.Tab.1.center/67.27.1533.873/1600.0.1920.1080@67.27.1533.873" timestamp="1591725393594" />
<state width="1510" height="272" key="GridCell.Tab.1.left" timestamp="1591725393594">
<screen x="67" y="27" width="1533" height="873" />
</state>
<state width="1510" height="272" key="GridCell.Tab.1.left/67.27.1533.873/1600.0.1920.1080@67.27.1533.873" timestamp="1591725393594" />
<state width="1510" height="272" key="GridCell.Tab.1.right" timestamp="1591725393594">
<screen x="67" y="27" width="1533" height="873" />
</state>
<state width="1510" height="272" key="GridCell.Tab.1.right/67.27.1533.873/1600.0.1920.1080@67.27.1533.873" timestamp="1591725393594" />
<state x="376" y="181" width="904" height="562" key="com.intellij.xdebugger.impl.breakpoints.ui.BreakpointsDialogFactory$2" timestamp="1591723368763">
<screen x="67" y="27" width="1533" height="873" />
</state>
<state x="376" y="181" width="904" height="562" key="com.intellij.xdebugger.impl.breakpoints.ui.BreakpointsDialogFactory$2/67.27.1533.873/1600.0.1920.1080@67.27.1533.873" timestamp="1591723368763" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
<breakpoints>
<line-breakpoint enabled="true" suspend="THREAD" type="python-line">
<url>file://$PROJECT_DIR$/main.py</url>
<line>38</line>
<line>40</line>
<option name="timeStamp" value="5" />
</line-breakpoint>
<line-breakpoint enabled="true" suspend="THREAD" type="python-line">
<condition expression="i==627" language="Python" />
<url>file://$PROJECT_DIR$/main.py</url>
<line>10</line>
<option name="timeStamp" value="13" />
</line-breakpoint>
</breakpoints>
</breakpoint-manager>
<watches-manager>

16
main.py
View File

@ -5,18 +5,20 @@ import pandas as pd
teams = pd.read_csv('teams_list.csv')
matches = pd.read_csv('matches_list.csv')
not_in_df = ['Miedź Legnica','Zagłębie Sosnowiec']
not_in_df = ['Podbeskidzie']
matches_input = []
for i in range(0,293):
for i in range(0,matches.shape[0]):
team1 = matches['Team1'][i][:-1]
team2 = matches['Team2'][i][1:-1]
gameweek = matches['Gameweek'][i]
if((team1 not in not_in_df) and (team2 not in not_in_df)):
try:
form_1 = teams.loc[ (teams['Team'] == team1) & (teams['Gameweek'] == gameweek)].Form.values[0]
temp_1 = teams.loc[ (teams['Team'] == team1) & (teams['Gameweek'] == gameweek)].Points.values[0]
form_2 = teams.loc[ (teams['Team'] == team2) & (teams['Gameweek'] == gameweek)].Form.values[0]
temp_2 = teams.loc[ (teams['Team'] == team2) & (teams['Gameweek'] == gameweek)].Points.values[0]
except:
print(team1 + team2 + str(gameweek))
points = temp_1 - temp_2
@ -36,21 +38,21 @@ p.read_fcl_file('worker.fcl')
cs1 = ctrl.ControlSystem(p.rules)
module = ctrl.ControlSystemSimulation(cs1)
predictions = []
for i in range(0,224):
for i in range(0,225):
module.input['form1'] = matches_input[i][0]
module.input['form2'] = matches_input[i][1]
#module.input['points'] = matches_input[i][2]
module.input['points'] = matches_input[i][2]
module.compute()
x = module.output['result']
x = float("{:.4f}".format(x))
y = int(round(x))
predictions.append(y)
print("FCL: " +str(x) + " ROUND: " + str(y) + " GROUND: " + str(matches_input[i][3]))
print("|FCL: " +str(x) + "|ROUND: " + str(y) + "|GROUND: " + str(matches_input[i][3]) + "|PKT DIFFERENCE: " + str(matches_input[i][2])+'|')
num = 0
cor = 0
for i in range(0,224):
for i in range(0,225):
if(predictions[i]==matches_input[i][3]):
cor+=1
num+=1

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -45,6 +45,9 @@ RULEBLOCK
AND : MIN;
ACCU : MAX;
ACT : MIN;
RULE 0: if form1 is avg and form2 is avg then result is draw
RULE 1 : if form1 is great and form2 is bad then result is home
RULE 2 : if form1 is great and form2 is avg then result is home
RULE 3 : if form1 is great and form2 is great then result is draw
@ -56,6 +59,10 @@ RULEBLOCK
RULE 7 : if form1 is bad and form2 is bad then result is draw
RULE 8 : if form1 is bad and form2 is avg then result is away
RULE 9 : if form1 is bad and form2 is great then result is away
//RULE 10: if points is high then result is away
//RULE 11: if points is high then result is draw
//RULE 10: if form1 is great and form2 is bad and points is low then result is home
END_RULEBLOCK
END_FUNCTION_BLOCK