Menu

Settings

Language, shortcuts & timezone

Language

Timezone

Time zone changes apply on this device. A new device starts at GMT+0; check match times before reading.

콘텐츠로 건너뛰기
추천 추천

설정

선호 설정 사용자 정의

How to Keep the Target Match Out of a Team Form Average

Opta Tips Team 작성 업데이트됨

Trace a three-match scoring average to its input fixtures and test whether the current match accidentally entered a pre-match prediction.

Illustrative average for game four: three prior goal totals give 1.00 and including the target result incorrectly gives 2.00.

A model uses average goals from the last three matches to make a pre-match prediction. A worksheet sorted by match date can still put the current score into that average. You can spot the mistake by tracing which three results appear on the prediction row.

A pre-match rolling average must exclude the match being predicted.

Illustrative average for game four: three prior goal totals give 1.00 and including the target result incorrectly gives 2.00.

Follow the row through the calculation

Assume one team has played three games with goal counts of 1, 2 and 0, and the results were known before its fourth game. The team’s four-goal performance in game four is only known afterwards. For the game-four forecast, the three eligible values are 1, 2 and 0, so the average is 1.00. A three-row calculation ending at the fourth row would use 2, 0 and 4, giving 2.00. That latter number answers a post-match form question. It cannot be used to recreate the pre-match forecast for game four.

Feature constructionInputsMean
Before game four1, 2, 01.00
Through game four2, 0, 42.00

Sort and shift within each team

In a simple team-by-match table, sort the completed observations in actual chronological order within each team. When using one row per match, lag the observed goal values within each team before calculating that team’s trailing average. Pandas provides grouped shift and rolling operations. The test is independent of the software: find the row for game four and list the IDs of the three input games. No row from another team or from the target fixture should enter that slice.

The shift technique assumes the preceding result really was known by the forecast cutoff. A game that began earlier but ended after the target forecast was frozen is not automatically eligible. A postponed game can also move out of its original ordinal position. For irregular feeds, select matches by recorded availability first. The guide to point-in-time football data shows how to make that selection rule explicit.

Decide what to do with fewer than three results

Early in a season, two prior results may be all that exist. A model may leave the feature missing, compute a two-match mean and flag the sample size, or carry earlier data according to a documented policy. Do not insert a later third result. Do not replace a missing match with a zero-goal match either: no observation and an observed 0 are different. For another feature such as shots, use the same reasoning about eligibility and actual zeros.

A quick diagnostic before publishing scores

Pick a fixture where the current result is unusual, such as the hypothetical four goals above. Rebuild its row using only the pre-match evidence. Repeat after removing the current match score from a copy of the input table. The pre-match feature should stay the same. If it changes, inspect every slice and join keyed to the current fixture. This is an example diagnostic, not evidence about OptaTips or any particular prediction model. Review again if the dataset changes its match ordering or grouping.

Match count and time window answer different questions

A three-match mean takes the last three eligible observations even if the games are weeks apart. A 21-day mean filters by time and can contain fewer or more games. Compare two teams with different schedules before choosing the definition. If one has played four times in three weeks and the other only once, both features may be reasonable but they describe different samples. Keep the count of eligible matches beside the calculated value so the model or reader can distinguish them.

A venue-specific window also changes the denominator. If you want three home games, first restrict the team’s observations to home fixtures and then select the last three that were available at the cutoff. A team that scored twice in each of its last three appearances does not necessarily have a home-only mean of two. The correct home calculation might reach further back and include results the all-venue average leaves out. State the definition whenever someone will compare the number to a published form summary.

Protect the window from changes in row structure

Suppose the source table stores one row per team for every match. One fixture then appears twice with separate team keys, which is expected. But if the same team and fixture appears twice after a join to two match reports, that fixture can occupy two of the three slots. For instance, the expected input sequence of 1, 2 and 0 becomes 2, 0 and 0 if the final result is repeated and fills the window. The mean falls to roughly 0.67 without any late data entering the calculation. Check that the window contains unique fixture IDs for the team, unless the feature deliberately uses a different observation unit.

A chronological sort should also respect the definition of the timestamp. Two rows may share a local date or a published time rounded to the minute. A stable spreadsheet sort can assign them a consistent order, but that order alone does not show that a result preceded the cutoff. If an earlier match was unfinished when the next forecast was issued, leave its eventual result out. The selected three inputs might then include an older eligible game.

Compare the spreadsheet number with the model input

Pick one ordinary example and one edge case such as a postponed match or a season opener. Reconstruct the history by hand and record the eligible IDs, source values, cutoff, denominator and rounded output. Compare these values to the actual row fed to the model. Two implementations may round 1.333 to different precision but still use the same fixture set. Identical displayed averages can also conceal a bug, since different fixture sets can happen to produce the same mean.

Finally, run the calculation against a deliberately edited test copy of the target result. A target-row change from four goals to six should have no effect on the original 1.00 feature, but may affect the next forecast once that result is eligible. If both features stay unchanged, check whether the result ever enters the window. This pair of tests verifies both the exclusion of future information and the eventual admission of legitimate history.

Sources

독자 토론

댓글 0

아직 댓글이 없습니다.

댓글 남기기

Your email address will not be published. Required fields are marked *