Open seatonullberg opened 1 year ago
Good piece of work. Would you mind if I ask if there is any progress on this? Thanks.
Hi @humphreylee, I'm currently preoccupied with writing my dissertation, but I do intend to get back to this as soon as I am able.
bump! am using seaborn in python to do 2d kde contour plots but its very slow. am hoping that by using rust I can use the webasm stuff to do this fast on the client side instead of generating plots (exteremly slowly) on the server to send to a web client.
Currently only univariate distributions are supported. A complete implementation would include seamless support for multivariate distributions. The only type that should be changed is the
KernelDensityEstimator
struct. Currently, the data structure is as follows:The
observations
field will need to be converted to analgebra::DMatrix
to support a multivariate distribution. The type should be hidden behind an alias so that end-users do not need to addnalgebra
as a dependency in their own projects.To prevent needless conversions for users working with univariate data, the data structure could instead add a generic parameter
T
representing the type ofobservations
. For univariate dataT
could be concretely represented asVec<Float>
and for multivariate dataT
could be concretely represented asMatrix2D
. However, this would require the introduction of two new traitsUnivariateKDE
andMultivariateKDE
to mimic overloading of the method namespdf
,cdf
, andsample
.Lastly, the traits
UnivariateKDE
andMultivariateKDE
should be sealed to prevent end-user implementations.