Practical overview
When it fits
Choose it when you want tree-based decision rules while retaining linear models in leaves, or want the library’s forest and boosting variants for residual modeling.
Who it is for
- Python practitioners building regression or classification models with scikit-learn.
- Machine-learning developers who want tree-based splits with linear predictions in terminal nodes.
Documented uses
- Fit a regression or classification model tree using a selected scikit-learn linear estimator.
- Model residuals with a random forest after fitting a linear model through LinearForest.
- Use LinearBoost in a pipeline, including for automated feature engineering.
Requirements & limits
The project is distributed as a Python library installable with pip and is licensed under MIT.
- Requires NumPy, SciPy and scikit-learn 0.24.2 or later.
- The README states support for Python 3.6 or above.
- LinearTree fits linear estimators in tree nodes; LinearForest models residuals with a random forest, while LinearBoost uses a two-stage residual-based process.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Install linear-tree
Install the library and its documented Python dependencies.
Before you start
- Python 3.6 or above
- NumPy, SciPy, and scikit-learn version 0.24.2 or later
Steps
Install or upgrade the package with the command below.
pip install --upgrade linear-treeUse it in a Python environment that meets the documented Python and dependency requirements.
Expected outcome
The linear-tree package is installed for use with scikit-learn estimators.
Guide limitations
- The installation instructions do not document environment setup or troubleshooting.
Fit a linear tree regressor
Create synthetic regression data and fit a LinearTreeRegressor with LinearRegression as its base estimator.
Before you start
- linear-tree installed
- scikit-learn installed
Steps
Import
LinearRegression,LinearTreeRegressor, andmake_regression.Create data with
make_regression(n_samples=100, n_features=4, n_informative=2, n_targets=1, random_state=0, shuffle=False), assigning the outputs toXandy.Create
LinearTreeRegressor(base_estimator=LinearRegression()).Fit the estimator with
regr.fit(X, y).
Expected outcome
A linear tree regressor is fitted to the generated data.
Guide limitations
- The documented example demonstrates fitting only; it does not show prediction, evaluation, or model persistence.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 16 November 2026
- Original website title
- cerlymarco/linear-tree · Official homepage title · retained in its source language

