synthcity.plugins.core.distribution module

class CategoricalDistribution(*, name: str, data: Optional[pandas.core.series.Series] = None, random_state: int = 0, marginal_distribution: Optional[pandas.core.series.Series] = None, choices: list = [])

Bases: synthcity.plugins.core.distribution.Distribution

Inheritance diagram of synthcity.plugins.core.distribution.CategoricalDistribution
class Config

Bases: object

arbitrary_types_allowed = True
as_constraint() synthcity.plugins.core.constraints.Constraints

Convert the Distribution to a set of Constraints.

choices: list
classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) Model

Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed. Behaves as if Config.extra = ‘allow’ was set since it adds all passed values

copy(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, update: Optional[DictStrAny] = None, deep: bool = False) Model

Duplicate a model, optionally choose which fields to include, exclude and change.

Parameters
  • include – fields to include in new model

  • exclude – fields to exclude from new model, as with values this takes precedence over include

  • update – values to change/add in the new model. Note: the data is not validated before creating the new model: you should trust this data

  • deep – set to True to make a deep copy of the model

Returns

new model instance

data: Optional[pandas.core.series.Series]
dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False) DictStrAny

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

dtype() str
classmethod from_orm(obj: Any) Model
get() List[Any]

Return the metadata of the Distribution.

has(val: Any) bool

Test if a value is included in the Distribution.

includes(other: synthcity.plugins.core.distribution.Distribution) bool

Test if another Distribution is included in the local one.

json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, encoder: Optional[Callable[[Any], Any]] = None, models_as_dict: bool = True, **dumps_kwargs: Any) unicode

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

marginal_distribution: Optional[pandas.core.series.Series]
marginal_probabilities() Optional[List]
marginal_states() Optional[List]
max() Any

Get the max value of the distribution.

min() Any

Get the min value of the distribution.

name: str
classmethod parse_file(path: Union[str, pathlib.Path], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: pydantic.parse.Protocol = None, allow_pickle: bool = False) Model
classmethod parse_obj(obj: Any) Model
classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: pydantic.parse.Protocol = None, allow_pickle: bool = False) Model
random_state: int
sample(count: int = 1) Any

Sample a value from the Distribution.

sample_marginal(count: int = 1) Any
classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') DictStrAny
classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) unicode
classmethod update_forward_refs(**localns: Any) None

Try to update ForwardRefs on fields based on this Model, globalns and localns.

classmethod validate(value: Any) Model
class DatetimeDistribution(*, name: str, data: Optional[pandas.core.series.Series] = None, random_state: int = 0, marginal_distribution: Optional[pandas.core.series.Series] = None, low: datetime.datetime = datetime.datetime(1970, 1, 1, 0, 0), high: datetime.datetime = datetime.datetime(2024, 3, 11, 11, 44, 28, 414668), step: datetime.timedelta = datetime.timedelta(microseconds=1), offset: datetime.timedelta = datetime.timedelta(seconds=120))

Bases: synthcity.plugins.core.distribution.Distribution

Inheritance diagram of synthcity.plugins.core.distribution.DatetimeDistribution
class Config

Bases: object

arbitrary_types_allowed = True
as_constraint() synthcity.plugins.core.constraints.Constraints

Convert the Distribution to a set of Constraints.

classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) Model

Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed. Behaves as if Config.extra = ‘allow’ was set since it adds all passed values

copy(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, update: Optional[DictStrAny] = None, deep: bool = False) Model

Duplicate a model, optionally choose which fields to include, exclude and change.

Parameters
  • include – fields to include in new model

  • exclude – fields to exclude from new model, as with values this takes precedence over include

  • update – values to change/add in the new model. Note: the data is not validated before creating the new model: you should trust this data

  • deep – set to True to make a deep copy of the model

Returns

new model instance

data: Optional[pandas.core.series.Series]
dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False) DictStrAny

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

dtype() str
classmethod from_orm(obj: Any) Model
get() List[Any]

Return the metadata of the Distribution.

has(val: datetime.datetime) bool

Test if a value is included in the Distribution.

high: datetime.datetime
includes(other: synthcity.plugins.core.distribution.Distribution) bool

Test if another Distribution is included in the local one.

json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, encoder: Optional[Callable[[Any], Any]] = None, models_as_dict: bool = True, **dumps_kwargs: Any) unicode

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

low: datetime.datetime
marginal_distribution: Optional[pandas.core.series.Series]
marginal_probabilities() Optional[List]
marginal_states() Optional[List]
max() Any

Get the max value of the distribution.

min() Any

Get the min value of the distribution.

