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

Unwanted negative numbers generated #138

Closed
wbarnsley opened this issue Dec 11, 2019 · 2 comments
Closed

Unwanted negative numbers generated #138

wbarnsley opened this issue Dec 11, 2019 · 2 comments

Comments

@wbarnsley
Copy link

  • SDV version: 0.2.2
  • Python version: 3.7.3
  • Operating System: mac

Description

I was trying to generate a synthetic version of a table. The table in question has two numeric columns, of which all of the entries are positive. After fitting the sdv object, I sampled and found that the two numeric columns contained negative values. After reading your paper from IEEE I was under the impression a truncated gaussian would be used and that this should not happen.

What I Did

import pandas as pd
from sdv import SDV, Metadata

df_data = pd.DataFrame(data = {'col_1':list(range(10))})

sdv = SDV()
table = {'data': df_data}
metadata = Metadata()
metadata.add_table('data', data=table['data'])
sdv.fit(metadata, table)
df_synth = sdv.sample_all(len(df_data.index))['data']

print(df_synth)

Output

   col_1
0     10
1     -3
2      0
3      8
4      3
5      9
6      6
7      8
8      4
9      7
@csala
Copy link
Contributor

csala commented Jan 14, 2020

Hi @wbarnsley the truncated gaussian distribution was indeed not being used before.
We are currently doing some changes here and on the Copulas library that will make using the Truncated Gaussian distribution on SDV.
We will let you know here once the changes are all in and ready to use.
Stay tuned!

@csala
Copy link
Contributor

csala commented Oct 13, 2020

This topic is being covered in a newer issue, so I'm closing this to follow up in one place only.

@csala csala closed this as completed Oct 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants