-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
Using/Adding feature_weights
in R
#7657
Comments
It's just a meta info like labels and weights. I can help add that to R if needed. |
That would be great! |
I would just like to pass a vector of non-negative weights, of length the number of columns in the feature matrix. |
I have a new research project for which the feature_weights in xgboost are essential. Thank you for adding this to your |
I think it is relatively easy to enable it by someone familiar with R. Basically one can add the below condition branch in this function: https://github.com/dmlc/xgboost/blob/master/R-package/R/xgb.DMatrix.R#L255 ...
if (name == "feature_weights") {
if (sum(info) != ncol(object))
stop("The number of feature weights must equal to the number of columns in the input data")
.Call(XGDMatrixSetInfo_R, object, name, as.numeric(info))
return(TRUE)
}
... @trivialfis Please correct me if this is not true. |
Looks right, I will work on it tonight. |
Wonderful! Thanks so much rob |
I received a feature request via email from Prof. Tibshirani:
My questions are:
Thanks!
The text was updated successfully, but these errors were encountered: