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=""> <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$/.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$/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> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -89,31 +92,57 @@
<screen x="67" y="27" width="1533" height="873" /> <screen x="67" y="27" width="1533" height="873" />
</state> </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 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" /> <screen x="67" y="27" width="1533" height="873" />
</state> </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="272" key="GridCell.Tab.0.bottom/67.27.1533.873/1600.0.1920.1080@67.27.1533.873" timestamp="1591725393594" />
<state width="1510" height="284" key="GridCell.Tab.0.center" timestamp="1591715422110"> <state width="1510" height="272" key="GridCell.Tab.0.center" timestamp="1591725393594">
<screen x="67" y="27" width="1533" height="873" /> <screen x="67" y="27" width="1533" height="873" />
</state> </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="272" key="GridCell.Tab.0.center/67.27.1533.873/1600.0.1920.1080@67.27.1533.873" timestamp="1591725393594" />
<state width="1510" height="284" key="GridCell.Tab.0.left" timestamp="1591715422110"> <state width="1510" height="272" key="GridCell.Tab.0.left" timestamp="1591725393594">
<screen x="67" y="27" width="1533" height="873" /> <screen x="67" y="27" width="1533" height="873" />
</state> </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="272" key="GridCell.Tab.0.left/67.27.1533.873/1600.0.1920.1080@67.27.1533.873" timestamp="1591725393594" />
<state width="1510" height="284" key="GridCell.Tab.0.right" timestamp="1591715422110"> <state width="1510" height="272" key="GridCell.Tab.0.right" timestamp="1591725393594">
<screen x="67" y="27" width="1533" height="873" /> <screen x="67" y="27" width="1533" height="873" />
</state> </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>
<component name="XDebuggerManager"> <component name="XDebuggerManager">
<breakpoint-manager> <breakpoint-manager>
<breakpoints> <breakpoints>
<line-breakpoint enabled="true" suspend="THREAD" type="python-line"> <line-breakpoint enabled="true" suspend="THREAD" type="python-line">
<url>file://$PROJECT_DIR$/main.py</url> <url>file://$PROJECT_DIR$/main.py</url>
<line>38</line> <line>40</line>
<option name="timeStamp" value="5" /> <option name="timeStamp" value="5" />
</line-breakpoint> </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> </breakpoints>
</breakpoint-manager> </breakpoint-manager>
<watches-manager> <watches-manager>

24
main.py
View File

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