{ "info": { "author": "Matthew Perry", "author_email": "perrygeo@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "Intended Audience :: Science/Research", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.4", "Topic :: Scientific/Engineering :: GIS", "Topic :: Utilities" ], "description": "![travis](https://travis-ci.org/perrygeo/pyimpute.svg)\n\n## Python module for geospatial prediction using scikit-learn and rasterio\n\n`pyimpute` provides high-level python functions for bridging the gap between spatial data formats and machine learning software to facilitate supervised classification and regression on geospatial data. This allows you to create landscape-scale predictions based on sparse observations.\n\nThe observations, known as the **training data**, consists of:\n\n* response variables: what we are trying to predict\n* explanatory variables: variables which explain the spatial patterns of responses\n\nThe **target data** consists of explanatory variables represented by raster datasets. There are no response variables available for the target data; the goal is to *predict* a raster surface of responses. The responses can either be discrete (classification) or continuous (regression).\n\n![example](https://raw.githubusercontent.com/perrygeo/pyimpute/master/example.png)\n\n## Pyimpute Functions\n\n* `load_training_vector`: Load training data where responses are vector data (explanatory variables are always raster)\n* `load_training_raster`: Load training data where responses are raster data\n* `stratified_sample_raster`: Random sampling of raster cells based on discrete classes\n* `evaluate_clf`: Performs cross-validation and prints metrics to help tune your scikit-learn classifiers.\n* `load_targets`: Loads target raster data into data structures required by scikit-learn\n* `impute`: takes target data and your scikit-learn classifier and makes predictions, outputing GeoTiffs\n \nThese functions don't really provide any ground-breaking new functionality, they merely saves lots of tedious data wrangling that would otherwise bog your analysis down in low-level details. In other words, `pyimpute` provides a high-level python workflow for spatial prediction, making it easier to:\n\n* explore new variables more easily\n* frequently update predictions with new information (e.g. new Landsat imagery as it becomes available)\n* bring the technique to other disciplines and geographies\n\n\n### Basic example\n\nHere's what a `pyimpute` workflow might look like. In this example, we have two explanatory variables as rasters (temperature and precipitation) and a geojson with point observations of habitat suitability for a plant species. Our goal is to predict habitat suitability across the entire region based only on the explanatory variables.\n\n```\nfrom pyimpute import load_training_vector, load_targets, impute, evaluate_clf\nfrom sklearn.ensemble import RandomForestClassifier\n```\n\nLoad some training data\n```\nexplanatory_rasters = ['temperature.tif', 'precipitation.tif']\nresponse_data = 'point_observations.geojson'\n\ntrain_xs, train_y = load_training_vector(response_data,\n explanatory_rasters,\n response_field=\"suitability\")\n```\n\nTrain a scikit-learn classifier\n```\nclf = RandomForestClassifier(n_estimators=10, n_jobs=1)\nclf.fit(train_xs, train_y)\n```\n\nEvalute the classifier using several validation metrics, manually inspecting the output\n```\nevaluate_clf(clf, train_xs, train_y)\n```\n\nLoad target raster data\n```\ntarget_xs, raster_info = load_targets(explanatory_rasters)\n```\n\nMake predictions, outputing geotiffs\n```\nimpute(target_xs, clf, raster_info, outdir='/tmp',\n linechunk=400, class_prob=True, certainty=True)\n\nassert os.path.exists(\"/tmp/responses.tif\")\nassert os.path.exists(\"/tmp/certainty.tif\")\nassert os.path.exists(\"/tmp/probability_0.tif\")\nassert os.path.exists(\"/tmp/probability_1.tif\")\n```\n\n### Installation\n\nAssuming you have `libgdal` and the scipy system dependencies installed, you can install with pip \n\n```\npip install pyimpute\n```\n\nAlternatively, install from the source code\n```\ngit clone https://github.com/perrygeo/pyimpute.git\ncd pyimpute\npip install -e .\n```\n\nSee the `.travis.yml` file for a working example on Ubuntu systems.\n\n### Other resources\n\nFor an overview, watch my presentation at FOSS4G 2014: Spatial-Temporal Prediction of Climate Change Impacts using pyimpute, scikit-learn and GDAL \u2014 Matthew Perry \n\nAlso, check out [the examples](https://github.com/perrygeo/python-impute/blob/master/examples/) and [the wiki](https://github.com/perrygeo/pyimpute/wiki)", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/perrygeo/pyimpute", "keywords": "gis geospatial geographic raster vector zonal statistics machinelearning", "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "pyimpute", "package_url": "https://pypi.org/project/pyimpute/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/pyimpute/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/perrygeo/pyimpute" }, "release_url": "https://pypi.org/project/pyimpute/0.1.2/", "requires_dist": null, "requires_python": null, "summary": "Utilities for applying scikit-learn to spatial datasets", "version": "0.1.2" }, "last_serial": 1771971, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "d8e0624c7251eb8c2f0116249a280521", "sha256": "1cc9cd048c7d75aef678479559230ca4dc6b508c4de80cde57d2e9a414b27486" }, "downloads": -1, "filename": "pyimpute-0.0.1.tar.gz", "has_sig": false, "md5_digest": "d8e0624c7251eb8c2f0116249a280521", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6665, "upload_time": "2014-06-18T18:26:21", "url": "https://files.pythonhosted.org/packages/19/3e/b1150ebca1a12adbd13c881cdd8074b1d1584b1db6a51269703e7aadd359/pyimpute-0.0.1.tar.gz" }, { "comment_text": "", "digests": { "md5": "ab6b9f55cb34a2f6fff0e685386762b8", "sha256": "91911579851a2338f5990d61c8865443a6ac082a0c09c98874396cbb55294459" }, "downloads": -1, "filename": "pyimpute-0.0.1.zip", "has_sig": false, "md5_digest": "ab6b9f55cb34a2f6fff0e685386762b8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10846, "upload_time": "2014-06-18T18:26:24", "url": "https://files.pythonhosted.org/packages/e6/52/d9ae94a4ca2b3ac78dd2a6a83f3cb56ad3405b5145ac5db5a92530a99601/pyimpute-0.0.1.zip" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "9b76e1469281bc13702bacf5b70afdb1", "sha256": "6381819ae2ed75cc768ba38e5cc5d699972162054cba2bc83bcbae6ceb1e2e98" }, "downloads": -1, "filename": "pyimpute-0.0.2.tar.gz", "has_sig": false, "md5_digest": "9b76e1469281bc13702bacf5b70afdb1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7975, "upload_time": "2014-06-18T18:41:06", "url": "https://files.pythonhosted.org/packages/ac/e5/6704f71666b510008c017f13df8e8c464865b5615e895164fe0129b8fff5/pyimpute-0.0.2.tar.gz" }, { "comment_text": "", "digests": { "md5": "6dc9c7580816525bfa8034d0679267a0", "sha256": "48f3bab251f24fe4ca61777d4b81f1a9d97741d6814510d8ecf61960c6d596e1" }, "downloads": -1, "filename": "pyimpute-0.0.2.zip", "has_sig": false, "md5_digest": "6dc9c7580816525bfa8034d0679267a0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14346, "upload_time": "2014-06-18T18:41:08", "url": "https://files.pythonhosted.org/packages/d1/22/e6aabf1a88dc2c3ab27421045f02cd5fd172254057f103d80cc0653920ea/pyimpute-0.0.2.zip" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "10ebb2fd6c662fad21ab3447310d2a75", "sha256": "e09f018250f18b747745f6545f001751479727eaf5fa7cadcd704bad02bc1215" }, "downloads": -1, "filename": "pyimpute-0.0.3.tar.gz", "has_sig": false, "md5_digest": "10ebb2fd6c662fad21ab3447310d2a75", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8700, "upload_time": "2014-08-05T23:31:48", "url": "https://files.pythonhosted.org/packages/77/87/5f45b268686a1d894ec51fd14378901165ea9d5bff9a36985774094099ed/pyimpute-0.0.3.tar.gz" }, { "comment_text": "", "digests": { "md5": "38d246cf8c8a19f05de135ed8f3ef28c", "sha256": "7897dc5de2b7e0b479d48458c4314abb3c59578a836a6536ca3836e8390ec54c" }, "downloads": -1, "filename": "pyimpute-0.0.3.zip", "has_sig": false, "md5_digest": "38d246cf8c8a19f05de135ed8f3ef28c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15205, "upload_time": "2014-08-05T23:31:50", "url": "https://files.pythonhosted.org/packages/9a/e6/0dd09f354534e0eeedf849d9ec8a46cb0a6f8cf4e4512ee67b2318ba1a80/pyimpute-0.0.3.zip" } ], "0.1": [ { "comment_text": "", "digests": { "md5": "114ed14ed063e42129de3b3f44a0b7cd", "sha256": "497ae191b7a03cf0c3584eb1e9bf72fb9c5de6775d3b067cae387433d32c04a0" }, "downloads": -1, "filename": "pyimpute-0.1.tar.gz", "has_sig": false, "md5_digest": "114ed14ed063e42129de3b3f44a0b7cd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9194, "upload_time": "2015-10-15T21:45:16", "url": "https://files.pythonhosted.org/packages/74/5a/d2567b78872d6a37cda5776b0485df1070e67718a30cefd0c3bcb71e5f2a/pyimpute-0.1.tar.gz" }, { "comment_text": "", "digests": { "md5": "32ec37e94753c6a6e6a4228b54d63724", "sha256": "2faed33f4679926c3b512df830a4e5efe83f8f40dddebfe95bbf12aba02ea30a" }, "downloads": -1, "filename": "pyimpute-0.1.zip", "has_sig": false, "md5_digest": "32ec37e94753c6a6e6a4228b54d63724", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15786, "upload_time": "2015-10-15T21:45:20", "url": "https://files.pythonhosted.org/packages/0f/2e/b0d02cedd9bb81e1e9098b703445691296d918e164e467c5bad23d6ebd79/pyimpute-0.1.zip" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "6c6ae8e47034a7509458406528d30224", "sha256": "53177765c367b34fd02add81530ad5a58c635951647740755c59683dca5d9e50" }, "downloads": -1, "filename": "pyimpute-0.1.1.tar.gz", "has_sig": false, "md5_digest": "6c6ae8e47034a7509458406528d30224", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7699, "upload_time": "2015-10-16T15:38:08", "url": "https://files.pythonhosted.org/packages/99/c6/2df42b5bb58aaa4df884324408e0bf568dec4514ac10e225a1982bc550cf/pyimpute-0.1.1.tar.gz" }, { "comment_text": "", "digests": { "md5": "7a50dcf61f4bdf59280083c620ace3f8", "sha256": "8750a773232c321b06bac17f7ae8694997f9db8c08ca022e86b8d272d092287e" }, "downloads": -1, "filename": "pyimpute-0.1.1.zip", "has_sig": false, "md5_digest": "7a50dcf61f4bdf59280083c620ace3f8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13498, "upload_time": "2015-10-16T15:38:15", "url": "https://files.pythonhosted.org/packages/fc/31/4ee80da7dee442fcad2dbf1b5aa3a0a71eb63eae9b5885143228f6149c56/pyimpute-0.1.1.zip" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "f22d117c27001770d5838b5207ac13e1", "sha256": "df01b3d04c9c2a97fdd09d4d2b41bc52c9bdcde833111de7d5a23b58049e50de" }, "downloads": -1, "filename": "pyimpute-0.1.2.tar.gz", "has_sig": false, "md5_digest": "f22d117c27001770d5838b5207ac13e1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7707, "upload_time": "2015-10-16T15:53:36", "url": "https://files.pythonhosted.org/packages/ac/e5/dbec2d613a3599e6a7d6a0bf30ed10ac2374c4520bfda39ac8b043757684/pyimpute-0.1.2.tar.gz" }, { "comment_text": "", "digests": { "md5": "2b7817b536d39df1892ea9e71d3ec01a", "sha256": "e72c062a71b04fe1f3527305cbfd5f5a40a02abf704d30e73cb22e4fdb137207" }, "downloads": -1, "filename": "pyimpute-0.1.2.zip", "has_sig": false, "md5_digest": "2b7817b536d39df1892ea9e71d3ec01a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13509, "upload_time": "2015-10-16T15:53:41", "url": "https://files.pythonhosted.org/packages/ed/0c/7a4d2c6a5809b957bcfeb17630eb91c55e2ec36e68dcce41dcf35c8d9683/pyimpute-0.1.2.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f22d117c27001770d5838b5207ac13e1", "sha256": "df01b3d04c9c2a97fdd09d4d2b41bc52c9bdcde833111de7d5a23b58049e50de" }, "downloads": -1, "filename": "pyimpute-0.1.2.tar.gz", "has_sig": false, "md5_digest": "f22d117c27001770d5838b5207ac13e1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7707, "upload_time": "2015-10-16T15:53:36", "url": "https://files.pythonhosted.org/packages/ac/e5/dbec2d613a3599e6a7d6a0bf30ed10ac2374c4520bfda39ac8b043757684/pyimpute-0.1.2.tar.gz" }, { "comment_text": "", "digests": { "md5": "2b7817b536d39df1892ea9e71d3ec01a", "sha256": "e72c062a71b04fe1f3527305cbfd5f5a40a02abf704d30e73cb22e4fdb137207" }, "downloads": -1, "filename": "pyimpute-0.1.2.zip", "has_sig": false, "md5_digest": "2b7817b536d39df1892ea9e71d3ec01a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13509, "upload_time": "2015-10-16T15:53:41", "url": "https://files.pythonhosted.org/packages/ed/0c/7a4d2c6a5809b957bcfeb17630eb91c55e2ec36e68dcce41dcf35c8d9683/pyimpute-0.1.2.zip" } ] }