copulas/multivariate/tree.py
def from_dict(cls, tree_dict, previous=None):
        """Create a new instance from a dictionary."""
        instance = cls(tree_dict['tree_type'])

        fitted = tree_dict['fitted']
        instance.fitted = fitted
        if fitted:
            instance.level = tree_dict['level']
            instance.n_nodes = tree_dict['n_nodes']
            instance.tau_matrix = np.array(tree_dict['tau_matrix'])
            instance.previous_tree = cls._deserialize_previous_tree(tree_dict, previous)
            instance.edges = [Edge.from_dict(edge) for edge in tree_dict['edges']]

        return instance
Create a new instance from a dictionary.
Create a new instance from a dictionary.
Create a new instance from a dictionary .
def from_dict(cls, tree_dict, previous=None):
        instance = cls(tree_dict['tree_type'])
        fitted = tree_dict['fitted']
        instance.fitted = fitted
        if fitted:
            instance.level = tree_dict['level']
            instance.n_nodes = tree_dict['n_nodes']
            instance.tau_matrix = np.array(tree_dict['tau_matrix'])
            instance.previous_tree = cls._deserialize_previous_tree(tree_dict, previous)
            instance.edges = [Edge.from_dict(edge) for edge in tree_dict['edges']]
        return instance
def from_dict ( cls , tree_dict , previous = None ) : instance = cls ( tree_dict [ 'tree_type' ] ) fitted = tree_dict [ 'fitted' ] instance . fitted = fitted if fitted : instance . level = tree_dict [ 'level' ] instance . n_nodes = tree_dict [ 'n_nodes' ] instance . tau_matrix = np . array ( tree_dict [ 'tau_matrix' ] ) instance . previous_tree = cls . _deserialize_previous_tree ( tree_dict , previous ) instance . edges = [ Edge . from_dict ( edge ) for edge in tree_dict [ 'edges' ] ] return instance
Create a new instance from a dictionary.
Create a new instance from a dictionary .
"""Create a new instance from a dictionary."""
cls
tree_dict
previous