# How to build a stacking regressor in Knime?

**URL:** <https://forum.knime.com/t/how-to-build-a-stacking-regressor-in-knime/46674>\
**Category:** KNIME Analytics Platform\
**Created:** [September 2, 2022, 1:32am UTC](https://forum.knime.com/t/how-to-build-a-stacking-regressor-in-knime/46674 "2022-09-02T01:32:25Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![HY\_Z](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/h/67e7ee/32.png) [@HY\_Z](https://forum.knime.com/u/HY_Z)\
**Post date:** [September 2, 2022, 1:32am UTC](https://forum.knime.com/t/how-to-build-a-stacking-regressor-in-knime/46674/1 "2022-09-02T01:32:26Z")

</div>

The regressor may have a few base models, such as a linear regressor, a tree model…

Any existing workflow can be referred to?

---

<div class="post-metadata">

**Author:** ![Daniel\_Weikert](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/d/e47c2d/32.png) [@Daniel\_Weikert](https://forum.knime.com/u/Daniel_Weikert)\
**Post date:** [September 2, 2022, 10:10am UTC](https://forum.knime.com/t/how-to-build-a-stacking-regressor-in-knime/46674/2 "2022-09-02T10:10:57Z")

</div>

I am not aware of a workflow example but in general i assume you first do predictions for the individual models then use column appender (or similar to combine the predictions and then use another linear learner with the predictions as features and the original target column for your prediction  
br

---

<div class="post-metadata">

**Author:** ![mlauber71](https://forum-cdn.knime.com/user_avatar/forum.knime.com/mlauber71/32/73590_2.png) [@mlauber71](https://forum.knime.com/u/mlauber71)\
**Post date:** [September 4, 2022, 7:51am UTC](https://forum.knime.com/t/how-to-build-a-stacking-regressor-in-knime/46674/3 "2022-09-04T07:51:27Z")

</div>

@HY_Z H2O.ai Automl would [support stacked models](https://docs.h2o.ai/h2o/latest-stable/h2o-docs/data-science/stacked-ensembles.html?highlight=stacked). You can use the [KNIME node](https://kni.me/n/0gd1E7-Fne7-HB5p):

 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/8/2/82928d6796e05e5b07a0417816889014225075bc.jpeg)

> **[H2O AutoML for Regression – knime](https://hub.knime.com/knime/spaces/Examples/04_Analytics/15_H2O_Machine_Learning/11_H2O_AutoML_Regression_Model~zDt85GR4CDRvyrtf/current-state)**
>
> This example shows how to build a regression model with H2O AutoML, predict new data and score the regression metrics for model evaluation. 1. Prepare: Load th…

Or you could use the packages wrapped with a R or Python node in KNIME which gives you more flexibility [concerning the settings](https://docs.h2o.ai/h2o/latest-stable/h2o-docs/automl.html):

> [@H2O.ai AutoML in KNIME for regression problems](https://forum.knime.com/t/h2o-ai-automl-in-knime-for-regression-problems/20924):
>
> H2O.ai Automl - a powerful auto-machine-learning framework wrapped with KNIME It features various models like Random Forest or XGBoost along with Deep Learning. It has wrappers for R and Python but also could be used from KNIME. The results will be written to a folder and the models will be stored in MOJO format to be used in KNIME (as well as on a Big Data cluster via Sparkling Water). One major parameter to set is the running time the model has to test various models and do some hyperparam…

---

<div class="post-metadata">

**Author:** ![HY\_Z](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/h/67e7ee/32.png) [@HY\_Z](https://forum.knime.com/u/HY_Z)\
**Post date:** [September 4, 2022, 10:26am UTC](https://forum.knime.com/t/how-to-build-a-stacking-regressor-in-knime/46674/4 "2022-09-04T10:26:42Z")

</div>

thanks for the info. Unluckily I dont have H2O.auto ML.

---

<div class="post-metadata">

**Author:** ![HY\_Z](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/h/67e7ee/32.png) [@HY\_Z](https://forum.knime.com/u/HY_Z)\
**Post date:** [September 4, 2022, 10:27am UTC](https://forum.knime.com/t/how-to-build-a-stacking-regressor-in-knime/46674/5 "2022-09-04T10:27:31Z")

</div>

thanks for the idea. Will try.

---

<div class="post-metadata">

**Author:** ![mlauber71](https://forum-cdn.knime.com/user_avatar/forum.knime.com/mlauber71/32/73590_2.png) [@mlauber71](https://forum.knime.com/u/mlauber71)\
**Post date:** [September 4, 2022, 10:35am UTC](https://forum.knime.com/t/how-to-build-a-stacking-regressor-in-knime/46674/6 "2022-09-04T10:35:24Z")

</div>

> [@HY\_Z](#):
>
> Unluckily I dont have H2O.auto ML.

Well you have if you install the [KNIME H2O Machine Learning Integration – KNIME Community Hub](https://kni.me/e/ahEvXl-NKGooJ7Od) with the [H2O AutoML Learner (Regression) – KNIME Community Hub](https://kni.me/n/0gd1E7-Fne7-HB5p)

[https://docs.knime.com/latest/analytics\_platform\_installation\_guide/index.html#\_installing\_extensions\_and\_integrations](https://docs.knime.com/latest/analytics_platform_installation_guide/index.html#_installing_extensions_and_integrations)

---

<div class="post-metadata">

**Author:** ![HY\_Z](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/h/67e7ee/32.png) [@HY\_Z](https://forum.knime.com/u/HY_Z)\
**Post date:** [September 4, 2022, 12:24pm UTC](https://forum.knime.com/t/how-to-build-a-stacking-regressor-in-knime/46674/8 "2022-09-04T12:24:49Z")

</div>

thanks. will check. does that mean we can use H2O extension node even when we dont have H2O model?

---

<div class="post-metadata">

**Author:** ![mlauber71](https://forum-cdn.knime.com/user_avatar/forum.knime.com/mlauber71/32/73590_2.png) [@mlauber71](https://forum.knime.com/u/mlauber71)\
**Post date:** [September 4, 2022, 12:48pm UTC](https://forum.knime.com/t/how-to-build-a-stacking-regressor-in-knime/46674/9 "2022-09-04T12:48:03Z")

</div>

@HY_Z I am not 100% sure I understand what you are asking. YOu can use the H2O.ai implementation in KNIME and build models and use them. H2O also does have a commercial product the models of which would not be compatible to be used with the free version.

Maybe you check the examples and try to describe in more details what you want to do.

---

<div class="post-metadata">

**Author:** ![HY\_Z](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/h/67e7ee/32.png) [@HY\_Z](https://forum.knime.com/u/HY_Z)\
**Post date:** [September 4, 2022, 2:40pm UTC](https://forum.knime.com/t/how-to-build-a-stacking-regressor-in-knime/46674/10 "2022-09-04T14:40:37Z")

</div>

@mlauber71: Thanks a lot. I download one example which uses H2O auto.ml and have a try just now. Amazing, my own data can be linked to the H2O.automl learner node and the regression model can be built.

will continue to try the stacking regression function.

---

<div class="post-metadata">

**Author:** ![mlauber71](https://forum-cdn.knime.com/user_avatar/forum.knime.com/mlauber71/32/73590_2.png) [@mlauber71](https://forum.knime.com/u/mlauber71)\
**Post date:** [September 4, 2022, 4:18pm UTC](https://forum.knime.com/t/how-to-build-a-stacking-regressor-in-knime/46674/11 "2022-09-04T16:18:17Z")

</div>

> [@HY\_Z](#):
>
> Amazing, my own data can be linked to the H2O.automl learner node and the regression model can be built.

Amazing, isn’t it 🙂 handling and analysing data and building models and so on is the whole point about knime.

If you want to learn more about knime and machine learning you might want to check these resources.

> [@Knime-based machine learning course?](https://forum.knime.com/t/knime-based-machine-learning-course/21876/2):
>
> First there is the ML learning part of the official course of KNIME [https://www.knime.com/knime-introductory-course/chapter6](https://www.knime.com/knime-introductory-course/chapter6) Then you could check out the KNIME press if you like more reading about things: This entry could also be relevant for you. It will also point you to the (free) Udemy course which also has a part on machine learning: Then well I will point you to two entries about some automatic machine learning with the help of KNIME and R or Python an H2O.ai since I think this wil…

> **[Machine Learning Meta Collection (with KNIME) – mlauber71](https://hub.knime.com/mlauber71/spaces/Public/_machine_learning_meta_collection~--zu7353LMafrYQ_/current-state)**
>
> Machine Learning Meta Collection (with KNIME) This meta collection is about machine learning. It contains links to some examples demonstrating several types of…

---

<div class="post-metadata">

**Author:** ![HY\_Z](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/h/67e7ee/32.png) [@HY\_Z](https://forum.knime.com/u/HY_Z)\
**Post date:** [September 5, 2022, 3:13am UTC](https://forum.knime.com/t/how-to-build-a-stacking-regressor-in-knime/46674/12 "2022-09-05T03:13:10Z")

</div>

@mlauber71 thanks for the explanation. The meta collection is with a lot of topics. will go through. thank you.

---

<div class="post-metadata">

**Author:** ![system](https://forum-cdn.knime.com/uploads/default/original/1X/ab3ccf34482a0329361734a18199390177204f15.png) [@system](https://forum.knime.com/u/system)\
**Post date:** [December 4, 2022, 3:13am UTC](https://forum.knime.com/t/how-to-build-a-stacking-regressor-in-knime/46674/13 "2022-12-04T03:13:38Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
