You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now, if I pass in a metadata.Table object into a model and fit it, the process will modify my metadata (add extra fields to it).
This can lead to unexpected behavior due to the extra fields that were added, especially if I want to re-use the metadata object in a different model.
Can we make a deep copy of the metadata.Table object instead?
Steps to reproduce
See the code below for unexpected usage
fromsdv.tabularimportGaussianCopulafromsdv.demoimportload_tabular_demometadata, data=load_tabular_demo('student_placements', metadata=True)
# create a model that estimates everything as a gamma distributionmodel=GaussianCopula(table_metadata=metadata,
categorical_transformer='label_encoding',
default_distribution='gamma')
model.fit(data)
print(model.get_distributions()) # each distribution correctly is a Gamma# create a new model that estimates everything as a betamodel2=GaussianCopula(table_metadata=metadata,
categorical_transformer='label_encoding',
default_distribution='beta')
model2.fit(data)
print(model2.get_distributions()) # Everything is still gamma. This is unexpected!
This is happening because, unbeknownst to me, my metadata is modified to include a 'gamma' distribution field for each and every column. I am unknowingly passing it into model2, which is favoring the metadata over the default_distribution parameter.
The text was updated successfully, but these errors were encountered:
Environment Details
Description
Right now, if I pass in a
metadata.Table
object into a model and fit it, the process will modify my metadata (add extra fields to it).This can lead to unexpected behavior due to the extra fields that were added, especially if I want to re-use the metadata object in a different model.
Can we make a deep copy of the
metadata.Table
object instead?Steps to reproduce
See the code below for unexpected usage
This is happening because, unbeknownst to me, my metadata is modified to include a 'gamma' distribution field for each and every column. I am unknowingly passing it into
model2
, which is favoring the metadata over thedefault_distribution
parameter.The text was updated successfully, but these errors were encountered: