Skip to content

Unify xG enhancement work into one reviewable integration branch - #23

Draft
pbulsink with Copilot wants to merge 14 commits into
masterfrom
copilot/combine-xg-improvement-prs
Draft

pbulsink with Copilot wants to merge 14 commits into
masterfrom
copilot/combine-xg-improvement-prs

Conversation

Copilot AI commented Apr 22, 2026 •

Copy link
Copy Markdown
Contributor

This PR consolidates the related xG enhancement streams that were previously split across separate PR branches, so model and adapter/backtest changes can be reviewed together as one coherent unit.

  • Branch consolidation

    • Merged xG adapter/config work, xG blend-weight optimization, and xG params/backtest changes into a single integration line.
    • Result is one branch containing the full xG improvement set instead of three partially overlapping PRs.
  • xG ingestion and adapter behavior

    • Includes configurable xG data sourcing/caching path usage and corresponding adapter coverage.
    • Keeps xG retrieval behavior aligned with model pipeline expectations.
  • Prediction model blending

    • Incorporates blended goal/xG prediction flow with xg_weight support.
    • Adds fitting logic for blend weight and integrates parameter propagation into model update/parse paths.
  • Backtesting support

    • Adds blended backtest capability to compare goal-only, xG-only, and weighted predictions over historical windows.
  • Test coverage brought together

    • Carries forward targeted tests for adapter path handling, xG scaling behavior, and xG weight blending/fitting.
# Representative blended prediction parameter shape now carried in params
params <- list(
  intercept = ...,
  home = ...,
  away = ...,
  xg_weight = 0.35
)

# Downstream prediction paths can consume params$xg_weight directly

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • cloud.r-project.org
    • Triggering command: /opt/R/4.5.3/lib/R/bin/exec/R /opt/R/4.5.3/lib/R/bin/exec/R --quiet --vanilla -e install.packages(c(&#34;pak&#34;,&#34;devtools&#34;),~&#43;~repos=&#34;REDACTED&#34;) (dns block)
  • https://api.github.com/graphql
    • Triggering command: /usr/bin/gh gh issue view 22 (http block)
    • Triggering command: /usr/bin/gh gh pr close 16 --repo pbulsink/HockeyModel --comment Superseded by combined xG feature branch per issue #22; closing without merge. (http block)
  • https://api.github.com/repos/pbulsink/HockeyModel/pulls/16
    • Triggering command: /usr/bin/gh gh api repos/pbulsink/HockeyModel/pulls/16 -X PATCH -f state=closed (http block)

If you need me to access, download, or install something from one of these locations, you can either:

pbulsink and others added 6 commits April 21, 2026 06:11
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…Matrix, dcxG, dcSample, todayDC, remainderSeasonDC, playoffDC) (issue #12)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…(issue #12)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI and others added 4 commits April 22, 2026 01:32
…o feature/xg-improvement-combined

# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.

Co-authored-by: pbulsink <5419974+pbulsink@users.noreply.github.com>
…t-combined

Co-authored-by: pbulsink <5419974+pbulsink@users.noreply.github.com>
…ement-combined

Co-authored-by: pbulsink <5419974+pbulsink@users.noreply.github.com>
Co-authored-by: pbulsink <5419974+pbulsink@users.noreply.github.com>
Copilot AI changed the title [WIP] Combine xG improvement PRs into a feature branch Unify xG enhancement work into one reviewable integration branch Apr 22, 2026
Copilot AI requested a review from pbulsink April 22, 2026 01:34
Comment thread R/api-interface.R

if (
system2(
"grep",

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're still not doing a grep review of the file before reading it in with read.csv. This has been shown in testing to be a huge speed-up and is mandatory to keep it in line.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implemented in 409b0aa: load_or_get_nst() now does a grep prefilter by gid and only parses the matched lines plus header with read.csv(text=...), instead of loading the full CSV first.

Comment thread R/dixon-coles.R
expected_mean = NULL,
season_percent = NULL,
include_xG = FALSE,
use_xg = FALSE,

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add use_xg to params documented for this function

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 409b0aa: I added @param use_xg documentation for todayDC() and updated the params-list docs to include optional xg_weight.

Comment thread R/dixon-coles.R
currentDate = Sys.Date(),
save_data = TRUE
save_data = TRUE,
min_games_for_xg_weight = 30

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update docs for this function

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in 409b0aa: updateDC() docs now include min_games_for_xg_weight and the return value now documents xg_weight.

Comment thread R/dixon-coles.R
expected_mean = NULL,
season_percent = NULL,
draws = TRUE
draws = TRUE,

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update docs with new params for this function

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in d4609e6: DCPredict() documentation now reflects the expanded params list (including optional xg_weight) alongside the new xG-related arguments.

@pbulsink

Copy link
Copy Markdown
Owner

@copilot please merge master back into this branch to allow for tests and checks to run better

…improvement-prs

Co-authored-by: pbulsink <5419974+pbulsink@users.noreply.github.com>

Copilot AI commented Apr 22, 2026

Copy link
Copy Markdown
Contributor Author

@copilot please merge master back into this branch to allow for tests and checks to run better

Merged origin/master into this branch in f022c611. The branch now includes the latest master updates so checks/tests can run against the refreshed base.

@pbulsink

Copy link
Copy Markdown
Owner

@copilot Please merge master back into this branch to run updated checks and avoid conflicts.

…improvement-prs

# Conflicts:
#	R/api-interface.R
#	R/dixon-coles.R

Co-authored-by: pbulsink <5419974+pbulsink@users.noreply.github.com>

Copilot AI commented Apr 25, 2026

Copy link
Copy Markdown
Contributor Author

@copilot Please merge master back into this branch to run updated checks and avoid conflicts.

Merged latest origin/master into this branch in 23fbedd. This should unblock updated checks and reduce merge conflict risk.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Combine xG improvement PRs into a feature branch

2 participants