Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a BayesianGMM Transformer #183

Closed
fealho opened this issue Jul 15, 2021 · 0 comments · Fixed by #329
Closed

Add a BayesianGMM Transformer #183

fealho opened this issue Jul 15, 2021 · 0 comments · Fixed by #329
Assignees
Labels
feature request Request for a new feature
Milestone

Comments

@fealho
Copy link
Member

fealho commented Jul 15, 2021

The main idea of this transformer is to take a continuous value and map it into a continuous + categorical value (which is represented with a one-hot-encoding). To implement this, most of the code can be taken from here, specifically the _fit_continuous, _transform_continuous, and _reverse_transform_continuous functions.

  1. The fit method will train the BayesianGMM model. A GMM model has multiple "modes", where each "mode" is a Gaussian.
  2. The transform method will take the raw values and will randomly select a mode (proportional to the probability of the value coming from that mode). Then, it generates a normalized version of the raw value by (approximately) subtracting/dividing by the mean/std.
  3. The reverse_transform method will select the maximum likelihood mode and reverse the transformation.

Two things to note:

  1. Multiple calls to fit can return different numbers of output columns. For example, in one run, it might infer 3 modes in the data, resulting in 4 output columns. In another run, if a random seed isn't set, it may infer a different number of modes.
  2. Multiple calls to transform can generate different outputs. Although the result is always reversible, the mode is randomly selected (proportional to the likelihood).

When implementing this in RDT, we may want to allow the user to enable/disable these.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Request for a new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants