Skip to main content

Implementation of accelerated gradient algorithm with strong rules for (high-dimensional) nonconvex sparse learning problems. Restarting, memory-mapping, and multiprocessing are now available.

Project description

nonconvexAG

This is an implementation of restarting accelerated gradient algorithm with strong rules for (high-dimensional) nonconvex sparse learning problems. The corresponding paper can be found at arXiv.

The available functions are:

  • UAG_LM_SCAD_MCP, UAG_logistic_SCAD_MCP: these functions find a local minizer for the SCAD/MCP penalized linear models/logistic models. The arguments are: * design_matrix: the design matrix input, should be a two-dimensional numpy array; * outcome: the outcome, should be one dimensional numpy array, continuous for linear model, binary for logistic model; * beta_0: starting value; optional, if not declared, it will be calculated based on the Gauss-Markov theory estimators of $\beta$; * tol: tolerance parameter; the tolerance parameter is set to be the uniform norm of two iterations; * maxit: maximum number of iteratios allowed; * _lambda: _lambda value; * penalty: could be "SCAD" or "MCP"; * a=3.7, gamma=2: a for SCAD and gamma for MCP; it is recommended for a to be set as $3.7$; * L_convex: the L-smoothness constant for the convex component, if not declared, it will be calculated by itself * add_intercept_column: boolean, should the fucntion add an intercept column?

  • solution_path_LM, solution_path_logistic: calculate the solution path for linear/logistic models; the only difference from above is that lambda_ is now a one-dimensional numpy array for the values of $\lambda$ to be used.

  • UAG_LM_SCAD_MCP_strongrule, UAG_logistic_SCAD_MCP_strongrule work just like UAG_LM_SCAD_MCP, UAG_logistic_SCAD_MCP -- except they use strong rule to filter out many covariates before carrying out the optimization step. Same for solution_path_LM_strongrule and solution_path_logistic_strongrule. Strong rule increases the computational speed dramatically.

  • The package also offers implementation of certain features using memory mapping. memmap_lambda_max_LM and memmap_lambda_max_logistic calculate the least values for \lambda to vanish all penalized coefficients. memmap_UAG_LM_SCAD_MCP, memmap_UAG_logisitc_SCAD_MCP, and memmap_solution_path_LM, memmap_solution_path_LM work similar to the non-memorymapping version of the function. For memory mapping versions of the functions, the design_matrix or X parameter should declare the path of the memorymapped file, and _dtype='float32' declares the data type, _order declares the order of the memorymapped files ("F" for Fortran or "C" for C++). Multiprocess with memory mapping is also available as memmap_lambda_max_LM_parallel, memmap_lambda_max_logistic_parallel, memmap_UAG_LM_SCAD_MCP_parallel, memmap_UAG_logistic_SCAD_MCP_parallel, memmap_solution_path_LM_parallel, memmap_solution_path_logistic_parallel -- for these functions, an extra argument core_num can be used to declare the cores to be used -- if not decalred, it will use all the cores.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nonconvexAG-0.9.5.9.tar.gz (50.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nonconvexAG-0.9.5.9-py3-none-any.whl (37.3 kB view details)

Uploaded Python 3

File details

Details for the file nonconvexAG-0.9.5.9.tar.gz.

File metadata

  • Download URL: nonconvexAG-0.9.5.9.tar.gz
  • Upload date:
  • Size: 50.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for nonconvexAG-0.9.5.9.tar.gz
Algorithm Hash digest
SHA256 08ee1e40582f29b0cba7644fa3f5f2563c7cdf6c7e89559769f91f6fb7fbf741
MD5 8a9299924583503d8a78ee81eb9caa9a
BLAKE2b-256 1f60efea41a870f82156219539d319a6685498f6ee3fc22d843311e974a00f5a

See more details on using hashes here.

File details

Details for the file nonconvexAG-0.9.5.9-py3-none-any.whl.

File metadata

  • Download URL: nonconvexAG-0.9.5.9-py3-none-any.whl
  • Upload date:
  • Size: 37.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for nonconvexAG-0.9.5.9-py3-none-any.whl
Algorithm Hash digest
SHA256 a82b1341405168331dce1dcf73b7cb3fae37721027d589fdda83e8ef64f689e0
MD5 bcf957e81005e2936d723d994fbb1c5d
BLAKE2b-256 6a5e0cc641523abc45a78311ae3afe9eebdb14c4048e6cd3b63af830e6b2d2cb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page