Refactor trans_models_t to use mlr3: replace fit_fun/gof_fun with Learner/AutoTuner interface#24
Draft
Refactor trans_models_t to use mlr3: replace fit_fun/gof_fun with Learner/AutoTuner interface#24
trans_models_t to use mlr3: replace fit_fun/gof_fun with Learner/AutoTuner interface#24Conversation
Agent-Logs-Url: https://github.com/ethzplus/evoland-plus/sessions/2eb1143b-0b8d-42f2-ad27-052b4100baea Co-authored-by: mmyrte <24587121+mmyrte@users.noreply.github.com>
Agent-Logs-Url: https://github.com/ethzplus/evoland-plus/sessions/16192889-e909-4511-bc6c-4fc80926b365 Co-authored-by: mmyrte <24587121+mmyrte@users.noreply.github.com>
Agent-Logs-Url: https://github.com/ethzplus/evoland-plus/sessions/16192889-e909-4511-bc6c-4fc80926b365 Co-authored-by: mmyrte <24587121+mmyrte@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
mmyrte
April 16, 2026 17:49
View session
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces the ad-hoc
fit_fun/gof_funfunction-passing interface with first-class mlr3 integration. Learner identity, hyperparameters, and a serialized untrained spec are stored natively in DuckDB; cross-validation uses mlr3 tasks and measures throughout.Schema (
trans_models_t)model_familylearner_idVARCHARmodel_paramslearner_paramsMAP(VARCHAR,VARCHAR)fit_calllearner_specBLOBLearnergoodness_of_fitcrossval_measuresMAP(VARCHAR,DOUBLE)prediction$score(measures)model_obj_partcrossval_predictionsBLOBPredictionClassifmodel_obj_fulllearner_fullBLOBLearnerPrimary key:
(id_run, id_trans, fit_call)→(id_run, id_trans, learner_id)API
Worker logic
fit_partial_model_worker: Buildsas_task_classif(..., positive = "TRUE"), deep-clones and trains the learner, scores held-out split viaprediction$score(measures). ForAutoTuner, extracts the optimal inner learner forlearner_id/learner_params/learner_spec.fit_full_model_worker: Reconstructs fromlearner_specBLOB; falls back todo.call(mlr3::lrn, c(list(learner_id), as.list(learner_params)))on deserialization failure.predict_trans_pot: Deserializeslearner_fulland callslearner$predict_newdata(pred_data)$prob[, "TRUE"]; removes family-specific dispatch.New method
get_crossval_plots(id_run, id_trans)deserializes allcrossval_predictionsBLOBs and returnsmlr3viz::autoplot()results for visual GoF inspection.Dependencies
mlr3andmlr3vizadded toSuggests.