Skip to content

regression_tree

RegressionTree(*args, dot_graph_export_path=None, **kwargs)

Bases: SupervisedLearner

Wrapper class for sklearn's DecisionTreeRegressor.

Reference: https://scikit-learn.org/stable/modules/generated/sklearn.tree.DecisionTreeRegressor.html

Initialize the regression tree learner.

Parameters:

Name Type Description Default
*args Any

Positional arguments to pass to the DecisionTreeRegressor.

()
dot_graph_export_path None | str

Path to export the decision tree graph to.

None
**kwargs Any

Keyword arguments to pass to the DecisionTreeRegressor.

{}
Source code in src/flowcean/learners/regression_tree.py
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
def __init__(
    self,
    *args: Any,
    dot_graph_export_path: None | str = None,
    **kwargs: Any,
) -> None:
    """Initialize the regression tree learner.

    Args:
        *args: Positional arguments to pass to the DecisionTreeRegressor.
        dot_graph_export_path: Path to export the decision tree graph to.
        **kwargs: Keyword arguments to pass to the DecisionTreeRegressor.
    """
    self.regressor = DecisionTreeRegressor(
        *args, **kwargs, random_state=get_seed()
    )
    self.dot_graph_export_path = dot_graph_export_path