metasyn.distribution.faker.FakerDistribution

class metasyn.distribution.faker.FakerDistribution(faker_type, locale='en_US')

Faker distribution for cities, addresses, etc.

This is mainly an interface for the faker package, so that it can be used within the metasyn package. It doesn’t have any true fitting/statistical inference method, so it has to be manually selected.

Parameters:
  • faker_type (str) – The provider function in the faker package, e.g. ‘city’ or ‘ipv4’, etc.

  • locale (str) – Locale used for the faker package.

Examples

>>> FakerDistribution(faker_type="city", locale="en_US")
>>> FakerDistribution(faker_type="address", locale="nl_NL")
name

core.faker

unique

False

version

1.0

var_type

string

__init__(faker_type, locale='en_US')
Parameters:
  • faker_type (str)

  • locale (str)

Methods

__init__(faker_type[, locale])

default_distribution([var_type])

Get a distribution with default parameters.

draw()

Draw a random element from the fitted distribution.

draw_list(n)

Draw a list of values from the distribution.

draw_reset()

Reset the drawing of elements to start again.

from_dict(dist_dict)

Create a distribution from a dictionary.

information_criterion(values)

Get the BIC value for a particular set of values.

matches_name(name)

Check whether the name matches the distribution.

provides_var_type(var_type)

schema()

Create sub-schema to validate GMF file.

to_dict()

Convert the distribution to a dictionary.

Attributes

name

The identifier for the implemented distribution

unique

Whether the distribution creates only unique values

var_type

The variable type of the distribution

version

Version of the implemented distribution