so4gp.gradual_patterns.TGP

class TGP[source]

A class that inherits an existing GP class to create Temporal GP objects. A TGP is a gradual pattern with a time-delay. It has a target gradual item (which is created from a user-defined attribute), and it is used as the anchor for mining patterns from a dataset. The class has the following attributes:

target_gradual_item: the gradual item on which the pattern is based.

temporal_gradual_items: gradual items which occur after specific time delays.

>>> import so4gp as sgp
>>> t_gp = sgp.TGP()
>>> t_gp.target_gradual_item = sgp.GI(1, "+")
>>> t_gp.add_temporal_gradual_item(sgp.GI(2, "-"), sgp.TimeDelay(7200, 0.8))
>>> t_gp.to_string()
__init__()[source]

A class that inherits an existing GP class to create Temporal GP objects. A TGP is a gradual pattern with a time-delay. It has a target gradual item (which is created from a user-defined attribute), and it is used as the anchor for mining patterns from a dataset. The class has the following attributes:

target_gradual_item: the gradual item on which the pattern is based.

temporal_gradual_items: gradual items which occur after specific time delays.

>>> import so4gp as sgp
>>> t_gp = sgp.TGP()
>>> t_gp.target_gradual_item = sgp.GI(1, "+")
>>> t_gp.add_temporal_gradual_item(sgp.GI(2, "-"), sgp.TimeDelay(7200, 0.8))
>>> t_gp.to_string()

Methods

__init__()

A class that inherits an existing GP class to create Temporal GP objects.

add_gradual_item(item)

Adds a gradual item (GI) into the gradual pattern (GP) :param item: gradual item

add_temporal_gradual_item(item, time_delay)

Adds a fuzzy temporal gradual item (fTGI) into the fuzzy temporal gradual pattern (fTGP) :param item: gradual item :type item: so4gp.GI

check_am(gp_list[, subset])

Anti-monotonicity check.

compute_descriptors(warping_set, obj_count)

Computes gradual warping set (GWS) descriptors for a given gradual pattern.

contains_attr(gi)

Checks if any gradual item (GI) in the gradual pattern (GP) is composed of the column :param gi: gradual item :type gi: GI

decompose()

Breaks down all the gradual items (GIs) in the gradual pattern into columns and variation symbols and returns them as separate variables.

get_computed_descriptors(descriptor_title)

Returns the computed descriptors of the gradual pattern (GP)

is_duplicate(valid_gps[, invalid_gps])

Checks if a pattern is in the list of winner GPs or loser GPs

is_similar_to(ftgp)

Checks if two fuzzy temporal gradual patterns are similar.

perform_and(bin_data_1, bin_data_2, dim)

Perform logical AND operation on two bitmaps.

print(columns[, descriptor_title])

A method that returns a fuzzy temporal gradual pattern (TGP) with actual column names

swap_gp_symbols(gp_obj)

Swaps the variation symbols of all the gradual items (GIs) in a gradual pattern (GP)

to_string()

Returns the Temporal-GP in string format as a list.

validate_graank(d_gp)

Validates a candidate gradual pattern (GP) based on support computation.

validate_tree(d_gp)

Validates a candidate gradual pattern (GP) based on support computation.

Attributes

as_set

{'1+', '2-'}

as_swapped_set

{'1-', '2+'}

avg_deviation_from_diagonal

density

gradual_items

graph_connectivity

rank_dispersion

singularity_score

support

target_gradual_item

temporal_gradual_items