Skip to content

Add fit and optimize config to [recommend.ranker]#1124

Merged
zhenghaoz merged 3 commits intomasterfrom
config
Dec 11, 2025
Merged

Add fit and optimize config to [recommend.ranker]#1124
zhenghaoz merged 3 commits intomasterfrom
config

Conversation

@zhenghaoz
Copy link
Collaborator

No description provided.

@codecov
Copy link

codecov bot commented Dec 11, 2025

Codecov Report

❌ Patch coverage is 54.54545% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.58%. Comparing base (ca60822) to head (122c80a).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
cmd/gorse-worker/main.go 0.00% 3 Missing ⚠️
worker/worker.go 0.00% 3 Missing ⚠️
master/master.go 0.00% 2 Missing ⚠️
master/tasks.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1124      +/-   ##
==========================================
- Coverage   71.66%   71.58%   -0.09%     
==========================================
  Files          85       86       +1     
  Lines       15019    15089      +70     
==========================================
+ Hits        10763    10801      +38     
- Misses       3203     3230      +27     
- Partials     1053     1058       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request adds fit and optimize configuration parameters to the [recommend.ranker] section to provide better control over the click-through rate prediction model training process. The changes align the ranker configuration structure with the existing collaborative filtering configuration.

Key Changes:

  • Added FitPeriod, FitEpoch, OptimizePeriod, and OptimizeTrials configuration fields to RankerConfig
  • Renamed RefreshRecommendPeriod to CacheExpire and removed CheckRecommendPeriod to simplify configuration
  • Updated the master's fit ticker to use the minimum of collaborative and ranker fit periods
  • Modified worker to accept a configurable interval parameter instead of using a hardcoded value

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
config/config.go Added new RankerConfig fields (FitPeriod, FitEpoch, OptimizePeriod, OptimizeTrials, CacheExpire) and removed old fields (CheckRecommendPeriod, RefreshRecommendPeriod) with defaults
config/config.toml Updated ranker configuration section with new parameters and comments, renamed refresh_recommend_period to cache_expire, removed check_recommend_period
config/config_test.go Updated test assertions to verify new ranker configuration fields including type, cache expire, recommenders, fit period/epoch, and optimize period/trials
worker/worker.go Added interval parameter to NewWorker(), removed dynamic ticker adjustment logic, updated tick condition from >= to <=
cmd/gorse-worker/main.go Added --interval CLI flag with default of 1 minute for worker tick duration
worker/pipeline.go Changed from RefreshRecommendPeriod to CacheExpire when calculating timeout for stale recommendations
master/master.go Updated fit ticker to use minimum of collaborative and ranker fit periods to ensure both models are trained appropriately
master/tasks.go Changed click-through rate optimization from using Collaborative.OptimizeTrials to Ranker.OptimizeTrials

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@zhenghaoz zhenghaoz merged commit d6048b4 into master Dec 11, 2025
11 of 12 checks passed
@zhenghaoz zhenghaoz deleted the config branch December 11, 2025 09:22
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.

2 participants