# Optimizing Linear Regression Machine Learning

**URL:** <https://forum.knime.com/t/optimizing-linear-regression-machine-learning/80891>\
**Category:** KNIME Analytics Platform\
**Tags:** machine-learning\
**Created:** [July 4, 2024, 9:11am UTC](https://forum.knime.com/t/optimizing-linear-regression-machine-learning/80891 "2024-07-04T09:11:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ananggaersan](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/a/3da27b/32.png) [@ananggaersan](https://forum.knime.com/u/ananggaersan)\
**Post date:** [July 4, 2024, 9:11am UTC](https://forum.knime.com/t/optimizing-linear-regression-machine-learning/80891/1 "2024-07-04T09:11:10Z")

</div>

Hi All or @SupportOfficer1 @SupportOfficer2 ,

I made a linear regression modelling to forecast revenue and used around 25 variables as below flow but still not getting a good result. can someone suggest any optimization method to improved the result ? I already used features selections and cross validation.

the variable contain data like number of samples, number of populations, wealth index, actual revenue as references

Current Results  
 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/f/3/f32939eaf0824cfc63358c2e23ab818087d0320a.png)

Flow

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

Cross Validation

 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/1/f/1fd587874097c0fd91154946556ab6f5489a60e4.png)

Thanks

---

<div class="post-metadata">

**Author:** ![tomljh](https://forum-cdn.knime.com/user_avatar/forum.knime.com/tomljh/32/67732_2.png) [@tomljh](https://forum.knime.com/u/tomljh)\
**Post date:** [July 4, 2024, 9:22am UTC](https://forum.knime.com/t/optimizing-linear-regression-machine-learning/80891/2 "2024-07-04T09:22:25Z")

</div>

Hi @ananggaersan  
If there are too many categorical features, it is recommended to try the random forest algorithm first. The default processing of categorical features by tree-based algorithms is acceptable.

If improvements are made on the linear model, one-hot encoding for categorical features may be effective. The node in KNIME is “one to many”.

BR

---

<div class="post-metadata">

**Author:** ![ananggaersan](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/a/3da27b/32.png) [@ananggaersan](https://forum.knime.com/u/ananggaersan)\
**Post date:** [July 4, 2024, 10:27am UTC](https://forum.knime.com/t/optimizing-linear-regression-machine-learning/80891/3 "2024-07-04T10:27:09Z")

</div>

Hi @tomljh ,

Thanks for the suggestion. May I know im which part I can put this one-to-many node ?

---

<div class="post-metadata">

**Author:** ![tomljh](https://forum-cdn.knime.com/user_avatar/forum.knime.com/tomljh/32/67732_2.png) [@tomljh](https://forum.knime.com/u/tomljh)\
**Post date:** [July 4, 2024, 11:03am UTC](https://forum.knime.com/t/optimizing-linear-regression-machine-learning/80891/4 "2024-07-04T11:03:35Z")

</div>

That node belongs to feature preprocessing, so it is generally used after reading the data and before splitting the dataset.

---

<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:** [October 2, 2024, 11:04am UTC](https://forum.knime.com/t/optimizing-linear-regression-machine-learning/80891/5 "2024-10-02T11:04:12Z")

</div>

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