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

Index contains NaNs when using sample_remaining_columns #985

Closed
amontanez24 opened this issue Aug 30, 2022 · 0 comments · Fixed by #993
Closed

Index contains NaNs when using sample_remaining_columns #985

amontanez24 opened this issue Aug 30, 2022 · 0 comments · Fixed by #993
Assignees
Labels
bug Something isn't working
Milestone

Comments

@amontanez24
Copy link
Contributor

Environment Details

Please indicate the following details about the environment in which you found the bug:

  • SDV version: 0.17.0.dev1
  • Python version: Any
  • Operating System: Any

Error Description

When calling sample_remaining_columns with conditions that have different values, the index in the output contains Nans.

Steps to reproduce

Create any model and fit to the demo data. Then create conditions on the same column with multiple different values. Call sample_remaining_columns with those conditions.

from sdv.sampling import Condition
import pandas as pd 
from sdv.tabular import CopulaGAN
from sdv.demo import load_tabular_demo

data = load_tabular_demo('student_placements')

model = CopulaGAN(
    primary_key='student_id',
    epochs=500,
    batch_size=100,
    generator_dim=(256, 256, 256),
    discriminator_dim=(256, 256, 256)
)
model.fit(data)
conditions = pd.DataFrame({
    'gender': ['M', 'M', 'M', 'F', 'F', 'F']
})
sampled = model.sample_remaining_columns(conditions)

image

@amontanez24 amontanez24 added the bug Something isn't working label Aug 30, 2022
@amontanez24 amontanez24 added this to the 0.17.0 milestone Aug 30, 2022
@amontanez24 amontanez24 changed the title Index is messed up when using sample_remaining_columns Index contains NaNs when using sample_remaining_columns Aug 30, 2022
@amontanez24 amontanez24 self-assigned this Sep 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant