Skip to content

Fix GPLearn research example code errors (#2162)#2255

Merged
AlexCatarino merged 1 commit intoQuantConnect:masterfrom
AlexCatarino:bug-2162-fix-gplearn-demo
Mar 19, 2026
Merged

Fix GPLearn research example code errors (#2162)#2255
AlexCatarino merged 1 commit intoQuantConnect:masterfrom
AlexCatarino:bug-2162-fix-gplearn-demo

Conversation

@AlexCatarino
Copy link
Copy Markdown
Member

@AlexCatarino AlexCatarino commented Mar 19, 2026

Summary

  • Remove undefined `predict()` call in the Research Environment GPLearn example (was never defined; predictions were already computed as `y_predict` earlier in the snippet)
  • Add missing `qb.object_store.save()` calls to persist the transformer and regressor models to the object store

Resolves #2162

Backtest results (Writing Algorithms example, Legacy env, 2024-09-01–2024-12-31)

Metric Value
Sharpe Ratio -1.036
Total Orders 23
Net Profit -2.635%
Compounding Annual Return -7.695%
Win Rate 47%
Max Drawdown 9.0%
Probabilistic Sharpe Ratio 15.0%

Project: https://www.quantconnect.com/project/29164258 (leanEnvironment=7, Legacy)

Test plan

  • Writing Algorithms GPLearn example runs without errors in the Legacy package environment (leanEnvironment=7)
  • Verify the page renders correctly on quantconnect.com/docs
  • Confirm the Research Environment GPLearn notebook example runs without errors in the Legacy package environment
  • Check all links resolve

@AlexCatarino AlexCatarino merged commit a50422d into QuantConnect:master Mar 19, 2026
@AlexCatarino AlexCatarino deleted the bug-2162-fix-gplearn-demo branch March 19, 2026 19:08
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.

GPLearn Demo Throws Runtime Error

1 participant