Options

class aixd.data.Options(array: List, type: str = 'categorical')[source]

Bases: Domain

Defines a set of options, e.g., for categorical variables.

Parameters:
  • array (List) – The list of options.

  • type (str, optional, default=”categorical”) – The type of the domain. Can be “categorical”, “ordinal”, “integer”, “any”.

Methods

check_domain_consistency

Checks if the data is within the domain.

copy

Returns a copy of the instance.

domain_to_normalised

Maps from discrete values to a range [0, 1] by attributing an equal share of the range to each of the possible options of the domain.

grid_samples

Returns samples chosen with grid sampling from the domain.

normalised_to_domain

Maps from a distribution in [0, 1] to [0, len(self.array)] and is then rounded to serve as indices for discretisation.

random_samples

Returns samples chosen with random sampling from the domain.

sample_around

Returns samples chosen with a sample around strategy from the domain.

update_domain

Updates the domain according to the given data.