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 support for Vine Copulas as a modeler. #71

Closed
ManuelAlvarezC opened this issue Nov 16, 2018 · 0 comments · Fixed by #80
Closed

Add support for Vine Copulas as a modeler. #71

ManuelAlvarezC opened this issue Nov 16, 2018 · 0 comments · Fixed by #80
Assignees
Labels
feature request Request for a new feature
Milestone

Comments

@ManuelAlvarezC
Copy link
Contributor

It could be useful to add support for different models. To archieve that we should:

  1. Wait for this issue of Copulas is done and released.

  2. Update our requirements to work with the latests version of copulas.

  3. Add a new method sdv.Modeler.flatten_dict, that gets a nested dictionary and returns it flattened:

     >>> nested_dict
     {
         'one_attribute': 0
         'nested_attribute': {
             'foo': 'bar
         }
     }
     
     >>> sdv.Modeler.flatten_dict(nested_dict)
    
     {
        'one_attribute': 0
        'nested_attribute__foo': 'bar'
     }
  4. Add a new method sdv.Sampler.unflatten_dict that does the exact opposite, that is:

     >>> assert nested_dict == sdv.Sampler.unflatten_dict(sdv.Modeler.flatten_dict(nested_dict))
     >>> assert flattened_dict = sdv.Modeler.flatten_dict(sdv.Sampler.unflatten_dict(flattened_dict))
  5. Change the behavior of sdv.Modeler.flatten_model in order for it recieve a modelas input and return a pandas.Series with the flattened model dict.

  6. Rename the distribution keyword on sdv.Modeler.__init__ to model_kwargs that defaults to None, but when its present its passed to model when instances are created.

  7. Change the behavior of sdv.Sampler._make_model_from_params to make that after the parameters have been retrieved from the parent_row are transform into a dictionary, passed to sdv.Sampler.unflatten_dict and the result to model.from_dict

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
1 participant