Skip to main content

magmaviz

ci-cd codecov Documentation Status

Exploratory Data Analysis is one of the key steps in a machine learning project. This package aims to make this process easy by providing python functions based on the 'Altair' package to plot four common types of plots with the magma color scheme. To maximize interpretability, the plots have defined color schemes (discrete, diverging, sequential) based on the kind of data they show.

Installation

$ pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple magmaviz

Usage

The interactive version of the usage section can be found here:

Documentation Status

This package defines four data visualization functions, all with a magma color scheme. They are meant to be used in any data analysis projects using Python.

Boxplot

Returns a boxplot based on a data frame, a numerical feature to view the distribution of and a categorical feature to bucket data into categories. Additionally, there is a boolean option to facet the boxplots into separate charts.

from magmaviz.boxplot import boxplot
boxplot(cars, 'Miles_per_Gallon', 'Origin', facet='Cylinders')

Correlation Plot

Returns a correlation plot based on the numerical features present in the data frame. While the default plot would use circle shapes, an auxiliary input provides the flexibility to switch to square shapes. Additionally, it will print the correlated numerical feature pairs along with their correlation values.

from magmaviz.corrplot import corrplot
corrplot(df, print_corr=True, shape="square")

Histogram

Returns a histogram based on the data frame and a categorical feature to plot on the x-axis. The y-axis will display the result of some of the following aggregating functions:

  • Average
  • Count
  • Distinct
  • Max
  • Min
  • Median
  • Mean
  • Among others (listed in documentation for the function).
from magmaviz.histogram import histogram
histogram(mtcars, "cars", "count()")

Scatterplot

Returns a scatterplot based on the data frame and two numerical feature names passed as the required inputs. There are auxiliary inputs that provide the flexibility to:

  • Color code or change the shape of the data points on a categorical variable
  • Set a title to the plot, x-axis, y-axis and color legend
  • Change the opacity and size of the data points
  • Set the scale of the x-axis and y-axis to start from zero
from magmaviz.scatterplot import scatterplot
scatterplot(df, x, y, c="", t="", o=1.0, s=50, xtitle="", ytitle="", ctitle="", xzero=False, yzero=False, shapes=True)

Fit within the Python ecosystem

Our package will build onto the existing features of 'Altair' using the magma color scheme. It serves as an automated plotter and is a higher level implementation of it. Essentially it circumvents the need to code every single detail and allows the user to focus on the output. We came across two packages that have a similar line of thought:

  • deneb (Altair) - uses the same base as this package
  • spartan-viz (Matplotlib) - same philosophy as this package: focus on good use of color

Contributing

The primary contributors to this package are:

  1. Abdul Moid Mohammed
  2. Mukund Iyer
  3. Irene Yan
  4. Rubén De la Garza Macías

We welcome new ideas and contributions. Please refer to the contributing guidelines in the CONTRIBUTING.MD file. Do note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.

License

magmaviz was created by Abdul Moid Mohammed, Mukund Iyer, Irene Yan, Rubén De la Garza Macías. It is licensed under the terms of the MIT license.

Credits

magmaviz was created with cookiecutter and the py-pkgs-cookiecutter template.

Metadata

Release files for magmaviz 0.4.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for magmaviz 0.4.3
File Size Uploaded
magmaviz-0.4.3.tar.gz 9.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for magmaviz 0.4.3
File Interpreter ABI Platform
magmaviz-0.4.3-py3-none-any.whl Python 3 none any Details

Total release size: 19.6 kB

Release files / magmaviz-0.4.3.tar.gz

Download URL magmaviz-0.4.3.tar.gz
Size 9.8 kB
Tags Source
SHA-256 checksum
How to use checksums
1b0640fa9147ea0d377c90ad322a3ca80291f0c057a1dab80c6d106c80f59916
BLAKE2b-256 checksum
How to use checksums
289214df3f4efb79c262c7da6ebe5bd897ed5de9357a0390b30443d1f8f8da5c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

Release files / magmaviz-0.4.3-py3-none-any.whl

Download URL magmaviz-0.4.3-py3-none-any.whl
Size 9.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a1482ee31f5bbae02c64730f141116da51de208e91b18f17dbccceffb1a66e13
BLAKE2b-256 checksum
How to use checksums
920f902c02b336b1c846b0fde80018d8731ed6da90d075b15690bbf4be8736e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

Release history Release notifications | RSS feed

This release

0.4.3 This release

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.8

2 release files

0.3.7

2 release files

0.3.6

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.4

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page