Contents Menu Expand Light mode Dark mode Auto light/dark mode
halerium 3.3.1 documentation
halerium 3.3.1 documentation
  • Getting Started
    • Installation
    • High-level usage - Examples
      • Causal Structures - Creation & Training
      • Causal Structures - Prediction
      • Objectives - Introduction
      • Causal Structures - Intervention-Prediction
      • Performance Evaluation
      • Outlier Detection
      • Influence Estimation
      • Rank Estimation
      • Probability Estimation
      • Causal Inference Example - Coupon Case
      • Causal Structures - applied on the California School data set
      • Causal Structures and Dependencies
    • High-level usage - Code Overview
      • Causal Structures - Creation & Training
      • Causal Structures - Prediction
      • Objectives - Introduction
      • Performance Evaluation
      • Outlier Detection
      • Influence Estimation
      • Rank Estimation
      • Probability Estimation
    • Building blocks of halerium models
    • Low-level usage - Examples
      • Building blocks of halerium models
      • Example: Inheritance and body heights
      • Simple training with the Trainer
      • More on training models
      • What happens during model creation and training
      • Distributions
      • Regression
      • Gaussian Process Regression
      • Logistic regression
      • Copying, templating and serialization
      • Estimate probabilities with the Probability Estimator
      • Estimate influences with the Influence Estimator
      • Make predictions with the Predictor
      • Evaluate the quality of a model with the Evaluator
      • Estimate ranks with the RankEstimator
      • Detecting outliers with the OutlierDetector
      • Causal Models - the Basics
      • Creating MA, AR, and ARMA Graphs
      • Applying an SARIMA model to the DutchSales data
      • Full densities instead of point predictions
      • Model uncertainty propagation
      • Training with missing data
      • Encoding causal structure
      • Reusing models
    • Low-level usage - Code Overview
      • Scoping Details
      • Displaying Graphs
      • Details about links
      • More on training models
      • Simple training with the Trainer
      • Estimate probabilities with the Probability Estimator
      • Estimate influences with the Influence Estimator
      • Make predictions with the Predictor
      • Evaluate the quality of a model with the Evaluator
      • Estimate ranks with the RankEstimator
      • Detecting outliers with the OutlierDetector
      • Distributions
      • Regression
      • Gaussian Process Regression
      • Logistic regression
      • Causal Models - the Basics
      • Creating MA, AR, and ARMA Graphs
      • Applying an SARIMA model to the DutchSales data
  • High-level usage - Examples
    • Causal Structures - Creation & Training
    • Causal Structures - Prediction
    • Objectives - Introduction
    • Causal Structures - Intervention-Prediction
    • Performance Evaluation
    • Outlier Detection
    • Influence Estimation
    • Rank Estimation
    • Probability Estimation
    • Causal Inference Example - Coupon Case
    • Causal Structures - applied on the California School data set
    • Causal Structures and Dependencies
  • High-level usage - Code Overview
    • Causal Structures - Creation & Training
    • Causal Structures - Prediction
    • Objectives - Introduction
    • Performance Evaluation
    • Outlier Detection
    • Influence Estimation
    • Rank Estimation
    • Probability Estimation
  • Low-level usage - Examples
    • Building blocks of halerium models
    • Example: Inheritance and body heights
    • Simple training with the Trainer
    • More on training models
    • What happens during model creation and training
    • Distributions
    • Regression
    • Gaussian Process Regression
    • Logistic regression
    • Copying, templating and serialization
    • Estimate probabilities with the Probability Estimator
    • Estimate influences with the Influence Estimator
    • Make predictions with the Predictor
    • Evaluate the quality of a model with the Evaluator
    • Estimate ranks with the RankEstimator
    • Detecting outliers with the OutlierDetector
    • Causal Models - the Basics
    • Creating MA, AR, and ARMA Graphs
    • Applying an SARIMA model to the DutchSales data
    • Full densities instead of point predictions
    • Model uncertainty propagation
    • Training with missing data
    • Encoding causal structure
    • Reusing models
  • Low-level usage - Code Overview
    • Scoping Details
    • Displaying Graphs
    • Details about links
    • More on training models
    • Simple training with the Trainer
    • Estimate probabilities with the Probability Estimator
    • Estimate influences with the Influence Estimator
    • Make predictions with the Predictor
    • Evaluate the quality of a model with the Evaluator
    • Estimate ranks with the RankEstimator
    • Detecting outliers with the OutlierDetector
    • Distributions
    • Regression
    • Gaussian Process Regression
    • Logistic regression
    • Causal Models - the Basics
    • Creating MA, AR, and ARMA Graphs
    • Applying an SARIMA model to the DutchSales data
  • Release Notes
Back to top

The Link class#

Aliases#

halerium.core.graph.Link
class Link(name=None, frame=None)#

The halerium Link class.

This class holds links between entities or variables. The user is not meant to create Link instances directly, but to use the link function instead.

The halerium Link class.

Parameters:
  • name (str, optional) – The name of the instance. If None it is chosen automatically. The default is None.

  • frame – The frame for name injection.

accept(visitor)#

Accept visitor.

Parameters:

visitor – The visitor to accept.

Returns:

The result of the visit.

Return type:

result

destruct(_recursion=False)#

Destructs the link.

Parameters:

_recursion (bool, optional) – Argument for handling recursion. Not meant to be altered by the user.

establish_link()#

Established the link by calling the link method of its target.

get_containing_class(scopetor_cls)#

Get the closest parent that is of a specific type.

Parameters:

scopetor_cls (scopetor subclass) – The scopetor subclass of which the next containing instance is to be found.

Raises:

ValueError – If no containing scopetor of type scopetor_cls is found, an error is raised.

Returns:

scope – The containing scopetor of type scopetor_cls.

Return type:

scopetor_cls

Examples

>>> from halerium.core import Graph, Entity
>>> g = Graph("g")
>>> with g:
>>>     e = Entity("e")
>>>     with e:
>>>         Entity("m")
>>> g.e.m.get_containing_class(Graph) is g
True
>>> assert g.e.m.get_containing_class(Entity) is g.e
True
property global_name#

The global name of the scopee.

The global name is a chain of all parent names of this scopee separated by ‘/’ characters.

is_child_of(scopetor, include_self=True)#

Whether is child of scopetor.

This method checks whether the scopee is a (grand-) child of a given scopetor.

Parameters:
  • scopetor (Scopetor) – The (possible) parent scopetor

  • include_self (bool) – If True, a.is_child_of(a) would return True. If False, a.is_child_of(a) would return False.

Returns:

Whether self is a (grand-)child of scopetor or not.

Return type:

bool

property name#

The name of the scopee.

property source#

The link’s source.

property target#

The link’s target.

Copyright © 2020-2022, Erium GmbH
Made with Sphinx and @pradyunsg's Furo
Contents
  • The Link class
    • Aliases