{ "info": { "author": "Wesley Tansey", "author_email": "wes.tansey@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Science/Research", "License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Topic :: Scientific/Engineering" ], "description": "A Fast, Flexible Algorithm for the Graph-Fused Lasso\n----------------------------------------------------\n\n

\n \"Example\n

\n\nThe goal in the graph-fused lasso (GFL) is to find a solution to the following convex optimization problem:\n\n

\n \"GFL\n

\n\nwhere __l__ is a smooth, convex loss function. The problem assumes you are given a graph structure of edges and nodes, where each node corresponds to a variable and edges between nodes correspond to constraints on the first differences between the variables. The objective function then seeks to find a solution to the above problem that minimizes the loss function over the vertices plus the sum of the first differences defined by the set of edges __E__.\n\nThe solution implemented here is based on the graph-theoretic trail decomposition and ADMM algorithm implemented in [1]. The code relies on a slightly modified version of a linear-time dynamic programming solution to the 1-d (i.e. chain) GFL [2].\n\nPython Requirements\n===================\nThe python (Python version 2) wrapper requires `numpy`, `scipy`, and `networkx` to be able to run everything.\nNote that the `libgraphfl` library also depends on the [Gnu Scientific Library `gsl`](https://www.gnu.org/software/gsl/) which should be available on your system.\n\nInstalling\n==========\nThe package can be installed via Pip:\n\n`pip install pygfl`\n\nor directly from source:\n\n```\npython setup.py build\npython setup.py install\n```\n\nNote that the installation has not been tested on anything other than Mac OS X and Ubuntu. The underlying solver is implemented in pure C and should be cross-platform compatible.\n\nRunning\n=======\nThe simplest way to run the script is via the command-line `graphfl` script. You just give it a CSV of your data that you wish to smooth and a CSV of your edges, one edge per row:\n\n```\ngraphfl example/data.csv example/edges.csv --o example/smoothed.csv\n```\n\nThis will run a solution path to auto-tune the value of the penalty parameter (the \u03bb in equation 1). The results will be saved in `example/smoothed.csv`. The results should look something like the image at the top of the readme.\n\nCalling within Python\n=====================\nTo call the solver within a Python program, the simplest way is to use the `easy.solve_gfl` method:\n\n```\nimport numpy as np\nfrom pygfl.easy import solve_gfl\n\n# Load data and edges\ny = np.loadtxt('path/to/data.csv', delimiter=',')\nedges = np.loadtxt('/path/to/edges.csv', delimiter=',', dtype=int)\n\n# Run the solver\nbeta = solve_gfl(y, edges)\n```\n\nThere are lots of other configuration options that affect the optimization procedure, but honestly they make little practical difference for most people.\n\nCompiling the C solver lib separately\n=====================================\nTo compile the C solver as a standalone library, you just need to run the make file from the `cpp` directory:\n\n`make all`\n\nThen you will need to make sure that you have the `cpp/lib` directory in your `LD_LIBRARY_PATH`:\n\n`export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/my/path/to/gfl/cpp/lib/`\n\nNote the above instructions are for *nix users.\n\nLicensing\n=========\nThis library / package is distributed under the GNU Lesser General Public License, version 3. Note that a subset of code from [2] was modified and is included in the C source.\n\nReferences\n==========\n[1] W. Tansey and J. G. Scott. \"[A Fast and Flexible Algorithm for the Graph-Fused Lasso](http://arxiv.org/abs/1505.06475),\" arXiv:1505.06475, May 2015.\n\n[2] [glmgen](https://github.com/statsmaths/glmgen)", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/tansey/gfl", "keywords": "statistics machinelearning lasso fusedlasso", "license": "LGPL", "maintainer": "", "maintainer_email": "", "name": "pygfl", "package_url": "https://pypi.org/project/pygfl/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pygfl/", "project_urls": { "Homepage": "https://github.com/tansey/gfl" }, "release_url": "https://pypi.org/project/pygfl/1.0.2/", "requires_dist": [ "networkx", "numpy", "scipy" ], "requires_python": "", "summary": "A Fast and Flexible Graph-Fused Lasso Solver", "version": "1.0.2" }, "last_serial": 2438901, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "9f08debaf437d0222a086065a95aca8c", "sha256": "bcd870165b5acc63addf09214cf47e7b6bb889f172b5ac38d85aa110e144009c" }, "downloads": -1, "filename": "pygfl-1.0.0-cp27-none-macosx_10_9_x86_64.whl", "has_sig": false, "md5_digest": "9f08debaf437d0222a086065a95aca8c", "packagetype": "bdist_wheel", "python_version": "cp27", "requires_python": null, "size": 27698, "upload_time": "2015-08-04T22:31:19", "url": "https://files.pythonhosted.org/packages/5c/d1/9517b950c40ee407ab2760a0d9bcabda5f55c6118960b7b93892dc9b0bb3/pygfl-1.0.0-cp27-none-macosx_10_9_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "a543f421603b64633bb7894fffc9d120", "sha256": "0f0a143d3723a013dd0c47cdcc9a388da7cce2f4b757f27135d1763e0a219e74" }, "downloads": -1, "filename": "pygfl-1.0.0.tar.gz", "has_sig": false, "md5_digest": "a543f421603b64633bb7894fffc9d120", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 204766, "upload_time": "2015-08-04T22:31:22", "url": "https://files.pythonhosted.org/packages/86/53/dfc2e4ad8bee3bad7edae8fdbccaa606e585cfa3280c63d41b87a9e020b8/pygfl-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "254b6b4a77f7cbe56eabe5ede390e9a0", "sha256": "6f635ee77d77aa8d6cb0fe63ffe4976d02318bcb560d9facaaa774f8cc9f3aa5" }, "downloads": -1, "filename": "pygfl-1.0.1-cp27-none-macosx_10_9_x86_64.whl", "has_sig": false, "md5_digest": "254b6b4a77f7cbe56eabe5ede390e9a0", "packagetype": "bdist_wheel", "python_version": "cp27", "requires_python": null, "size": 28014, "upload_time": "2015-10-29T00:49:09", "url": "https://files.pythonhosted.org/packages/3c/58/7bcf034ae5a55cb8faee18e7264edcd9ddaafb3549afb2de166bbec8e6b3/pygfl-1.0.1-cp27-none-macosx_10_9_x86_64.whl" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "a3bb3d1cfbe0c9f52c93fcd02cb15014", "sha256": "398f4864f0a3d3fcfd413579ebcce50b2ce5b11d6604a0340bfbb6b57b2d7caf" }, "downloads": -1, "filename": "pygfl-1.0.2-cp27-cp27m-macosx_10_9_x86_64.whl", "has_sig": false, "md5_digest": "a3bb3d1cfbe0c9f52c93fcd02cb15014", "packagetype": "bdist_wheel", "python_version": "cp27", "requires_python": null, "size": 84298, "upload_time": "2016-11-03T00:37:27", "url": "https://files.pythonhosted.org/packages/80/09/f5fa21244a850ae3971524119613965e8ad63313696d8a11a080e6ea8910/pygfl-1.0.2-cp27-cp27m-macosx_10_9_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "8f6f6cf89f35e762c5930f9246078f61", "sha256": "210415f9b9cdb0c808dde092111613ab10f2d9edf5baa50b74fe50a75055eb0f" }, "downloads": -1, "filename": "pygfl-1.0.2.tar.gz", "has_sig": false, "md5_digest": "8f6f6cf89f35e762c5930f9246078f61", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 245229, "upload_time": "2016-11-03T00:37:30", "url": "https://files.pythonhosted.org/packages/52/c0/31de6d69d71e98a6eccc2c8956abfbfa2926c50ddcbeaa8c2bd850ce0c9d/pygfl-1.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a3bb3d1cfbe0c9f52c93fcd02cb15014", "sha256": "398f4864f0a3d3fcfd413579ebcce50b2ce5b11d6604a0340bfbb6b57b2d7caf" }, "downloads": -1, "filename": "pygfl-1.0.2-cp27-cp27m-macosx_10_9_x86_64.whl", "has_sig": false, "md5_digest": "a3bb3d1cfbe0c9f52c93fcd02cb15014", "packagetype": "bdist_wheel", "python_version": "cp27", "requires_python": null, "size": 84298, "upload_time": "2016-11-03T00:37:27", "url": "https://files.pythonhosted.org/packages/80/09/f5fa21244a850ae3971524119613965e8ad63313696d8a11a080e6ea8910/pygfl-1.0.2-cp27-cp27m-macosx_10_9_x86_64.whl" }, { "comment_text": "", "digests": { "md5": "8f6f6cf89f35e762c5930f9246078f61", "sha256": "210415f9b9cdb0c808dde092111613ab10f2d9edf5baa50b74fe50a75055eb0f" }, "downloads": -1, "filename": "pygfl-1.0.2.tar.gz", "has_sig": false, "md5_digest": "8f6f6cf89f35e762c5930f9246078f61", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 245229, "upload_time": "2016-11-03T00:37:30", "url": "https://files.pythonhosted.org/packages/52/c0/31de6d69d71e98a6eccc2c8956abfbfa2926c50ddcbeaa8c2bd850ce0c9d/pygfl-1.0.2.tar.gz" } ] }