forked from s452662/SystemyRozmyte
Last 5 matches between teams added to data_filters, fix shots fuzzy rules
This commit is contained in:
parent
651b3562da
commit
089139b660
@ -29,6 +29,13 @@ def last5Matches(season, teamA, data, df):
|
|||||||
|
|
||||||
return last_before_date
|
return last_before_date
|
||||||
|
|
||||||
|
def last5MatchesBtwTeams(teamA, teamB, data, df):
|
||||||
|
subset = df[(((df['home_team'] == teamA) | (df['away_team'] == teamA)) & ((df['home_team'] == teamB) | (df['away_team'] == teamB)))]
|
||||||
|
before_given_date = subset[pd.to_datetime(subset['date']) < pd.to_datetime(data)]
|
||||||
|
before_given_date = before_given_date.sort_values(by='date', ascending=False)
|
||||||
|
last_before_date = before_given_date.head(5)
|
||||||
|
|
||||||
|
return last_before_date
|
||||||
|
|
||||||
def seasonMatches(season, teamA, data, df):
|
def seasonMatches(season, teamA, data, df):
|
||||||
# Wybierz rekordy dla danej pary drużyn i sezonu
|
# Wybierz rekordy dla danej pary drużyn i sezonu
|
||||||
|
9
rules.py
9
rules.py
@ -104,14 +104,13 @@ def categorize_fuzzy_shots(shots_overall, shots_on_target):
|
|||||||
|
|
||||||
"IF (shots_overall IS high ) AND (shots_on_target IS low) THEN (quality_of_shots IS low)",
|
"IF (shots_overall IS high ) AND (shots_on_target IS low) THEN (quality_of_shots IS low)",
|
||||||
|
|
||||||
"IF (shots_overall IS average) AND (possession IS high) THEN (quality_of_shots IS high)",
|
"IF (shots_overall IS average) AND (shots_on_target IS high) THEN (quality_of_shots IS high)",
|
||||||
|
|
||||||
"IF (passes IS high) AND (possession IS average) THEN (quality_of_shots IS high)",
|
"IF (shots_overall IS high) AND (shots_on_target IS average) THEN (quality_of_shots IS average)",
|
||||||
|
|
||||||
"IF (passes IS low) AND (possession IS average) THEN (quality_of_shots IS low)",
|
"IF (shots_overall IS low) AND (shots_on_target IS average) THEN (quality_of_shots IS average)",
|
||||||
|
|
||||||
"IF (passes IS average) AND (possession IS low) THEN (quality_of_shots IS average)"
|
|
||||||
|
|
||||||
|
"IF (shots_overall IS average) AND (shots_on_target IS low) THEN (quality_of_shots IS low)"
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user