Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing access weight= in DMatrix for sample weight #55

Closed
Moelf opened this issue Nov 27, 2024 · 1 comment · Fixed by #56
Closed

missing access weight= in DMatrix for sample weight #55

Moelf opened this issue Nov 27, 2024 · 1 comment · Fixed by #56

Comments

@Moelf
Copy link
Contributor

Moelf commented Nov 27, 2024

in Python, this is called sample_weight https://xgboost.readthedocs.io/en/stable/python/python_api.html#xgboost.XGBRegressor.fit

looks like XGBoost.jl exposes it via: https://github.com/dmlc/XGBoost.jl/blob/08c38da58050ca2df29f0e5fdcc06ce21de1dcd8/src/dmatrix.jl#L56

Do we have access to this concept in this package?

@Moelf Moelf changed the title missing access 'weight=` in DMatrix for sample weight missing access weight= in DMatrix for sample weight Nov 27, 2024
@Moelf
Copy link
Contributor Author

Moelf commented Nov 27, 2024

I think the right way to do this is to add

+ 229 MMI.supports_weights(::Type{<:XGBoostRegressor}) = true
+ 230 MMI.supports_weights(::Type{<:XGBoostClassifier}) = true
  231

and then also add a 4th argument to:

function MMI.fit(model::XGBoostClassifier,
verbosity, # must be here even if unsupported in pkg
X, y,
)

?

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 a pull request may close this issue.

1 participant