{"id":20240469,"url":"https://github.com/davidnabergoj/bootplot","last_synced_at":"2026-03-02T14:41:15.153Z","repository":{"id":45353110,"uuid":"486195288","full_name":"davidnabergoj/bootplot","owner":"davidnabergoj","description":"Bootplot is a package for black-box uncertainty visualization.","archived":false,"fork":false,"pushed_at":"2025-06-27T18:25:21.000Z","size":5823,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-27T18:39:04.076Z","etag":null,"topics":["animation","black-box","bootstrap","bootstrap-sampling","images","plotting","python","scientific-visualization","statistics","uncertainty","visualization"],"latest_commit_sha":null,"homepage":"https://bootplot.readthedocs.io/en/latest/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/davidnabergoj.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-04-27T13:04:51.000Z","updated_at":"2025-06-27T18:25:26.000Z","dependencies_parsed_at":"2022-08-04T09:00:21.635Z","dependency_job_id":null,"html_url":"https://github.com/davidnabergoj/bootplot","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/davidnabergoj/bootplot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidnabergoj%2Fbootplot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidnabergoj%2Fbootplot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidnabergoj%2Fbootplot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidnabergoj%2Fbootplot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davidnabergoj","download_url":"https://codeload.github.com/davidnabergoj/bootplot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davidnabergoj%2Fbootplot/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262315715,"owners_count":23292480,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["animation","black-box","bootstrap","bootstrap-sampling","images","plotting","python","scientific-visualization","statistics","uncertainty","visualization"],"created_at":"2024-11-14T08:46:38.089Z","updated_at":"2026-03-02T14:41:10.127Z","avatar_url":"https://github.com/davidnabergoj.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![logo](https://raw.githubusercontent.com/davidnabergoj/bootplot/master/logo.png)\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/davidnabergoj/bootplot/blob/main/LICENSE)\n[![Documentation Status](https://readthedocs.org/projects/bootplot/badge/?version=latest)](https://bootplot.readthedocs.io/en/latest/?badge=latest)\n[![build](https://github.com/davidnabergoj/bootplot/actions/workflows/build.yml/badge.svg)](https://github.com/davidnabergoj/bootplot/actions/workflows/build.yml)\n[![tests](https://github.com/davidnabergoj/bootplot/actions/workflows/tests.yml/badge.svg)](https://github.com/davidnabergoj/bootplot/actions/workflows/tests.yml)\n\n**bootplot** is a package for black-box uncertainty visualization. \nBy providing a dataset and a plotting function, **bootplot** automatically generates a static image and an animation of your uncertainty.\n\nThe method works by resampling the original dataset using bootstrap and plotting each bootstrapped sample.\nThe plots are then combined into a single image or an animation.\n**bootplot** is also especially useful when dealing with small datasets, since it\nrelies on the bootstrap method which robustly estimates uncertainty using resampling.\n\n**bootplot** supports datasets represented as numpy arrays or pandas dataframes. \nSupported image output formats include popular formats such as JPG, PNG, BMP. Supported animation formats include popular formats such as GIF and MP4.\n\u003c!--For a complete list of formats, see the [Pillow documentation](https://pillow.readthedocs.io/en/stable/handbook/image-file-formats.html) and the [FFMPEG documentation](https://ffmpeg.org/ffmpeg-formats.html).--\u003e\n\n## Installation\n\n**bootplot** requires Python version 3.8 or greater. You can install it using:\n\n```\npip install bootplot\n```\n\nAlternatively, you can install **bootplot** using:\n\n```\ngit clone https://github.com/davidnabergoj/bootplot\ncd bootplot\npython setup.py install\n```\n\n## Example\n\nSuppose we have some data and their corresponding targets. We can model our targets with a regression\nline and visualize the uncertainty with the following code:\n\n```python \nimport numpy as np\nfrom sklearn.linear_model import LinearRegression\n\nfrom bootplot import bootplot\n\n\ndef plot_regression(data_subset, data_full, ax):\n    # Plot full dataset\n    ax.scatter(data_full[:, 0], data_full[:, 1])\n\n    # Plot regression line trained on the subset\n    lr = LinearRegression()\n    lr.fit(data_subset[:, 0].reshape(-1, 1), data_subset[:, 1])\n    ax.plot([-10, 10], lr.predict([[-10], [10]]), c='r')\n    \n    # Show root mean squared error in a text box\n    rmse = np.sqrt(np.mean(np.square(data_subset[:, 1] - lr.predict(data_subset[:, 0].reshape(-1, 1)))))\n    bbox_kwargs = dict(facecolor='none', edgecolor='black', pad=10.0)\n    ax.text(x=0, y=-8, s=f'RMSE: {rmse:.4f}', fontsize=12, ha='center', bbox=bbox_kwargs)\n\n    ax.set_xlim(-10, 10)\n    ax.set_ylim(-10, 10)\n\nif __name__ == '__main__':\n    np.random.seed(0)\n\n    # Dataset to be modeled\n    dataset = np.random.randn(100, 2)\n    noise = np.random.randn(len(dataset)) * 2.5\n    dataset[:, 1] = dataset[:, 0] * 1.5 + 2 + noise\n\n    # Create image and animation that show uncertainty\n    bootplot(\n        plot_regression,\n        dataset,\n        output_image_path='demo_image.png',\n        output_animation_path='demo_animation.gif',\n        verbose=True\n    )\n```\n\nThis will generate a static image and an animation, as shown below.\nThe static image on points shows the full scattered dataset in blue and regression lines that correspond to each\nbootstrapped sample of the dataset in red.\nThe spread of regression lines represents uncertainty according to the bootstrap process.\nWe can also see the uncertainty in root mean squared error (RMSE).\nWe see that only the first digit of RMSE is significant, since the decimal part is blurred.\nThe animation on the right displays uncertainty by iterating over a sequence of plots containing regression lines.\n\n\u003ctable\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e\u003cimg src=\"https://raw.githubusercontent.com/davidnabergoj/bootplot/master/demo_image.png\"\u003e\u003c/td\u003e\n        \u003ctd\u003e\u003cimg src=\"https://raw.githubusercontent.com/davidnabergoj/bootplot/master/demo_animation.gif\"\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n\u003c/table\u003e\n\nSee the [examples](examples) folder for more examples, including bar charts, point plots, polynomial regression models, pie charts, text plots and pandas dataframes.\n\n## Documentation\n\nRead the documentation and check out tutorials at https://bootplot.readthedocs.io/en/latest/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidnabergoj%2Fbootplot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavidnabergoj%2Fbootplot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavidnabergoj%2Fbootplot/lists"}