Skip to content

Conversation

@ablaom
Copy link
Member

@ablaom ablaom commented Nov 11, 2025

After this PR, one can use DeterministicConstantRegressor with multitargets:

julia> using MLJBase, MLJModels

julia> X, y = make_regression(10, 2; n_targets=3); # synthetic data: two tables

julia> regressor = DeterministicConstantRegressor();

julia> mach = machine(regressor, X, y) |> fit!;
[ Info: Training machine(DeterministicConstantRegressor(), ).

julia> 

julia> fitted_params(mach)
(mean = [-0.08104117873774516 1.5935905587979058 1.0865047090815172],)

julia> 

julia> Xnew, _ = make_regression(3, 2)
(Tables.MatrixTable{Matrix{Float64}} with 3 rows, 2 columns, and schema:
 :x1  Float64
 :x2  Float64, [0.36837556494255974, 0.45959051755066704, 0.23793608647119824])

julia> predict(mach, Xnew)
(Column1 = [-0.08104117873774516, -0.08104117873774516, -0.08104117873774516], Column2 = [1.5935905587979058, 1.5935905587979058, 1.5935905587979058], Column3 = [1.0865047090815172, 1.0865047090815172, 1.0865047090815172])

It also adds tests and a docstring, which this model never had.

@codecov
Copy link

codecov bot commented Nov 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.68%. Comparing base (7384cde) to head (43c28ec).

Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #602      +/-   ##
==========================================
+ Coverage   76.93%   78.68%   +1.74%     
==========================================
  Files           8        8              
  Lines         477      488      +11     
==========================================
+ Hits          367      384      +17     
+ Misses        110      104       -6     

☔ 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.

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