Git Product home page Git Product logo

parallelsparseregression.jl's Introduction

ParallelSparseRegression

Build Status

A Julia library for parallel sparse regression using shared memory. This library implements solvers for regression problems including least squares, ridge regression, lasso, non-negative least squares, and elastic net. It also proposes to add fast methods to obtain regularization paths.

Using the Alternating Direction Method of Multipliers, all of these problems can be reduced to computing the prox of each term in the objective. We rely on the fact that the prox of each term in the objective of these regression problems can be efficiently computed in parallel.

Installation

To install, just open a Julia prompt and call

Pkg.clone("[email protected]:madeleineudell/ParallelSparseRegression.jl.git")

Usage

Before you begin, initialize all the processes you want to participate in multiplying by your matrix. You'll suffer decreased performance if you add more processes than you have hyperthreads on your shared-memory computer.

addprocs(3)
using ParallelSparseRegression

We will solve a sparse non-negative least squares problem.

m,n,p = 100,20,.1
A = sprand(m,n,p)
x0 = Base.shmem_randn(n)
b = A*x0
rho = 1
quiet = false
maxiters = 100

params = Params(rho,quiet,maxiters)
z = nnlsq(A,b; params=params)

We can verify the solution obtained is better than merely thresholding the entries of the least squares solution to be positive.

println("Norm of Az-b is $(norm(A*z-b))")
xp = max(x0,0)
println("Norm of A(x)_+ -b is $(norm(A*xp-b))")

parallelsparseregression.jl's People

Contributors

madeleineudell avatar

Watchers

Ariel Núñez avatar James Cloos avatar  avatar

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.