Utilities

Math Utilities

bamt.utils.MathUtils.lrts_comp(data)[source]
bamt.utils.MathUtils.mix_norm_cdf(x, weights, means, covars)[source]
bamt.utils.MathUtils.theoretical_quantile(data, n_comp)[source]
bamt.utils.MathUtils.quantile_mix(p, vals, q)[source]
bamt.utils.MathUtils.probability_mix(val, vals, q)[source]
bamt.utils.MathUtils.sum_dist(data, vals, q)[source]
bamt.utils.MathUtils.component(data, columns, method)[source]
bamt.utils.MathUtils.precision_recall(pred_net: list, true_net: list, decimal=4)[source]

Graph Utilities

bamt.utils.GraphUtils.nodes_types(data: DataFrame) Dict[str, str][source]
Function to define the type of the node

disc - discrete node cont - continuous

Args:

data: input dataset

Returns:

dict: output dictionary where ‘key’ - node name and ‘value’ - node type

bamt.utils.GraphUtils.nodes_signs(nodes_types: dict, data: DataFrame) Dict[str, str][source]
Function to define sign of the node

neg - if node has negative values pos - if node has only positive values

Parameters:
  • data (pd.DataFrame) – input dataset

  • nodes_types (dict) – dict with nodes_types

Returns:

output dictionary where ‘key’ - node name and ‘value’ - sign of data

Return type:

dict

bamt.utils.GraphUtils.get_descriptor(data) Dict[str, Dict[str, str]][source]
bamt.utils.GraphUtils.toporder(nodes: List[Type[BaseNode]], edges: List[Tuple]) List[List[str]][source]

Function for topological sorting

class bamt.utils.GraphUtils.GraphAnalyzer(bn)[source]

Bases: object

Object to analyze DAG.

markov_blanket(node_name: str)[source]
find_family(*args)[source]

Evolutionary Utilities

Evolutionary Utilities