name: str
offset: datetime.timedelta
classmethod parse_file(path: Union[str, pathlib.Path], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: pydantic.parse.Protocol = None, allow_pickle: bool = False) Model
classmethod parse_obj(obj: Any) Model
classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: pydantic.parse.Protocol = None, allow_pickle: bool = False) Model
random_state: int
sample(count: int = 1) Any

Sample a value from the Distribution.

sample_marginal(count: int = 1) Any
classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') DictStrAny
classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) unicode
step: datetime.timedelta
classmethod update_forward_refs(**localns: Any) None

Try to update ForwardRefs on fields based on this Model, globalns and localns.

classmethod validate(value: Any) Model
class Distribution(*, name: str, data: Optional[pandas.core.series.Series] = None, random_state: int = 0, marginal_distribution: Optional[pandas.core.series.Series] = None)

Bases: pydantic.main.BaseModel

Inheritance diagram of synthcity.plugins.core.distribution.Distribution

Base class of all Distributions.

The Distribution class characterizes the empirical marginal distribution of the feature. Each derived class must implement the following methods:

get() - Return the metadata of the Distribution. sample() - Sample a value from the Distribution. includes() - Test if another Distribution is included in the local one. has() - Test if a value is included in the support of the Distribution. as_constraint() - Convert the Distribution to a set of Constraints. min() - Return the minimum of the support. max() - Return the maximum of the support. __eq__() - Testing equality of two Distributions. dtype() - Return the data type

Examples of derived classes include CategoricalDistribution, FloatDistribution, and IntegerDistribution.

class Config

Bases: object

arbitrary_types_allowed = True
abstract as_constraint() synthcity.plugins.core.constraints.Constraints

Convert the Distribution to a set of Constraints.

classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) Model

Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed. Behaves as if Config.extra = ‘allow’ was set since it adds all passed values

copy(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, update: Optional[DictStrAny] = None, deep: bool = False) Model

Duplicate a model, optionally choose which fields to include, exclude and change.

Parameters
  • include – fields to include in new model

  • exclude – fields to exclude from new model, as with values this takes precedence over include

  • update – values to change/add in the new model. Note: the data is not validated before creating the new model: you should trust this data

  • deep – set to True to make a deep copy of the model

Returns

new model instance

data: Optional[pandas.core.series.Series]
dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False) DictStrAny

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

abstract dtype() str
classmethod from_orm(obj: Any) Model
abstract get() List[Any]

Return the metadata of the Distribution.

abstract has(val: Any) bool

Test if a value is included in the Distribution.

abstract includes(other: synthcity.plugins.core.distribution.Distribution) bool

Test if another Distribution is included in the local one.

json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, encoder: Optional[Callable[[Any], Any]] = None, models_as_dict: bool = True, **dumps_kwargs: Any) unicode

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

marginal_distribution: Optional[pandas.core.series.Series]
marginal_probabilities() Optional[List]
marginal_states() Optional[List]
abstract max() Any

Get the max value of the distribution.

abstract min() Any

Get the min value of the distribution.

name: str
classmethod parse_file(path: Union[str, pathlib.Path], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: pydantic.parse.Protocol = None, allow_pickle: bool = False) Model
classmethod parse_obj(obj: Any) Model
classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: pydantic.parse.Protocol = None, allow_pickle: bool = False) Model
random_state: int
abstract sample(count: int = 1) Any

Sample a value from the Distribution.

sample_marginal(count: int = 1) Any
classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') DictStrAny
classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) unicode
classmethod update_forward_refs(**localns: Any) None

Try to update ForwardRefs on fields based on this Model, globalns and localns.

classmethod validate(value: Any) Model
class FloatDistribution(*, name: str, data: Optional[pandas.core.series.Series] = None, random_state: int = 0, marginal_distribution: Optional[pandas.core.series.Series] = None, low: float = - 1.7976931348623157e+308, high: float = 1.7976931348623157e+308)

Bases: synthcity.plugins.core.distribution.Distribution

Inheritance diagram of synthcity.plugins.core.distribution.FloatDistribution
class Config

Bases: object

arbitrary_types_allowed = True
as_constraint() synthcity.plugins.core.constraints.Constraints

Convert the Distribution to a set of Constraints.

classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) Model

Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed. Behaves as if Config.extra = ‘allow’ was set since it adds all passed values

copy(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, update: Optional[DictStrAny] = None, deep: bool = False) Model

Duplicate a model, optionally choose which fields to include, exclude and change.

