ryantibs / best-subset Goto Github PK
View Code? Open in Web Editor NEWComparisons between best subset selection and other popular sparse regression estimators
License: GNU General Public License v2.0
Comparisons between best subset selection and other popular sparse regression estimators
License: GNU General Public License v2.0
Hi,
I am trying to install the package but encounter the following error message:
** testing if installed package can be loaded from temporary location
*** arch - i386
Error : package 'gurobi' is not installed for 'arch = i386'
Error: loading failed
Ejecución interrumpida
*** arch - x64
ERROR: loading failed for 'i386'
I'm using R.6.3.1 and gurobi 8.1.1
I got the error message after installing.
ERROR: dependency ‘gurobi’ is not available for package ‘bestsubset’
* removing ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library/bestsubset’
Installation failed: Command failed (1)
I searched online and found http://www.gurobi.com/. gurobi is not free. Does this mean that the best-subset package cannot be run for free?
In addition, I did not find Gurobi
package.
in the paper, Best Subset Selection via a Modern Optimization Lens, it mentioned that adding additional bounds on the coefficients leads to improved performance of the MIO in Equation (9).
In the code file (master/bestsubset/R/bs.R) it shows the bound on the beta is calculated by this:
bigm = 2*max(abs(best.beta))
where best.beta is from the projected gradient method. But I felt that this is not exactly the same to the description in the Section 2.3.1 in the paper,
Hi,
I am trying to install the package but encounter the following error message:
Error : package 'gurobi' is not installed for 'arch = i386'
Error: loading failed
Execution halted
*** arch - x64
ERROR: loading failed for 'i386'
Also, which version of Gurobi does this package work with? Would the package works with the latest version of gurobi as well?
I am using gurobi 7.0.1 and R 3.4.1 and wondering if this would work?
Thank you very much.
There is now a package on CRAN wrapping the open source MIP solver highs. Could this package use it so it could get on CRAN? It seems like this would be quite useful for studying variant model selection criteria following the example of the bigstep package. For example, variable selection controlling the false discovery rate following Bogdan. Maybe then something like SLOPE would have a similar relationship as with discussed in this paper compared with the MIP and what is found with bigstep using mAIC2.
Hi, thanks for the work! I am surprised that lasso seems to always select the largest number of features. I am guessing because relaxed lasso has its own tuning process, the lambdas become different from those of a standard lasso; and hence fewer features are selected by relaxed lasso. But this also means active sets becomes quite different between these 2. In this case, are the formula from section 2.3 still valid?
thanks!
wei
I'm unable to install the package on my win7 machine. I have installed gurobi 32 and 64 bits, but initially tried everything 64 bit. I also installed the gurobi package.
It seems as if the best-subset package want the Gurobi package to be present for 32 AND 64 bits?
output install with 32 or 64 bit Gurobi package:
install_github(repo="ryantibs/best-subset", subdir="bestsubset")
Downloading GitHub repo ryantibs/best-subset@master
from URL https://api.github.com/repos/ryantibs/best-subset/zipball/master
Installing bestsubset
"C:/PROGRA1/R/R-341.0/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL
"C:/Users/hagem011/AppData/Local/Temp/RtmpqiHNTk/devtools1dc50e6ac5/ryantibs-best-subset-2f7d518/bestsubset"
--library="C:/Program Files/R/R-3.4.0/library" --install-tests
*** arch - i386
C:/RBuildTools/3.4/mingw_32/bin/gcc -I"C:/PROGRA1/R/R-341.0/include" -DNDEBUG -I"d:/Compiler/gcc-4.9.3/local330/include" -O3 -Wall -std=gnu99 -mtune=core2 -c matrixcomps.c -o matrixcomps.o
C:/RBuildTools/3.4/mingw_32/bin/gcc -shared -s -static-libgcc -o bestsubset.dll tmp.def matrixcomps.o -Ld:/Compiler/gcc-4.9.3/local330/lib/i386 -Ld:/Compiler/gcc-4.9.3/local330/lib -LC:/PROGRA1/R/R-341.0/bin/i386 -lR
installing to C:/Program Files/R/R-3.4.0/library/bestsubset/libs/i386
*** arch - x64
C:/RBuildTools/3.4/mingw_64/bin/gcc -I"C:/PROGRA1/R/R-341.0/include" -DNDEBUG -I"d:/Compiler/gcc-4.9.3/local330/include" -O2 -Wall -std=gnu99 -mtune=core2 -c matrixcomps.c -o matrixcomps.o
C:/RBuildTools/3.4/mingw_64/bin/gcc -shared -s -static-libgcc -o bestsubset.dll tmp.def matrixcomps.o -Ld:/Compiler/gcc-4.9.3/local330/lib/x64 -Ld:/Compiler/gcc-4.9.3/local330/lib -LC:/PROGRA1/R/R-341.0/bin/x64 -lR
installing to C:/Program Files/R/R-3.4.0/library/bestsubset/libs/x64
** R
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
*** arch - i386
Error : package 'gurobi' is not installed for 'arch = i386'
Error: loading failed
Execution halted
*** arch - x64
ERROR: loading failed for 'i386'
install.packages("C:/gurobi751/win32/R/gurobi_7.5-1.zip", repos = NULL, type = "win.binary")
package ‘gurobi’ successfully unpacked and MD5 sums checked
install_github(repo="ryantibs/best-subset", subdir="bestsubset")
Downloading GitHub repo ryantibs/best-subset@master
from URL https://api.github.com/repos/ryantibs/best-subset/zipball/master
Installing bestsubset
"C:/PROGRA1/R/R-341.0/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL
"C:/Users/hagem011/AppData/Local/Temp/RtmpqiHNTk/devtools1dc373a6d1b/ryantibs-best-subset-2f7d518/bestsubset"
--library="C:/Program Files/R/R-3.4.0/library" --install-tests
*** arch - i386
C:/RBuildTools/3.4/mingw_32/bin/gcc -I"C:/PROGRA1/R/R-341.0/include" -DNDEBUG -I"d:/Compiler/gcc-4.9.3/local330/include" -O3 -Wall -std=gnu99 -mtune=core2 -c matrixcomps.c -o matrixcomps.o
C:/RBuildTools/3.4/mingw_32/bin/gcc -shared -s -static-libgcc -o bestsubset.dll tmp.def matrixcomps.o -Ld:/Compiler/gcc-4.9.3/local330/lib/i386 -Ld:/Compiler/gcc-4.9.3/local330/lib -LC:/PROGRA1/R/R-341.0/bin/i386 -lR
installing to C:/Program Files/R/R-3.4.0/library/bestsubset/libs/i386
*** arch - x64
C:/RBuildTools/3.4/mingw_64/bin/gcc -I"C:/PROGRA1/R/R-341.0/include" -DNDEBUG -I"d:/Compiler/gcc-4.9.3/local330/include" -O2 -Wall -std=gnu99 -mtune=core2 -c matrixcomps.c -o matrixcomps.o
C:/RBuildTools/3.4/mingw_64/bin/gcc -shared -s -static-libgcc -o bestsubset.dll tmp.def matrixcomps.o -Ld:/Compiler/gcc-4.9.3/local330/lib/x64 -Ld:/Compiler/gcc-4.9.3/local330/lib -LC:/PROGRA1/R/R-341.0/bin/x64 -lR
installing to C:/Program Files/R/R-3.4.0/library/bestsubset/libs/x64
** R
** preparing package for lazy loading
Error : package 'gurobi' is not installed for 'arch = x64'
ERROR: lazy loading failed for package 'bestsubset'
For k
, the documentation explains "... 1:min(n-1,p,200) for models with intercept and 1:min(n,p,200) for models without it." but the function definition specifies k=0:min(nrow(x)-intercept,ncol(x))
. Can these be made consistent?
It seems that the shared object has been created on another operating system and is not compatible with the operating system which I'm using.
* installing *source* package ‘bestsubset’ ...
** libs
make: Nothing to be done for 'all'.
installing to /dskh/nobackup/biostat/Bioconductor/bestsubset/libs
** R
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
Error: package or namespace load failed for ‘bestsubset’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/dskh/nobackup/biostat/Bioconductor/bestsubset/libs/bestsubset.so':
/dskh/nobackup/biostat/Bioconductor/bestsubset/libs/bestsubset.so: invalid ELF header
The operating system's details are:
Distributor ID: Debian
Description: Debian GNU/Linux 8.9 (jessie)
Release: 8.9
Codename: jessie
How about improving the README file? It has barely any instructions or details about which platforms best-subset works on.
Hi!
I have a question about the one parameter in your model - k (level of sparsity). The paper and the code's documentation claimed that its parameter is the maximum number of non-zero coefficients in the linear model. But, unfortunately, I get a different result. For some k number, I get a larger (than k) quantity of non-zeros coefficients
Is it some kind of bug or did I misunderstand something?
Thanks!
In the simulation for the lasso method, for each replication, the lasso will generate a coefficient matrix according to a sequence of lambda of size = nlambda. Based on the coef.lasso function copied below, is it correct to say that the lambda sequences are different for each replication because lambda max is different after computing for each replication dataset?
Then if the sequences are different, it is OK for the validation tuning, because the validation tuning selects the optimal metric in each replication. But is it also okay for the oracle tuning? Since the oracle tuning selects the minimum err.test in the function choose.tuning.params, which relies on the storing of the metrics err.test in a matrix, which does not share the same column names, i.e., the lambda sequences.
coef.lasso.from.glmnet = function(object, s=NULL) {
class(object) = "glmnet"
if (length(object$lambda)==object$nlambda) {
return(glmnet::coef.glmnet(object,s=s))
}
else {
min.lam = min(object$lambda)
max.lam = max(object$lambda)
svec = exp(seq(log(max.lam),log(min.lam),length=object$nlambda))
return(glmnet::coef.glmnet(object,s=svec))
## RJT TODO: should we used exact=TRUE above? Requires additional
## arguments to match the initial call to glmnet(), kind of clunky
## TH: use glmnet.control(fdev=0) at beginning of session
## Still needed though for cases when df exceeds p (can happen with
## glmnet, and bad for relaxed lasso)
}
}
I could not understand the definition of nrelax
variable in lasso
function, and could not relate it to any variable in the paper. I guess that it defines gamma variable.
For example, when nrelax=4
that means gamma
will be equally spaced from 1 to 0?
Or nrelax means something else?
Sorry, I am from a different background.
Thanks.
The package installation process hangs.
macOS Sierra 10.12.6
R version 3.4.1
RStudio 1.0.153
library(devtools)
install_github(repo="ryantibs/best-subset", subdir="bestsubset")
Downloading GitHub repo ryantibs/best-subset@master
from URL https://api.github.com/repos/ryantibs/best-subset/zipball/master
I attempted to install the package "best-subset", but I encountered an error :
install_github(repo="ryantibs/best-subset", subdir="bestsubset")
Downloading GitHub repo ryantibs/best-subset@HEAD
Error in utils::download.file(url, path, method = method, quiet = quiet, :
download from 'https://api.github.com/repos/ryantibs/best-subset/tarball/HEAD' failed
Could you please provide assistance or guidance on how to resolve this issue?
Thank you for your attention to this matter.
Hi,
for the n<p case, you have defined.
zeta.bd =colSums(apply(abs(x),1,sort,decreasing=True)[1:k,,drop=F])*bigM
As per equation 17 here: https://arxiv.org/pdf/1507.03133.pdf
it should be max(apply(abs(x),1,sort,decreasing=True)[1:k,,drop=F])*bigM
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.