has2k1 / has2k1/plotnine

Feature Request: Add alternative (quicker) density estimation options for `stat_density`

Open
#573 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement Feature Performance
Dominant language
Python
Stars
4.8k
Forks
254
Avg merge
10h 35m
Merged PRs (30d)
9

Description

I notice that in plotnine/stats/density.py there's support for several methods of calculating density but stat_density is locked into using statsmodels KDEUnivariate https://github.com/has2k1/plotnine/blob/a81b8f92bc39b6835e506e6779a01e4b8c53a627/plotnine/stats/stat_density.py#L177

I would love to be able to select a faster/more efficient method for computing densities so that performance can be more similar to seaborn in this respect.

Please let me know if I can help through a PR

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with plotnine/stats/density.py to review the available density methods, then inspect plotnine/stats/stat_density.py around line 177 where KDEUnivariate is selected. Compare the existing method interfaces and determine a concrete selection mechanism and completion criteria for faster density computation, with appropriate tests for stat_density.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-visualization, performance
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.