tdent / pop-de Goto Github PK
View Code? Open in Web Editor NEWPopulation inference via density estimation
License: MIT License
Population inference via density estimation
License: MIT License
At present the KDE values are in variables (coordinates) determined by self.kde_data
: i.e. the KDE is a density over a space defined in specific coordinates. In general these will not be physically useful or meaningful units.
So, make the required inverse transformations in the density to convert it to the units of self.transf_data
('transformed data units') and then also to self.data
('original data units').
This is probably best done by adding new methods to the basic density estimate class ('SimpleKernelDensityEstimation') which take an array of KDE values and transform it from kde_data
units to the desired ones.
Add a class in a new module, as a subclass of the KDEpy basic estimate (or of the existing variable bandwidth KDE class), to implement a general adaptive KDE. It will evaluate an initial 'pilot' KDE (with fixed scalar bandwidth) at the data point positions. It will then calculate per-point bandwidths via some formula based on the pilot KDE values (eg the Wang & Wang formula at https://github.com/mennthor/awkde/tree/master). Its main evaluation method will use the per-point bandwidths.
New methods of the basic simple KDE.
To keep track of dimensions with different units/orders of magnitude etc., calculate the standard deviation along each dimension (after applying a possible transformation function as in #7), store and then calculate standardized data, ie data with each dimension divided by its std.
The basic KDE fit method should then have an option/argument to use the standardized data or not. The difference will be in how the bandwidth is applied (ie do the units of the bandwidth correspond to the data, or the standardized data).
Add an example for the use of class SimpleKernelDensityEstimation after verification
Since we may want to change the global bw / alpha values for an existing awkde instance, add methods (similar to set_bandwidth) which allow the values to be changed and also redo the necessary adaptive fitting steps.
Allow options for initialising the class to transform the input data variables, eg take log of one of more dimensions, and perform rescaling by a constant factor for each dimension after transformation. Store both the original and transformed/rescaled data and allow for evaluating the KDE over either.
Edited : Considering #14 , it is preferable to separate any transformation functions from rescaling which we may want to do after standardization / immediately before fitting the KDE. (Specifically, rescaling before standardization has no effect.)
A plotting module can include convenience functions for labelling axes, setting up grids of points, identifying slices (values at points in space defined by a given constant parameter value), integrating (/marginalizing) a KDE over one or more variables etc.
The basic structure is for the main density estimate module to import functions or other objects from the plotting module so that plotting methods can be coded concisely for the classes
A plotting module can include convenience functions for labelling axes, setting up grids of points, identifying slices (values at points in space defined by a given constant parameter value), integrating (/marginalizing) a KDE over one or more variables etc.
The basic structure is for the main density estimate module to import functions or other objects from the plotting module so that plotting methods can be coded concisely
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.