Coder Social home page Coder Social logo

best-subset's People

Contributors

ryantibs avatar tanmaysatpathy avatar trevorhastie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

best-subset's Issues

Error in bestsubset installation

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'

  • removing 'C:/Users/Sofia/Documents/R/win-library/3.6/bestsubset'
    Error: Failed to install 'bestsubset' from GitHub:
    (converted from warning) installation of package ‘C:/Users/Sofia/AppData/Local/Temp/Rtmp8uQMRG/file403c4ce47be1/bestsubset_1.0.10.tar.gz’ had non-zero exit status

I'm using R.6.3.1 and gurobi 8.1.1

not have gurobi package

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.

Calculation of bounds on the coefficients in the MIO method

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,

Problems with installation

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'

  • removing 'C:/Users/jimmyt/Documents/R/R-3.4.1/library/bestsubset'
    Installation failed: Command failed (1)

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.

Can this use the highs solver?

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.

questions about the simulation results

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

install best-subset package on windows 7

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

  • installing source package 'bestsubset' ...
    ** libs

*** 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'

  • removing 'C:/Program Files/R/R-3.4.0/library/bestsubset'
  • restoring previous 'C:/Program Files/R/R-3.4.0/library/bestsubset'
    Installation failed: Command failed (1)

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

  • installing source package 'bestsubset' ...
    ** libs

*** 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'

  • removing 'C:/Program Files/R/R-3.4.0/library/bestsubset'
  • restoring previous 'C:/Program Files/R/R-3.4.0/library/bestsubset'
    Installation failed: Command failed (1)

Unable to Install in Debian 8

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.

Problem with level of sparsity

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!

Question on the oracle tuning because of the fact that sequences of lambda in the lasso method are different for each replication

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)
  }
}

Does nrelax parameter in lasso function define gamma ?

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.

Issue with Installing Package from GitHub Repository

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.