-
Notifications
You must be signed in to change notification settings - Fork 0
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
fusion reading list #4
Comments
please read my blog about mlr3 hyper-parameter auto_tuner https://tdhock.github.io/blog/2024/hyper-parameter-tuning/ |
I have created a prototype fuser learner here -> |
Other public microbiome datasets with different groups -> https://github.com/twbattaglia/MicrobeDS |
great start for LearnerRegrFuser. I would suggest already sending an issue to the fuser package authors, to tell them you are working on an mlr3 interface, and maybe ask to make sure there is not already one implemented elsewhere? |
@tdhock I have opened the issue about the fuser for mlr3 here.
When I run this: if(require(future))plan("multisession")
bench.result <- mlr3::benchmark(bench.grid, store_models = TRUE) This is the instance of the class after applying the tuner on lambda.
UPDATE: I have been able to fix it. It had to do with the fuser object which if I want to apply the auto-tuner, it has to be a mlr3tuning::auto_tuner object instead in the learner list. |
@tdhock I have this issue, could you help?
This is the R code: N <- 300
abs.x <- 20
set.seed(1)
x.mat <- matrix(runif(N * 3, -abs.x, abs.x), ncol = 3) # Ensure X has more than two features
colnames(x.mat) <- paste0("feature", 1:3)
library(data.table)
(task.dt <- data.table(
x = x.mat,
y = sin(rowSums(x.mat)) + rnorm(N, sd = 0.5)
))
# Create a grouping variable
task.dt[, sample_group := rep(1:3, length.out = .N)]
# Check the distribution of groups
table(group.tab <- task.dt$sample_group)
# Create a regression task with the grouping variable
reg.task <- mlr3::TaskRegr$new("sin", task.dt, target = "y")
group.task <- reg.task$set_col_roles("sample_group", c("group", "stratum"))
same_other_cv <- mlr3resampling::ResamplingSameOtherCV$new()
same_other_cv$param_set$values$folds <- 2
fuser.learner = lrn("regr.fuser")
#fuser.learner$param_set$values$num.it <- paradox::to_tune(1, 100)
fuser.learner$param_set$values$lambda <- paradox::to_tune(0.001, 1, log=TRUE)
#fuser.learner$param_set$values$gamma <- paradox::to_tune(0.001, 1, log=TRUE)
subtrain.valid.cv <- mlr3::ResamplingCV$new()
subtrain.valid.cv$param_set$values$folds <- 2
grid.search.5 <- mlr3tuning::TunerGridSearch$new()
grid.search.5$param_set$values$resolution <- 5
fuser.learner.tuned = mlr3tuning::auto_tuner(
tuner = grid.search.5,
learner = fuser.learner,
resampling = subtrain.valid.cv,
measure = mlr3::msr("regr.mse"))
reg.learner.list <- list(
mlr3::LearnerRegrFeatureless$new(), fuser.learner.tuned)
(same.other.grid <- mlr3::benchmark_grid(
group.task,
reg.learner.list,
same_other_cv))
if(require(future))plan("multisession")
bench.result <- mlr3::benchmark(same.other.grid, store_models = TRUE)
|
@tdhock Another issue that I faced while I was isolating just the My question is how do I specify in |
"cannot combine stratification with grouping" comes from using mlr3::ResamplingCV which does not support both, even though your task defines both, so to work-around that I had to fork that code and remove the error message, so please try the code in this branch tdhock/mlr3resampling#8 |
He has an issue here FrankD/fuser#1 that when there is no information sharing because there is only one group it should default to the normal LASSO. |
I get the error below when I use the
|
remotes::install_github("tdhock/mlr3resampling@cv-ignore-group") |
by the way I updated mlr3resampling on CRAN, you may want to update and read https://cloud.r-project.org/web/packages/mlr3resampling/vignettes/ResamplingSameOtherSizesCV.html
|
@tdhock I cant seem to find my way around this fuser.learner = LearnerRegrFuser$new()
fuser.learner$param_set$values$lambda <- paradox::to_tune(0.001, 1, log=TRUE)
fuser.learner$param_set$values$gamma <- paradox::to_tune(0.001, 1, log=TRUE)
fuser.learner$param_set$values$tol <- paradox::to_tune(1e-10, 1e-2, log=TRUE) These are the results on three public datasets. What do you think about this: Still investigating this issue, could be that there is an issue with the actual |
you should take default value for tol (not tuned) |
https://arxiv.org/pdf/1611.00953.pdf L1 on weights + L2 squared fusion between all groups https://cloud.r-project.org/web/packages/fuser/vignettes/subgroup_fusion.html
https://rdrr.io/cran/genlasso/man/fusedlasso.html possible to implement L1 on weights + L1 fusion between pairs of weights in different groups, if we create large matrix X with lots of 0 (maybe tricky to code the graph correctly)
?? Guillaume Obozinski, Ben Taskar, and Michael I Jordan. Joint covariate selec-
tion and joint subspace selection for multiple classification problems. Statistics
and Computing, 20(2):231–252, 2010 ??
try implementing new learner in mlr3 like this https://github.com/mlr-org/mlr3learners/blob/main/R/LearnerRegrKKNN.R
with auto_tuner https://mlr3book.mlr-org.com/chapters/chapter4/hyperparameter_optimization.html#sec-autotuner
@EngineerDanny
The text was updated successfully, but these errors were encountered: