pasteur.attribute.GenerationValue#
- class pasteur.attribute.GenerationValue(name, max_len)[source]#
Attributes
Returns the maximum height of this value.
Methods
downsample(value, height)Receives an array named value and downsamples it based on the provided height, by grouping certain values together.
get_domain(height)Returns the domain of the attribute in the given height.
get_domain_multiple(heights, vals)Returns a list of human readable values for each discrete value.
get_mapping(height)Returns a numpy array that associates discrete values with groups at the given height.
get_mapping_multiple(heights, common, vals)get_naive_mapping_multiple(heights, common, vals)Returns whether this value is ordinal, other than for the elements it shares in common with the other attributes.
prefix_rename(prefix)rename(name[, name_cnt])replace(**kwargs)upsample(value, height[, deterministic])Does the opposite of downsample.
- property domain#
- downsample(value, height)#
Receives an array named value and downsamples it based on the provided height, by grouping certain values together. The proper implementation is provided by pasteur.hierarchy.
- get_domain(height)#
Returns the domain of the attribute in the given height.
- static get_domain_multiple(heights, vals)#
- get_human_readable()#
Returns a list of human readable values for each discrete value.
- Return type:
list[str]
- get_mapping(height)#
Returns a numpy array that associates discrete values with groups at the given height.
- static get_mapping_multiple(heights, common, vals)#
- Return type:
ndarray
- static get_naive_mapping_multiple(heights, common, vals)#
- property height#
Returns the maximum height of this value.
-
ignore_nan:
bool#
- is_ordinal()#
Returns whether this value is ordinal, other than for the elements it shares in common with the other attributes.
- Return type:
bool
-
max_len:
int#
-
name:
str#
- replace(**kwargs)#
- select_height()#
- Return type:
int
- upsample(value, height, deterministic=True)#
Does the opposite of downsample. If deterministic is True, for each group at a given height one of its values is chosen arbitrarily to represent all children of the group.
If deterministic is False, the group is sampled based on this Value’s histogram (not implemented in this class; see pasteur.hierarchy).