msgl

Multinomial sparse group lasso

https://github.com/nielsrhansen/msgl

Science Score: 23.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
    Found 3 DOI reference(s) in README
  • Academic publication links
  • Committers with academic emails
    1 of 2 committers (50.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.3%) to scientific vocabulary
Last synced: 11 months ago · JSON representation

Repository

Multinomial sparse group lasso

Basic Info
  • Host: GitHub
  • Owner: nielsrhansen
  • License: gpl-2.0
  • Language: R
  • Default Branch: master
  • Homepage:
  • Size: 1.64 MB
Statistics
  • Stars: 3
  • Watchers: 2
  • Forks: 1
  • Open Issues: 0
  • Releases: 0
Created almost 8 years ago · Last pushed over 2 years ago
Metadata Files
Readme License

README.md

Multinomial sparse group lasso

Multiclass classification with feature and parameter selection using sparse group lasso for the multinomial model. Suitable for high dimensional problems.

This is the R package msgl version 2.3.8.

R-package Overview

This package implements procedures for working with multinomial logistic regression models using sparse group lasso. This includes procedures for fitting and cross validating sparse models in a high dimensional setup. See the Getting started with msgl (predict primary cancer site based on microRNA measurements) for an example of a workflow consisting of 1) model selection and assessment using cross validation, 2) estimation of a final model and 3) using the selected model for carrying out predictions on new data.

alt tag

Classification of cancer site. Error estimated by 10-fold cross validation on a data set consisting of microRNA expression measurements of laser dissected primary cancers.

Package highlights:

  • Feature and parameter selection
  • Fast coordinate gradient descent algorithm
  • Suitable for high dimensional multiclass classification
  • Support for lasso, group lasso and sparse group lasso
  • Supports custom grouping of features
  • Supports sample weighting
  • Supports individual weighting of the group and parameter penalties

The penalized maximum likelihood estimator for multinomial logistic regression is computed using a coordinate gradient descent algorithm via the sglOptim optimizer. Use of parallel computing for cross validation and subsampling is supported through the foreach and doParallel packages.

Installation

Installation from souce requires installation of the necessary compiler tools for Mac or Windows.

Install the package from GitHub:

``` r

install.packages("remotes") # uncomment if remotes is not already installed

remotes::installgithub("nielsrhansen/sglOptim", buildvignettes = TRUE) remotes::installgithub("nielsrhansen/msgl", buildvignettes = TRUE) ```

If you don't want to build the vignettes when installing, just remove the build_vignettes = TRUE argument.

Minimal Example

``` r library(msgl)

Load some data

data(PrimaryCancers)

Setup 2 parallel units

cl <- makeCluster(2) registerDoParallel(cl)

Do 10-fold cross validation on 100 models with increasing complexity, using the 2 parallel units

fit.cv <- msgl::cv( x = x, classes = classes, alpha = 0.5, lambda = 0.5, use_parallel = TRUE ) ```

## Running msgl 10 fold cross validation (dense design matrix)
## 
##  Samples:  Features:  Classes:  Groups:  Parameters: 
##        165        372         9      372       3.348k

``` r stopCluster(cl)

Print information about models

and cross validation errors

fit.cv ```

## 
## Call:
## msgl::cv(x = x, classes = classes, alpha = 0.5, lambda = 0.5, 
##     use_parallel = TRUE)
## 
## Models:
## 
##  Index:  Lambda:  Features:  Parameters:  Error: 
##        1     1.00        1.6         12.1    0.96
##       20     0.88          5         31.9    0.72
##       40     0.76        8.7         51.1    0.62
##       60     0.66       11.1           64    0.56
##       80     0.58       15.7         88.9    0.46
##      100     0.50       21.7        118.5    0.35
## 
## Best model:
## 
##  Index:  Lambda:  Features:  Parameters:  Error: 
##       96     0.51       20.8        113.7    0.35

Documentation

Author

Martin Vincent wrote the package. Niels Richard Hansen is the current maintainer.

License

GPL (>=2)

Owner

  • Login: nielsrhansen
  • Kind: user

GitHub Events

Total
  • Watch event: 1
  • Fork event: 1
Last Year
  • Watch event: 1
  • Fork event: 1

Committers

Last synced: almost 3 years ago

All Time
  • Total Commits: 163
  • Total Committers: 2
  • Avg Commits per committer: 81.5
  • Development Distribution Score (DDS): 0.043
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Martin Vincent m****k@g****m 156
nielsrhansen n****n@m****k 7
Committer Domains (Top 20 + Academic)

Packages

  • Total packages: 1
  • Total downloads:
    • cran 295 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 1
  • Total versions: 18
  • Total maintainers: 1
cran.r-project.org: msgl

Multinomial Sparse Group Lasso

  • Versions: 18
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 295 Last month
Rankings
Forks count: 21.0%
Dependent repos count: 23.9%
Stargazers count: 25.5%
Average: 27.9%
Dependent packages count: 28.7%
Downloads: 40.4%
Maintainers (1)
Last synced: over 2 years ago

Dependencies

DESCRIPTION cran
  • Matrix * depends
  • R >= 3.2.4 depends
  • sglOptim >= 1.3.7 depends
  • methods * imports
  • stats * imports
  • tools * imports
  • utils * imports
  • knitr * suggests
  • rmarkdown * suggests