Parameters
  • include – fields to include in new model

  • exclude – fields to exclude from new model, as with values this takes precedence over include

  • update – values to change/add in the new model. Note: the data is not validated before creating the new model: you should trust this data

  • deep – set to True to make a deep copy of the model

Returns

new model instance

data: Optional[pandas.core.series.Series]
dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False) DictStrAny

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

dtype() str
classmethod from_orm(obj: Any) Model
get() List[Any]

Return the metadata of the Distribution.

has(val: Any) bool

Test if a value is included in the Distribution.

high: float
includes(other: synthcity.plugins.core.distribution.Distribution) bool

Test if another Distribution is included in the local one.

json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, encoder: Optional[Callable[[Any], Any]] = None, models_as_dict: bool = True, **dumps_kwargs: Any) unicode

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

low: float
marginal_distribution: Optional[pandas.core.series.Series]
marginal_probabilities() Optional[List]
marginal_states() Optional[List]
max() Any

Get the max value of the distribution.

min() Any

Get the min value of the distribution.

name: str
classmethod parse_file(path: Union[str, pathlib.Path], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: pydantic.parse.Protocol = None, allow_pickle: bool = False) Model
classmethod parse_obj(obj: Any) Model
classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: pydantic.parse.Protocol = None, allow_pickle: bool = False) Model
random_state: int
sample(count: int = 1) Any

Sample a value from the Distribution.

sample_marginal(count: int = 1) Any
classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') DictStrAny
classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) unicode
classmethod update_forward_refs(**localns: Any) None

Try to update ForwardRefs on fields based on this Model, globalns and localns.

classmethod validate(value: Any) Model
class IntLogDistribution(*, name: str, data: Optional[pandas.core.series.Series] = None, random_state: int = 0, marginal_distribution: Optional[pandas.core.series.Series] = None, low: int = 1, high: int = 9223372036854775807, step: int = 1)

Bases: synthcity.plugins.core.distribution.IntegerDistribution

class Config

Bases: object

arbitrary_types_allowed = True
as_constraint() synthcity.plugins.core.constraints.Constraints

Convert the Distribution to a set of Constraints.

classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) Model

Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed. Behaves as if Config.extra = ‘allow’ was set since it adds all passed values

copy(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, update: Optional[DictStrAny] = None, deep: bool = False) Model

Duplicate a model, optionally choose which fields to include, exclude and change.

Parameters
  • include – fields to include in new model

  • exclude – fields to exclude from new model, as with values this takes precedence over include

  • update – values to change/add in the new model. Note: the data is not validated before creating the new model: you should trust this data

  • deep – set to True to make a deep copy of the model

Returns

new model instance

data: Optional[pandas.core.series.Series]
dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False) DictStrAny

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

dtype() str
classmethod from_orm(obj: Any) Model
get() List[Any]

Return the metadata of the Distribution.

has(val: Any) bool

Test if a value is included in the Distribution.

high: int
includes(other: synthcity.plugins.core.distribution.Distribution) bool

Test if another Distribution is included in the local one.

json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, encoder: Optional[Callable[[Any], Any]] = None, models_as_dict: bool = True, **dumps_kwargs: Any) unicode

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

low: int
marginal_distribution: Optional[pandas.core.series.Series]
marginal_probabilities() Optional[List]
marginal_states() Optional[List]
max() Any

Get the max value of the distribution.

min() Any

Get the min value of the distribution.

name: str
classmethod parse_file(path: Union[str, pathlib.Path], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: pydantic.parse.Protocol = None, allow_pickle: bool = False) Model
classmethod parse_obj(obj: Any) Model
classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: pydantic.parse.Protocol = None, allow_pickle: bool = False) Model
random_state: int
sample(count: int = 1) Any

Sample a value from the Distribution.

sample_marginal(count: int = 1) Any
classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') DictStrAny
classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) unicode
step: int
classmethod update_forward_refs(**localns: Any) None

Try to update ForwardRefs on fields based on this Model, globalns and localns.

classmethod validate(value: Any) Model
class IntegerDistribution(*, name: str, data: Optional[pandas.core.series.Series] = None, random_state: int = 0, marginal_distribution: Optional[pandas.core.series.Series] = None, low: int = - 9223372036854775808, high: int = 9223372036854775807, step: int = 1)

Bases: synthcity.plugins.core.distribution.Distribution

Inheritance diagram of synthcity.plugins.core.distribution.IntegerDistribution
class Config

Bases: object

arbitrary_types_allowed = True
as_constraint() synthcity.plugins.core.constraints.Constraints

Convert the Distribution to a set of Constraints.

classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) Model

Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed. Behaves as if Config.extra = ‘allow’ was set since it adds all passed values

copy(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, update: Optional[DictStrAny] = None, deep: bool = False) Model

Duplicate a model, optionally choose which fields to include, exclude and change.

Parameters
  • include – fields to include in new model

  • exclude – fields to exclude from new model, as with values this takes precedence over include

  • update – values to change/add in the new model. Note: the data is not validated before creating the new model: you should trust this data

  • deep – set to True to make a deep copy of the model

Returns

new model instance

data: Optional[pandas.core.series.Series]
dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False) DictStrAny

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

dtype() str
classmethod from_orm(obj: Any) Model
get() List[Any]

Return the metadata of the Distribution.

has(val: Any) bool

Test if a value is included in the Distribution.

high: int
includes(other: synthcity.plugins.core.distribution.Distribution) bool

Test if another Distribution is included in the local one.

json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, encoder: Optional[Callable[[Any], Any]] = None, models_as_dict: bool = True, **dumps_kwargs: Any) unicode

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

low: int
marginal_distribution: Optional[pandas.core.series.Series]
marginal_probabilities() Optional[List]
marginal_states() Optional[List]
max() Any

Get the max value of the distribution.

min() Any

Get the min value of the distribution.

name: str
classmethod parse_file(path: Union[str, pathlib.Path], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: pydantic.parse.Protocol = None, allow_pickle: bool = False) Model
classmethod parse_obj(obj: Any) Model
classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: pydantic.parse.Protocol = None, allow_pickle: bool = False) Model
random_state: int
sample(count: int = 1) Any

Sample a value from the Distribution.

sample_marginal(count: int = 1) Any
classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') DictStrAny
classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) unicode
step: int
classmethod update_forward_refs(**localns: Any) None

Try to update ForwardRefs on fields based on this Model, globalns and localns.

classmethod validate(value: Any) Model
class LogDistribution(*, name: str, data: Optional[pandas.core.series.Series] = None, random_state: int = 0, marginal_distribution: Optional[pandas.core.series.Series] = None, low: float = 2.2250738585072014e-308, high: float = 1.7976931348623157e+308)

Bases: synthcity.plugins.core.distribution.FloatDistribution

class Config

Bases: object

arbitrary_types_allowed = True
as_constraint() synthcity.plugins.core.constraints.Constraints

Convert the Distribution to a set of Constraints.

classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) Model

Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed. Behaves as if Config.extra = ‘allow’ was set since it adds all passed values

copy(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, update: Optional[DictStrAny] = None, deep: bool = False) Model

Duplicate a model, optionally choose which fields to include, exclude and change.

Parameters
  • include – fields to include in new model

  • exclude – fields to exclude from new model, as with values this takes precedence over include

  • update – values to change/add in the new model. Note: the data is not validated before creating the new model: you should trust this data

  • deep – set to True to make a deep copy of the model

Returns

new model instance

data: Optional[pandas.core.series.Series]
dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False) DictStrAny

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

dtype() str
classmethod from_orm(obj: Any) Model
get() List[Any]

Return the metadata of the Distribution.

has(val: Any) bool

Test if a value is included in the Distribution.

high: float
includes(other: synthcity.plugins.core.distribution.Distribution) bool

Test if another Distribution is included in the local one.

json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, encoder: Optional[Callable[[Any], Any]] = None, models_as_dict: bool = True, **dumps_kwargs: Any) unicode

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

low: float
marginal_distribution: Optional[pandas.core.series.Series]
marginal_probabilities() Optional[List]
marginal_states() Optional[List]
max() Any

Get the max value of the distribution.

min() Any

Get the min value of the distribution.

name: str
classmethod parse_file(path: Union[str, pathlib.Path], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: pydantic.parse.Protocol = None, allow_pickle: bool = False) Model
classmethod parse_obj(obj: Any) Model
classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: pydantic.parse.Protocol = None, allow_pickle: bool = False) Model
random_state: int
sample(count: int = 1) Any

Sample a value from the Distribution.

sample_marginal(count: int = 1) Any
classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') DictStrAny
classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) unicode
classmethod update_forward_refs(**localns: Any) None

Try to update ForwardRefs on fields based on this Model, globalns and localns.

classmethod validate(value: Any) Model
constraint_to_distribution(constraints: synthcity.plugins.core.constraints.Constraints, feature: str) synthcity.plugins.core.distribution.Distribution

Infer Distribution from Constraints.

Parameters
  • constraints – Constraints The Constraints on features.

  • feature – str The name of the feature in question.

Returns

The inferred Distribution.