# In regression, select input columns using a list

**URL:** <https://forum.knime.com/t/in-regression-select-input-columns-using-a-list/91458>\
**Category:** KNIME Analytics Platform\
**Tags:** flow-variables\
**Created:** [February 19, 2026, 3:54pm UTC](https://forum.knime.com/t/in-regression-select-input-columns-using-a-list/91458 "2026-02-19T15:54:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![shughes2026](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/s/e95f7d/32.png) [@shughes2026](https://forum.knime.com/u/shughes2026)\
**Post date:** [February 19, 2026, 3:54pm UTC](https://forum.knime.com/t/in-regression-select-input-columns-using-a-list/91458/1 "2026-02-19T15:54:13Z")

</div>

Hi Folks,

Trying to understand how to dynamically select the input columns in the predictive tool. Everytime the workflow runs, the target variable will be the same so I can just select that. On each run, the columns I want to use will constantly be changing. I have the list of column name to use being read in each time (in a column called ‘var’). I’m trying to convert this to a variable to pass to the learner so it strictly only uses columns in that list. So far no joy. Any ideas on how to achieve this?

Thanks

---

<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:** [February 19, 2026, 4:40pm UTC](https://forum.knime.com/t/in-regression-select-input-columns-using-a-list/91458/2 "2026-02-19T16:40:24Z")

</div>

@shughes2026 you can [use a Regex pattern](https://forum.knime.com/t/looping-through-multiple-files-with-multiple-column-names/91363/2) and feed that to the selection of the column sin the Regression learner or any other place you want to select specific columns.

> **[Regex - Use Pattern to select columns to be handled with Group By Node -...](https://hub.knime.com/mlauber71/spaces/Forum/2026/Regex%20-%20Use%20Pattern%20to%20select%20columns%20to%20be%20handled%20with%20Group%20By%20Node%20-%20KNIME%20Forum%20(91363)~35Pn-WrtlZMjmhI-/current-state)**
>
> Use Regex Pattern to select columns to be handled with Group By Node

```auto
^(education-num|marital-status|occupation|relationship|race|sex|hours-per-week)$

```

 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/d/2/d239b600ab5a238e7ed4cb6ffc91f37c0c5115cf.png)

---

<div class="post-metadata">

**Author:** ![rfeigel](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/r/7ea924/32.png) [@rfeigel](https://forum.knime.com/u/rfeigel)\
**Post date:** [February 20, 2026, 2:34am UTC](https://forum.knime.com/t/in-regression-select-input-columns-using-a-list/91458/3 "2026-02-20T02:34:36Z")

</div>

@mlauber71’s approach is good. Just to prove in Knime there are usually multiple ways to accomplish something, here’s an alternative. Its slightly less labor intensive since it doesn’t require construction of the regex. The workflow is just a stub to show how to pass the selected columns as flow variables.  
[Linear Regression Learner w Flow Variables.knwf](https://forum.knime.com/uploads/short-url/6GZeiaefnnI5CXAtsbTUWaGFU9w.knwf) (71.7 KB)

 ![workflow](https://forum-cdn.knime.com/uploads/default/original/3X/b/0/b095484f18e77ed0093babc13351bfe6acf9996f.jpeg)  
 ![Flow Var](https://forum-cdn.knime.com/uploads/default/original/3X/7/a/7af5376bbc481b6a0abf6e4da3d1faf5293ed48c.jpeg)

---

<div class="post-metadata">

**Author:** ![shughes2026](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/s/e95f7d/32.png) [@shughes2026](https://forum.knime.com/u/shughes2026)\
**Post date:** [February 20, 2026, 9:11am UTC](https://forum.knime.com/t/in-regression-select-input-columns-using-a-list/91458/4 "2026-02-20T09:11:36Z")

</div>

Thanks both - really appreciated. Decided to park the dark arts of regex for another day, a bit too much for me 😉 The node based workflow baffled me as its the same way I’d built mine. However, on digging into your example, I didn’t realise I needed to group them as a ‘set’ , I was just passing the raw values through and it was picking the first one. Really really appreciate the help - it’s dug me out of a hole. Thanks!

---

<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:** [February 27, 2026, 9:12am UTC](https://forum.knime.com/t/in-regression-select-input-columns-using-a-list/91458/5 "2026-02-27T09:12:04Z")

</div>

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